dhclient[357]: send_packet: Invalid argument

Gleb Smirnoff glebius at FreeBSD.org
Thu Sep 11 05:48:56 UTC 2014


On Wed, Sep 10, 2014 at 11:10:14PM +0300, Andriy Gapon wrote:
A> On 10/09/2014 23:02, Andriy Gapon wrote:
A> > 
A> > I recently performed an upgrade from a very old HEAD to a fresh one and after
A> > that I started to see a lot of the following messages:
A> > 
A> > dhclient[357]: send_packet: Invalid argument
A> > 
A> > This is how ktrace sees them:
A> >    357 dhclient CALL  sendmsg(0x7,0x7fffffffd9f0,0)
A> >    357 dhclient STRU  struct sockaddr { AF_INET, 82.xx.xx.xx:67 }
A> >    357 dhclient RET   sendmsg -1 errno 22 Invalid argument
A> > 
A> > This where the error originates according to DTrace:
A> >   0  32096                rip_output:return
A> >               kernel`rip_send+0x46
A> >               kernel`sosend_generic+0x56c
A> >               kernel`sosend+0x1e
A> >               kernel`kern_sendit+0x201
A> >               kernel`sendit+0x10c
A> >               kernel`sys_sendmsg+0x61
A> >               kernel`amd64_syscall+0x3dd
A> >               kernel`0xffffffff808414ab
A> > 
A> > Looking at rip_output() I discovered r270929, https://wiki.freebsd.org/SOCK_RAW
A> > Seems like the base DHCP client is affected?
A> 
A> Oh, I've just actually noticed it: sbin/dhclient/packet.c, assemble_udp_ip_header()
A> 
A>         /*
A>          * While the BPF -- used for broadcasts -- expects a "true" IP header
A>          * with all the bytes in network byte order, the raw socket interface
A>          * which is used for unicasts expects the ip_len field to be in host
A>          * byte order.  In both cases, the checksum has to be correct, so this
A>          * is as good a place as any to turn the bytes around again.
A>          */
A>         if (to != INADDR_BROADCAST)
A>                 ip.ip_len = ntohs(ip.ip_len);

Fixed, thanks.

-- 
Totus tuus, Glebius.


More information about the freebsd-net mailing list