Date: Wed, 28 Apr 2004 10:05:54 +0300 From: Ruslan Ermilov <ru@freebsd.org> To: Mark Santcroos <marks@ripe.net> Cc: net@freebsd.org Subject: Re: udp checksum on raw sockets Message-ID: <20040428070554.GB25064@ip.net.ua> In-Reply-To: <20040427211639.GA1455@laptop.6bone.nl> References: <20040427160901.GA2552@laptop.6bone.nl> <20040427190543.GA75827@ip.net.ua> <20040427211639.GA1455@laptop.6bone.nl>
next in thread | previous in thread | raw e-mail | index | archive | help
[-- Attachment #1 --] On Tue, Apr 27, 2004 at 11:16:39PM +0200, Mark Santcroos wrote: > Hi, > > On Tue, Apr 27, 2004 at 10:05:43PM +0300, Ruslan Ermilov wrote: > > Have the raw IP code set csum_flags |= CSUM_UDP (and set csum_data > > correctly) in m->m_pkthdr, if ip_p == IPPROTO_UDP && uh_csum == 0. > > Do the same thing for IPPROTO_TCP. > > Like I said, I'm willing to tackle this in the kernel, but for now I also > need a userland-only solution. > OK. > I guess I can fetch the IP address from the first ethernet iface and use > that as the src address for the IP packet. > getifaddrs(3). > Then I have enough information to calculate the UDP checksum in userland, > don't I? > Yes, you do. Another possibility would be to emit UDP datagrams unchecksummed, by leaving the checksum field as zero. Cheers, -- Ruslan Ermilov ru@FreeBSD.org FreeBSD committer [-- Attachment #2 --] -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.2.4 (FreeBSD) iD8DBQFAj1fSUkv4P6juNwoRAog+AJoDFRw8mza7E0TbcxiRdVsosWUrywCfZcha hn1LOV/PxiEmQ6jT4Mthe2s= =IfO1 -----END PGP SIGNATURE-----
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?20040428070554.GB25064>
