From owner-freebsd-net@FreeBSD.ORG Thu Sep 11 05:48:56 2014 Return-Path: Delivered-To: freebsd-net@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1 with cipher ADH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 1CB8E89D; Thu, 11 Sep 2014 05:48:56 +0000 (UTC) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.69.10]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client CN "cell.glebius.int.ru", Issuer "cell.glebius.int.ru" (not verified)) by mx1.freebsd.org (Postfix) with ESMTPS id 7A4A3FC6; Thu, 11 Sep 2014 05:48:55 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.9/8.14.9) with ESMTP id s8B5mpFp054740 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO); Thu, 11 Sep 2014 09:48:51 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.9/8.14.9/Submit) id s8B5mpOW054739; Thu, 11 Sep 2014 09:48:51 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Thu, 11 Sep 2014 09:48:51 +0400 From: Gleb Smirnoff To: Andriy Gapon Subject: Re: dhclient[357]: send_packet: Invalid argument Message-ID: <20140911054851.GQ17059@glebius.int.ru> References: <5410AE40.9040301@FreeBSD.org> <5410B026.5020703@FreeBSD.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5410B026.5020703@FreeBSD.org> User-Agent: Mutt/1.5.23 (2014-03-12) Cc: Olivier =?utf-8?B?Q29jaGFyZC1MYWJi77+9?= , freebsd-net X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 11 Sep 2014 05:48:56 -0000 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.