Date: Thu, 2 Oct 2014 09:23:05 +0200 From: Michael Tuexen <Michael.Tuexen@lurchi.franken.de> To: Tom Pusateri <pusateri@bangj.com> Cc: FreeBSD Net <freebsd-net@freebsd.org> Subject: Re: UDP/IPv6 handling Message-ID: <09E7673E-F6FD-48FA-B264-E0D79F5C281C@lurchi.franken.de> In-Reply-To: <2DA609BE-5704-463A-99BB-E64CB71931B2@bangj.com> References: <B30E0A41-51B0-442C-9476-0D9E99C0D37C@lurchi.franken.de> <2DA609BE-5704-463A-99BB-E64CB71931B2@bangj.com>
next in thread | previous in thread | raw e-mail | index | archive | help
On 02 Oct 2014, at 01:34, Tom Pusateri <pusateri@bangj.com> wrote: > Lots of embedded devices (like Cisco IP Phones) send TFTP requests = with 0 checksums.=20 I guess this uses UDP/IPv4, where FreeBSD supports UDP with zero = checksum. For UDP/IPv6 this doesn't work. Right after the cited code, the checksum = is always checked... Best regards Michael >=20 > Tom >=20 >=20 >=20 >> On Oct 1, 2014, at 12:58 PM, Michael Tuexen = <Michael.Tuexen@lurchi.franken.de> wrote: >>=20 >> Dear all, >>=20 >> in udp6_input() we have the following code: >>=20 >> if (nxt =3D=3D IPPROTO_UDP && plen !=3D ulen) { >> UDPSTAT_INC(udps_badlen); >> goto badunlocked; >> }=20 >> /* >> * Checksum extended UDP header and data. >> */ >> if (uh->uh_sum =3D=3D 0) { >> if (ulen > plen || ulen < sizeof(struct udphdr)) { >> UDPSTAT_INC(udps_nosum); >> goto badunlocked; >> } >> } >>=20 >> I'm trying to understand the UDP code path... >>=20 >> So (ulen > plen) can't be true. I'm wondering why do we only check = the ulen is not too >> short only in the case when the UDP checksum is zero. A zero checksum = should also never happen. >>=20 >> I think we should check for ulen < sizeof(struct udphdr) in any case. >>=20 >> Opinions? >>=20 >> Best regards >> Michael >> _______________________________________________ >> freebsd-net@freebsd.org mailing list >> http://lists.freebsd.org/mailman/listinfo/freebsd-net >> To unsubscribe, send any mail to = "freebsd-net-unsubscribe@freebsd.org" >=20
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?09E7673E-F6FD-48FA-B264-E0D79F5C281C>