From owner-freebsd-net@FreeBSD.ORG Thu Oct 2 07:23:10 2014 Return-Path: Delivered-To: freebsd-net@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by hub.freebsd.org (Postfix) with ESMTPS id 383C6C68 for ; Thu, 2 Oct 2014 07:23:10 +0000 (UTC) Received: from mail-n.franken.de (drew.ipv6.franken.de [IPv6:2001:638:a02:a001:20e:cff:fe4a:feaa]) (using TLSv1 with cipher DHE-RSA-AES256-SHA (256/256 bits)) (Client CN "mail-n.franken.de", Issuer "Thawte DV SSL CA" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id EF10C2E1 for ; Thu, 2 Oct 2014 07:23:09 +0000 (UTC) Received: from [10.225.7.42] (unknown [194.95.73.101]) (Authenticated sender: macmic) by mail-n.franken.de (Postfix) with ESMTP id BD3B21C10467C; Thu, 2 Oct 2014 09:23:05 +0200 (CEST) Content-Type: text/plain; charset=us-ascii Mime-Version: 1.0 (Mac OS X Mail 7.3 \(1878.6\)) Subject: Re: UDP/IPv6 handling From: Michael Tuexen In-Reply-To: <2DA609BE-5704-463A-99BB-E64CB71931B2@bangj.com> Date: Thu, 2 Oct 2014 09:23:05 +0200 Content-Transfer-Encoding: quoted-printable Message-Id: <09E7673E-F6FD-48FA-B264-E0D79F5C281C@lurchi.franken.de> References: <2DA609BE-5704-463A-99BB-E64CB71931B2@bangj.com> To: Tom Pusateri X-Mailer: Apple Mail (2.1878.6) Cc: FreeBSD Net X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.18-1 Precedence: list List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Oct 2014 07:23:10 -0000 On 02 Oct 2014, at 01:34, Tom Pusateri 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 = 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