[PATCH] dhclient: send DHCPv6 Release Message according to the dhclient6.leases file
Wang Xingtong
wangxingtong at cn.fujitsu.com
Wed Dec 22 09:52:25 UTC 2010
When we decide to release address of interface, dhclient should send
DHCPv6 Release Message to dhcp server according to the dhclient6.leases file.
For the following dhclient6.leases file, If we need to release IA-PD,
before applying patch, we execute "dhclient -6 -P -r eth0".
But after applying patch, we only need to execute "dhclient -6 -r eth0".
[root@(none) ~]# cat /var/db/dhclient6.leases
default-duid "\000\001\000\001\024\033;\275\000\025\027qQ\364";
lease6 {
interface "eth0";
ia-pd 17:71:51:f4 {
starts 1284013936;
renew 50;
rebind 80;
iaprefix 3ffe:501:ffff:111::/64 {
starts 1284013936;
preferred-life 100;
max-life 200;
}
}
option dhcp6.client-id 0:1:0:1:14:1b:3b:bd:0:15:17:71:51:f4;
option dhcp6.server-id 0:1:0:1:14:18:1:c3:0:27:19:9b:60:8d;
option dhcp6.name-servers 3ffe:501:ffff:100:200:ff:fe00:3f3e;
}
Signed-off-by: Shan Wei <shanwei at cn.fujitsu.com>
---
client/dhc6.c | 3 +--
1 files changed, 1 insertions(+), 2 deletions(-)
diff --git a/client/dhc6.c b/client/dhc6.c
index cafe122..5289f09 100644
--- a/client/dhc6.c
+++ b/client/dhc6.c
@@ -2225,8 +2225,7 @@ do_release6(void *input)
data_string_forget(&ds, MDL);
goto release_done;
}
- if (wanted_ia_pd &&
- dhc6_add_ia_pd(client, &ds, client->active_lease,
+ if (dhc6_add_ia_pd(client, &ds, client->active_lease,
DHCPV6_RELEASE) != ISC_R_SUCCESS) {
data_string_forget(&ds, MDL);
goto release_done;
-- 1.6.3.3
More information about the dhcp-hackers
mailing list