dhcp: Only print "entering" message if state actually changes.
authorBen Pfaff <blp@nicira.com>
Tue, 22 Jul 2008 20:32:42 +0000 (13:32 -0700)
committerBen Pfaff <blp@nicira.com>
Wed, 23 Jul 2008 20:12:17 +0000 (13:12 -0700)
lib/dhcp-client.c

index b2588e19a8688868b8a0d90dba739eb631ed0896..436e75455ec5e4b807bc01b4f6a9daf90d31e16f 100644 (file)
@@ -642,8 +642,10 @@ state_transition(struct dhclient *cli, enum dhclient_state state)
 {
     bool was_bound = dhclient_is_bound(cli);
     bool am_bound;
-    VLOG_DBG("entering %s", state_name(state));
-    cli->state = state;
+    if (cli->state != state) {
+        VLOG_DBG("entering %s", state_name(state)); 
+        cli->state = state;
+    }
     cli->state_entered = time(0);
     cli->retransmit = cli->delay = 0;
     am_bound = dhclient_is_bound(cli);
@@ -700,7 +702,6 @@ dhclient_msg_init(struct dhclient *cli, enum dhcp_msg_type type,
     msg->secs = cli->secs;
     msg->type = type;
     memcpy(msg->chaddr, netdev_get_etheraddr(cli->netdev), ETH_ADDR_LEN);
-    
 }
 
 static unsigned int