Date: Fri, 29 Jun 2007 15:04:57 +0200 From: Max Laier <max@love2party.net> To: freebsd-pf@freebsd.org Cc: Hugo Koji Kobayashi <koji@registro.br> Subject: Re: udp fragmentation Message-ID: <200706291505.05141.max@love2party.net> In-Reply-To: <200706291431.37159.max@love2party.net> References: <20070528224225.GC40678@registro.br> <20070629000630.GA52912@cdnetworks.co.kr> <200706291431.37159.max@love2party.net>
next in thread | previous in thread | raw e-mail | index | archive | help
--nextPart1491564.vFizXhlHIe Content-Type: multipart/mixed; boundary="Boundary-01=_7NQhGr+slY9DBHV" Content-Transfer-Encoding: 7bit Content-Disposition: inline --Boundary-01=_7NQhGr+slY9DBHV Content-Type: text/plain; charset="iso-8859-6" Content-Transfer-Encoding: quoted-printable Content-Disposition: inline On Friday 29 June 2007, Max Laier wrote: > On Friday 29 June 2007, Pyun YongHyeon wrote: > > On Thu, Jun 28, 2007 at 10:56:01PM +0200, Max Laier wrote: > > > > > The only thing common about your setup seems to be the bge(4) > > > > > NIC. Can you try disabling hardware checksumming (ifconfig > > > > > -txcsum -rxcsum)? My test is over a hardware checksumming > > > > > fxp(4) card, though. > > > > > > > > Yes, this eliminated the issue. Bug in bge driver? > > > > > > Kind of - the driver claims to have done UDP checksum testing on > > > the fragment (which is impossible). The attached patch should fix > > > the issue for bge(4) and any other similar NIC. > > > > I guess bge(4) has Rx checksum offload bug on fragmented UDP > > datagrams. Since other hardwares with checksum offload capability > > does not show this issue, it could be related with UDP pseudo header > > calculation. How about disabling UDP pseudo header calculation? > > > > I don't have bge(4) hardwares so the patch is just guess work. > > In fact it doesn't seem broken at all, we would just have to do > something along the lines of ip_input.c::ip_reass() (line 1001 ff): >... > Have to ponder a bit, if this is easily possible in pf's reassembly. Works - see attached. Does anyone know of a tool to generate nasty fragments to really test=20 this? Reordered / overlapping / etc. ? =2D-=20 /"\ Best regards, | mlaier@freebsd.org \ / Max Laier | ICQ #67774661 X http://pf4freebsd.love2party.net/ | mlaier@EFnet / \ ASCII Ribbon Campaign | Against HTML Mail and News --Boundary-01=_7NQhGr+slY9DBHV Content-Type: text/x-diff; charset="iso-8859-6"; name="frag_csum.diff" Content-Transfer-Encoding: quoted-printable Content-Disposition: attachment; filename="frag_csum.diff" =3D=3D=3D=3D //depot/user/mlaier/pfsrc/sys/contrib/pf/net/pf_norm.c#9 - /ho= me/mlaier/devel/FreeBSD/p4/pfsrc/sys/contrib/pf/net/pf_norm.c =3D=3D=3D=3D =2D-- /tmp/tmp.1610.37 2007-06-29 15:01:49.552518013 +0200 +++ /home/mlaier/devel/FreeBSD/p4/pfsrc/sys/contrib/pf/net/pf_norm.c 2007-0= 6-29 14:50:37.299015057 +0200 @@ -568,8 +568,22 @@ m2 =3D frent->fr_m; pool_put(&pf_frent_pl, frent); pf_nfrents--; +#ifdef __FreeBSD__ + DPFPRINTF(("csum: 0x%x 0x%x\n", m->m_pkthdr.csum_flags, + m->m_pkthdr.csum_data)); + m->m_pkthdr.csum_flags &=3D m2->m_pkthdr.csum_flags; + m->m_pkthdr.csum_data +=3D m2->m_pkthdr.csum_data; +#endif m_cat(m, m2); } +#ifdef __FreeBSD__ + DPFPRINTF(("fcsum: 0x%x 0x%x\n", m->m_pkthdr.csum_flags, + m->m_pkthdr.csum_data)); + m->m_pkthdr.csum_data =3D + (m->m_pkthdr.csum_data & 0xffff) + (m->m_pkthdr.csum_data >> 16); + DPFPRINTF(("fcsum: 0x%x 0x%x\n", m->m_pkthdr.csum_flags, + m->m_pkthdr.csum_data)); +#endif =20 ip->ip_src =3D (*frag)->fr_src; ip->ip_dst =3D (*frag)->fr_dst; --Boundary-01=_7NQhGr+slY9DBHV-- --nextPart1491564.vFizXhlHIe Content-Type: application/pgp-signature -----BEGIN PGP SIGNATURE----- Version: GnuPG v2.0.3 (FreeBSD) iD8DBQBGhQOBXyyEoT62BG0RAn2KAJ91ZmsYT/BFkrWqbkmDjuF3Q9VyxgCfRS2S Wm9RSilpEWGLPHldnc7qyAA= =udjb -----END PGP SIGNATURE----- --nextPart1491564.vFizXhlHIe--
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200706291505.05141.max>