Re: udp checksum on raw sockets

2004-04-28 Thread Ruslan Ermilov
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 th

Re: udp checksum on raw sockets

2004-04-27 Thread Mark Santcroos
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,

Re: udp checksum on raw sockets

2004-04-27 Thread Ruslan Ermilov
On Tue, Apr 27, 2004 at 06:09:01PM +0200, Mark Santcroos wrote: > * I'm sending UDP packets on a raw socket. > > * iphdr->ip_src.s_addr = INADDR_ANY; > So I don't know the IP address that will be used as src address. > So as far as I can see, I have a problem generating the checksum in > use

Re: udp checksum on raw sockets

2004-04-27 Thread Charles Swiger
On Apr 27, 2004, at 12:09 PM, Mark Santcroos wrote: * I'm sending UDP packets on a raw socket. * iphdr->ip_src.s_addr = INADDR_ANY; So I don't know the IP address that will be used as src address. The kernel ought to pick the src address of the interface the packet will be sent from according t

udp checksum on raw sockets

2004-04-27 Thread Mark Santcroos
* I'm sending UDP packets on a raw socket. * iphdr->ip_src.s_addr = INADDR_ANY; So I don't know the IP address that will be used as src address. So as far as I can see, I have a problem generating the checksum in userspace. Suggestion: Would it make sense that if: sysctl net.udp.checksum=1