dhclient failed to send packet (DHCPRELEASE) on Debian 11

Darren Ankney darren.ankney at gmail.com
Sun Jan 22 19:18:42 UTC 2023


That doesn’t look like ‘c’ to me.  Looks more like some kind of shell script.  I’m not super familiar with dhclient, but it probably does block until it is done with whatever it is doing as most programs do.  

I’d definitely say to go ask about this on a Debian list as this is not really much to do with dhclient and more to do with how Debian is shutting down the interface.

> On Jan 22, 2023, at 1:19 PM, vom513 <vom513 at gmail.com> wrote:
> 
>> 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 ?
> 
> -- 
> ISC funds the development of this software with paid support subscriptions. Contact us at https://www.isc.org/contact/ for more information.
> 
> dhcp-users mailing list
> dhcp-users at lists.isc.org
> https://lists.isc.org/mailman/listinfo/dhcp-users



More information about the dhcp-users mailing list