From owner-freebsd-net@FreeBSD.ORG Fri Oct 12 04:45:20 2012 Return-Path: Delivered-To: net@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 19948185 for ; Fri, 12 Oct 2012 04:45:20 +0000 (UTC) (envelope-from glebius@FreeBSD.org) Received: from cell.glebius.int.ru (glebius.int.ru [81.19.64.117]) by mx1.freebsd.org (Postfix) with ESMTP id 6B8018FC08 for ; Fri, 12 Oct 2012 04:45:19 +0000 (UTC) Received: from cell.glebius.int.ru (localhost [127.0.0.1]) by cell.glebius.int.ru (8.14.5/8.14.5) with ESMTP id q9C4jGI3098583; Fri, 12 Oct 2012 08:45:16 +0400 (MSK) (envelope-from glebius@FreeBSD.org) Received: (from glebius@localhost) by cell.glebius.int.ru (8.14.5/8.14.5/Submit) id q9C4jGOd098582; Fri, 12 Oct 2012 08:45:16 +0400 (MSK) (envelope-from glebius@FreeBSD.org) X-Authentication-Warning: cell.glebius.int.ru: glebius set sender to glebius@FreeBSD.org using -f Date: Fri, 12 Oct 2012 08:45:16 +0400 From: Gleb Smirnoff To: Olivier Cochard-Labb? Subject: Re: [CFT/Review] net byte order for AF_INET Message-ID: <20121012044516.GJ89655@glebius.int.ru> References: <20121009154128.GU34622@FreeBSD.org> <20121010195842.GH34622@FreeBSD.org> <20121010222651.GR40452@mdounin.ru> <20121010233404.GI34622@glebius.int.ru> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="6TrnltStXW4iwmi0" Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Cc: net@FreeBSD.org X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.14 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 12 Oct 2012 04:45:20 -0000 --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=koi8-r Content-Disposition: inline Olivier, thanks for help! On Fri, Oct 12, 2012 at 02:20:55AM +0200, Olivier Cochard-Labb? wrote: O> I've done some tests with this net byte ordered(NBO) patch: O> - I've compiled 2 i386 images of BSD Router Project (current branch O> rev241418): One with the patch, and the other without the patch [1] O> - I've run my "full-features testing lab" under VirtualBox [2] using O> theses images. O> O> Here are the differences: O> - I can't SSH to and between the NBO-patched-FreeBSD; O> - Lot's of messages "in_cksum_skip: out of data by 28560/23460" on the O> non-patched FreeBSD (R2 and R3 on the diagram in [2]) O> - PPTP tunnel (net/mpd5) didn't works on the NBO-patched-FreeBSD; Not working SSH suprises me :( PPTP not, since not tested yet. Can you please apply attached patch to sys/i386/i386/in_cksum.c? It will print backtrace once the invariant failed. -- Totus tuus, Glebius. --6TrnltStXW4iwmi0 Content-Type: text/x-diff; charset=koi8-r Content-Disposition: attachment; filename="in_cksum.c.diff" Index: in_cksum.c =================================================================== --- in_cksum.c (revision 241405) +++ in_cksum.c (working copy) @@ -36,6 +36,7 @@ #include #include #include +#include #include #include @@ -257,6 +258,7 @@ * reorder operations, this will generally take place in parallel with * other calculations. */ +static int once = 1; u_short in_cksum_skip(m, len, skip) struct mbuf *m; @@ -477,8 +479,13 @@ su.c[0] = *(char *)w; } - if (len) + if (len) { + if (once) { + kdb_backtrace(); + once = 0; + } printf("%s: out of data by %d\n", __func__, len); + } if (mlen == -1) { /* The last mbuf has odd # of bytes. Follow the standard (the odd byte is shifted left by 8 bits) */ --6TrnltStXW4iwmi0--