From owner-freebsd-current@FreeBSD.ORG Wed Jan 17 17:31:37 2007 Return-Path: X-Original-To: freebsd-current@freebsd.org Delivered-To: freebsd-current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 9823416A407; Wed, 17 Jan 2007 17:31:37 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from server.baldwin.cx (66-23-211-162.clients.speedfactory.net [66.23.211.162]) by mx1.freebsd.org (Postfix) with ESMTP id 2200813C474; Wed, 17 Jan 2007 17:31:35 +0000 (UTC) (envelope-from jhb@freebsd.org) Received: from localhost.corp.yahoo.com (john@localhost [127.0.0.1]) (authenticated bits=0) by server.baldwin.cx (8.13.6/8.13.6) with ESMTP id l0HHVTRJ055288; Wed, 17 Jan 2007 12:31:29 -0500 (EST) (envelope-from jhb@freebsd.org) From: John Baldwin To: freebsd-current@freebsd.org Date: Wed, 17 Jan 2007 12:09:53 -0500 User-Agent: KMail/1.9.1 References: <20061130105537.A69725@xorpc.icir.org> <20061201100821.A85139@xorpc.icir.org> In-Reply-To: <20061201100821.A85139@xorpc.icir.org> MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: 7bit Content-Disposition: inline Message-Id: <200701171209.54142.jhb@freebsd.org> X-Greylist: Sender succeeded SMTP AUTH authentication, not delayed by milter-greylist-2.0.2 (server.baldwin.cx [127.0.0.1]); Wed, 17 Jan 2007 12:31:30 -0500 (EST) X-Virus-Scanned: ClamAV 0.88.3/2459/Tue Jan 16 17:03:34 2007 on server.baldwin.cx X-Virus-Status: Clean X-Spam-Status: No, score=-4.4 required=4.2 tests=ALL_TRUSTED,AWL,BAYES_00 autolearn=ham version=3.1.3 X-Spam-Checker-Version: SpamAssassin 3.1.3 (2006-06-01) on server.baldwin.cx Cc: Luigi Rizzo , current@freebsd.org Subject: Re: [bug found] Re: byte swapped udp length in diskless bootp request ? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Wed, 17 Jan 2007 17:31:37 -0000 On Friday 01 December 2006 13:08, Luigi Rizzo wrote: > On Thu, Nov 30, 2006 at 10:55:37AM -0800, Luigi Rizzo wrote: > > i was just trying to diskless-boot a -current kernel, > > and when it was time for the kernel to acquire the address > > i was getting the usual > > > > DHCP/BOOTP timeout for server 255.255.255.255 > > > > Usually it is because of lack of connectivity, but > > a bit of inspection on the server showed (as you can see > > below) that the UDP len field is byte-swapped - the 05bc > > in the packet is in little-endian format, causing the > > server to reject it. > > [ actually, it is the IP len that is byte-swapped ] > > > I am trying to follow the code in sys/nfsclient/bootp_subr.c > > (which should send the packet) but it seemd to call sosend() > > (at line 755) to generate the packet, so it looks really strange > > that the bug is in such a central place... any ideas ? > > as a followup: > > Downgrading sys/kern/uipc_socket.c to version 1.284 make HEAD > work again with in-kernel bootp.. > > i managed to locate the bug in the following commit: > > http://www.freebsd.org/cgi/cvsweb.cgi/src/sys/kern/uipc_socket.c.diff?r1=1.284&r2=1.285 > > Revision 1.285 Thu Nov 2 17:45:28 2006 UTC (4 weeks ago) by andre > Branch: MAIN > Changes since 1.284: +29 -1 lines > Diff to previous 1.284 (colored) > > Use the improved m_uiotombuf() function instead of home grown sosend_copyin() > to do the userland to kernel copying in sosend_generic() and sosend_dgram(). > > sosend_copyin() is retained for ZERO_COPY_SOCKETS which are not yet supported > by m_uiotombuf(). > > I don't know exactly where the problem is, but the bug i found is triggered > by in-kernel sockets (such as the one used by the internal bootp client) > so maybe this was a case not tested by andre. > > I am unclear on where is the actual bug. hopefully something simple... Does the bootp code try to send a 0 byte packet per chance? -- John Baldwin