[pkg-dhcp-devel] Bug#607276: isc-dhcp-client: dhclient-script doesn't check for netmask changes

Theo Cabrerizo Diem diem at carpediem.sh
Thu Mar 13 15:03:05 UTC 2014

Package: isc-dhcp-client
Version: 4.2.2.dfsg.1-5+deb70u6
Followup-For: Bug #607276

Dear Maintainer,

I've run into the same problem after reconfiguring an existing dhcpd
into our networks. If the IP address of the host doesn't change, the
interface isn't reconfigured.

The offending line in /sbin/dhclient-script seems to be (starting from
line 210):

        if [ -n "$old_ip_address" ] &&
           [ "$old_ip_address" != "$new_ip_address" ]; then
            # leased IP has changed => flush it
            ip -4 addr flush dev ${interface} label ${interface}

        if [ -z "$old_ip_address" ] ||
           [ "$old_ip_address" != "$new_ip_address" ] ||
           [ "$reason" = "BOUND" ] || [ "$reason" = "REBOOT" ]; then
            # new IP has been leased or leased IP changed => set it
            ip -4 addr add
${new_ip_address}${new_subnet_mask:+/$new_subnet_mask} \
                ${new_broadcast_address:+broadcast $new_broadcast_address} \
                dev ${interface} label ${interface}

It already uses $new_subnet_mask but it doesn't check in the if clause
if it have been changed from the current one.

IMHO the if clause should check not only for the subnet mask change
but any variable used inside that big if block such as:
- ip_address (currently checked)
- subnet_mask
- broadcast_address
- interface_mtu

On experimental, the RFC3442 gets incorporated into dhclient-script
instead of being defined under the hooks directory, which makes also
one more variable to check if it have been changed :
- rfc3442_classless_static_routers

Thus if your dhcpd sends a different value for the variables mentioned
above without changing the assigned IP address or during a initial
assignment, it will get ignored.

Many thanks

-- System Information:
Debian Release: 7.1
Architecture: amd64 (x86_64)

Kernel: Linux 3.2.0-4-amd64 (SMP w/1 CPU core)
Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8)
Shell: /bin/sh linked to /bin/dash

Versions of packages isc-dhcp-client depends on:
ii  debianutils      4.3.2
ii  iproute          20120521-3+b3
ii  isc-dhcp-common  4.2.2.dfsg.1-5+deb70u6
ii  libc6            2.13-38

isc-dhcp-client recommends no packages.

Versions of packages isc-dhcp-client suggests:
pn  avahi-autoipd  <none>
pn  resolvconf     <none>

-- no debconf information

More information about the pkg-dhcp-devel mailing list