From: Ben Pfaff Date: Tue, 22 Jul 2008 21:00:03 +0000 (-0700) Subject: dhcp: Be more precise about updating 'changed' flag. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=b761e41bb26ea4bdbea2f158d919951a3ca43ba1;p=openvswitch dhcp: Be more precise about updating 'changed' flag. There's no need to set changed unconditionally in dhclient_init(), and it can make extra work for the users of the dhclient, by causing them to think that something changed when it didn't. --- diff --git a/lib/dhcp-client.c b/lib/dhcp-client.c index c1724477..4735d597 100644 --- a/lib/dhcp-client.c +++ b/lib/dhcp-client.c @@ -214,7 +214,6 @@ dhclient_init(struct dhclient *cli, uint32_t requested_ip) { state_transition(cli, requested_ip ? S_INIT_REBOOT : S_INIT); cli->ipaddr = requested_ip; - cli->changed = true; cli->min_timeout = 0; cli->init_delay = 0; } @@ -230,6 +229,7 @@ dhclient_release(struct dhclient *cli) msg.ciaddr = cli->ipaddr; do_send_msg(cli, &msg); dhcp_msg_uninit(&msg); + cli->changed = true; } state_transition(cli, S_RELEASED); cli->min_timeout = UINT_MAX;