Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 8 Jan 2011 13:21:59 -0500 (EST)
From:      Daniel Eischen <deischen@freebsd.org>
To:        "Bjoern A. Zeeb" <bzeeb-lists@lists.zabbadoz.net>
Cc:        rrs@freebsd.org, freebsd-current@freebsd.org
Subject:   Re: UDP checksum broken, -head and releng_8
Message-ID:  <Pine.GSO.4.64.1101081320380.27326@sea.ntplx.net>
In-Reply-To: <Pine.GSO.4.64.1101070640050.20933@sea.ntplx.net>
References:  <Pine.GSO.4.64.1101070412140.19838@sea.ntplx.net> <20110107103837.E14966@maildrop.int.zabbadoz.net> <Pine.GSO.4.64.1101070613200.20933@sea.ntplx.net> <Pine.GSO.4.64.1101070640050.20933@sea.ntplx.net>

index | next in thread | previous in thread | raw e-mail

[-- Attachment #1 --]
On Fri, 7 Jan 2011, Daniel Eischen wrote:

> On Fri, 7 Jan 2011, Daniel Eischen wrote:
>
>> On Fri, 7 Jan 2011, Bjoern A. Zeeb wrote:
>> 
>>> On Fri, 7 Jan 2011, Daniel Eischen wrote:
>>> 
>>>> When sending multicast packets to a socket that is _not_
>>>> bound to the multicast address, this generates bad UDP
>>>> checksums.  This use to work and was broke sometime between
>>>> the middle of October and late December as far as I can
>>>> tell.
>>> 
>>> My very best guess would be: r215110
>> 
>> It doesn't look very harmful, but I'll try backing it out.
>
> Backing this out seems to fix it.  I'll have to test it
> more after I get some sleep ;-)

I've attached what may be a proper patch.  Please review.
I'd like to get this fixed in releng_8 too.

-- 
DE
[-- Attachment #2 --]
Index: netinet/in_pcb.c
===================================================================
--- netinet/in_pcb.c	(revision 216690)
+++ netinet/in_pcb.c	(working copy)
@@ -874,6 +874,7 @@
 		}
 	}
 	if (laddr.s_addr == INADDR_ANY) {
+		error = in_pcbladdr(inp, &faddr, &laddr, cred);
 		/*
 		 * If the destination address is multicast and an outgoing
 		 * interface has been set as a multicast option, use the
@@ -893,16 +894,17 @@
 						break;
 				if (ia == NULL) {
 					IN_IFADDR_RUNLOCK();
-					return (EADDRNOTAVAIL);
+					error = EADDRNOTAVAIL;
+				} else {
+					laddr = ia->ia_addr.sin_addr;
+					IN_IFADDR_RUNLOCK();
+					/* Override error from in_pcbladdr(). */
+					error = 0;
 				}
-				laddr = ia->ia_addr.sin_addr;
-				IN_IFADDR_RUNLOCK();
 			}
-		} else {
-			error = in_pcbladdr(inp, &faddr, &laddr, cred);
-			if (error) 
-				return (error);
 		}
+		if (error)
+			return (error);
 	}
 	oinp = in_pcblookup_hash(inp->inp_pcbinfo, faddr, fport, laddr, lport,
 	    0, NULL);
help

Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?Pine.GSO.4.64.1101081320380.27326>