Subject: Re: UDP checksum trouble in -current
To: YAMAMOTO Takashi <yamt@mwd.biglobe.ne.jp>
From: john heasley <heas@shrubbery.net>
List: tech-net
Date: 01/21/2005 09:27:29
Fri, Jan 21, 2005 at 10:49:20AM +0900, YAMAMOTO Takashi:
> hi,
>
> > > > i think you also need zero ui->ui_sum in the else {}, otherwise you could
> > > > just have garbage.
> > >
> > > for what?
> > > in that case, the ui_sum should never used by anyone, afaik.
> >
> > you still want it to "hit the wire" as zero don't you,
>
> no.
>
> > otherwise the receive
> > side (including things like tcpdump) thinks you're doing checksums.
>
> can you explain why it's a problem?
> "receive side" should be ourselves. it should know about checksum omission.
If the receiver is the kernel it is not a problem, but if the receiver is
a BPF or raw socket it can be. Either of those may attempt to check the
UDP ckecksum (tcpdump does, for example). A value of zero is a clear
indication not to check it for UDP. It seems like little pain to be
"correct".
I do not know what could be done for IP or TCP checksums. But, if I'm not
mistaken, zero is not a valid value for either and might be a good indicator
that no checksumming was performed.