From b761e41bb26ea4bdbea2f158d919951a3ca43ba1 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Tue, 22 Jul 2008 14:00:03 -0700 Subject: [PATCH] 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. --- lib/dhcp-client.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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; -- 2.30.2