dhclient failed to send packet (DHCPRELEASE) on Debian 11

vom513 vom513 at gmail.com
Sun Jan 22 18:19:38 UTC 2023


> On Jan 22, 2023, at 8:33 AM, Darren Ankney <darren.ankney at gmail.com> wrote:
> 
> I would say to take this to a Debian mailing list.  dhclient is being commanded by Debian to send a release.  I think you are probably right about it being a timing issue (ie: sometimes trying to send after the interface is down).  You could probably find a shell script somewhere that is actually performing these actions and maybe even fix it. Then you’d have something to show the Debian developers as well.
> 

Thanks for the reply.  I probably will go check out some Debian resources.  However, in the source for the “ifupdown” package from Debian, I believe I found the section that calls dhclient to release.  Looks like this is a “defn” file that gets translated to C ? (I’ve never ran into one of these files before…).   So that means the instructions and arguments for dhclient are actually compiled into ifup (ifdown is a symlink to ifup).  Check it out:

—
  down
    CLIENT="-i"; [[[ "%client%" = no ] && CLIENT="";]] dhclient -4 -v $CLIENT -r -pf /run/dhclient.%iface%.pid -lf /var/lib/dhcp/dhclient.%iface%.leases -I -df /var/lib/dhcp/dhclient6.%iface%.leases %iface% \
        if (execable("dhclient"))
    if test -f /run/udhcpc.%iface%.pid; then kill -USR2 $(cat /run/udhcpc.%iface%.pid); kill -TERM $(cat /run/udhcpc.%iface%.pid); fi \
        elsif (execable("udhcpc"))
    dhcpcd -k %iface% \
        elsif (execable("dhcpcd"))
    echo 'No DHCP client software found!' >&2; false \
        elsif (1)

    ip link set dev %iface% down \
                if (iface_is_link())
—

Looks to me like the interface isn’t brought down till after dhclient is ran with “-r” (release) ?  So perhaps not a race condition - at least in the traditional way of thinking ?  I don’t think dhclient immediately returns/exits does it ?  It does it’s thing and prints to STDOUT I would think ?  So if that’s true (someone please correct me if I’m wrong on this) - the command to take the interface down shouldn’t happen till after dhclient is done ?



More information about the dhcp-users mailing list