From owner-freebsd-net@FreeBSD.ORG Sat Sep 18 21:00:12 2010 Return-Path: Delivered-To: freebsd-net@hub.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C5F041065672 for ; Sat, 18 Sep 2010 21:00:12 +0000 (UTC) (envelope-from gnats@FreeBSD.org) Received: from freefall.freebsd.org (freefall.freebsd.org [IPv6:2001:4f8:fff6::28]) by mx1.freebsd.org (Postfix) with ESMTP id 9384A8FC0A for ; Sat, 18 Sep 2010 21:00:12 +0000 (UTC) Received: from freefall.freebsd.org (localhost [127.0.0.1]) by freefall.freebsd.org (8.14.4/8.14.4) with ESMTP id o8IL0CJC077786 for ; Sat, 18 Sep 2010 21:00:12 GMT (envelope-from gnats@freefall.freebsd.org) Received: (from gnats@localhost) by freefall.freebsd.org (8.14.4/8.14.4/Submit) id o8IL0CKw077755; Sat, 18 Sep 2010 21:00:12 GMT (envelope-from gnats) Date: Sat, 18 Sep 2010 21:00:12 GMT Message-Id: <201009182100.o8IL0CKw077755@freefall.freebsd.org> To: freebsd-net@FreeBSD.org From: jhell Cc: Subject: Re: kern/146534: [icmp6] wrong source address in echo reply X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list Reply-To: jhell List-Id: Networking and TCP/IP with FreeBSD List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 18 Sep 2010 21:00:12 -0000 The following reply was made to PR kern/146534; it has been noted by GNATS. From: jhell To: bug-followup@FreeBSD.org Cc: Subject: Re: kern/146534: [icmp6] wrong source address in echo reply Date: Sat, 18 Sep 2010 16:52:21 -0400 This is a multi-part message in MIME format. --------------090403020508080503040902 Content-Type: text/plain; charset=ISO-8859-1 Content-Transfer-Encoding: 7bit -----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 This PR seems to have been left behind. While it has been, I have tested this patch for quite some time now with no downsides noted. While this in fact fixes the noted problem, attached is a patch that cleans this patch up a bit. With this patch applied is correct behavior. - -- jhell,v -----BEGIN PGP SIGNATURE----- iQEcBAEBAgAGBQJMlSaFAAoJEJBXh4mJ2FR+Z4MH/0zUHH/fUIfmKlg96T60A6xW RN/RXql2Rz/FYHzkontth2vBbSfmchNQtpgytXKG7R2qklyInwVVcLKNsJaXVfWz y8tpETUZLxNuYk5zhvsSS5q4JRQO3rbz1UMg9+b2VubnJ0y9OHahd/wztDCgmSDn f6mQU2YJtuglgixp25BJMbE/Dqh5MA1QEh1vj1lFWD5323hW2GOFFC4Mo3hgoCFA QqBzW9GMFoyA749d24GZvvDYa11esuU8+uiNLb5oPuBEoULdIw913NLMrZSuB2Uv PeDCbCUGzIa9xnCZmk6sG9HfDiZaRDPlf3q6sUuVCNCCBYikuoD4SIr/qN4ToTs= =knfM -----END PGP SIGNATURE----- --------------090403020508080503040902 Content-Type: text/plain; name="sys_netinet6_icmp6.c.patch" Content-Transfer-Encoding: 7bit Content-Disposition: attachment; filename="sys_netinet6_icmp6.c.patch" --- sys/netinet6/icmp6.c (revision 210616) +++ sys/netinet6/icmp6.c (working copy) @@ -2162,8 +2162,21 @@ } if ((srcp != NULL) && - (in6_addrscope(srcp) != in6_addrscope(&ip6->ip6_src))) - srcp = NULL; + (in6_addrscope(srcp) != in6_addrscope(&ip6->ip6_src))) { + struct sockaddr_in6 sin6; + + bzero(&sin6, sizeof(sin6)); + sin6.sin6_family = AF_INET6; + sin6.sin6_len = sizeof(sin6); + sin6.sin6_addr = origdst; + + ia = (struct in6_ifaddr *) + ifa_ifwithaddr((struct sockaddr *)&sin6); + + if (ia && (ia->ia6_flags & IN6_IFF_ANYCAST)) + srcp = NULL; + } + if (srcp == NULL) { int e; --------------090403020508080503040902 Content-Type: application/octet-stream; name="sys_netinet6_icmp6.c.patch.sig" Content-Transfer-Encoding: base64 Content-Disposition: attachment; filename="sys_netinet6_icmp6.c.patch.sig" iQEcBAABAgAGBQJMlSaFAAoJEJBXh4mJ2FR+Qu8H/23Ge4zNAGRRdGKgcEtp4KD0eiLZ9ozq 8GAbnBDXnH6lV/mj1d/DrFOEmcs0ApXHtjlnvox47yHaNlEJ7ESA5V1wf44rsfxN2ZZYdTFE 5qVNsElCAZ0yAjPnBCTbeFDZKx0vq4DJz4JuHoDgb8rrQMaPUClljk/kRFB1BL6jPkau/Fsy f/aZlmEERrxGkMTmBtVbv8E5WTpNZ0X9hf7u+5UG0coQtFM6hnqHC07UNrm7+cqsKtlbbvBP k5JoUsUSjV1mUwfzy8GJD7wm9wFGotHAgEDbbax5fmNZI3gChBjK01nQWkC8k6dFR6lzO7sb hgoDbbEEnpgSBz5wS0p3Vl4= --------------090403020508080503040902--