From owner-freebsd-net@freebsd.org Thu Dec 22 02:53:02 2016 Return-Path: Delivered-To: freebsd-net@mailman.ysv.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:1900:2254:206a::19:1]) by mailman.ysv.freebsd.org (Postfix) with ESMTP id AFBE7C8BEB6 for ; Thu, 22 Dec 2016 02:53:02 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from kenobi.freebsd.org (kenobi.freebsd.org [IPv6:2001:1900:2254:206a::16:76]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mx1.freebsd.org (Postfix) with ESMTPS id 95F97195 for ; Thu, 22 Dec 2016 02:53:02 +0000 (UTC) (envelope-from bugzilla-noreply@freebsd.org) Received: from bugs.freebsd.org ([127.0.1.118]) by kenobi.freebsd.org (8.15.2/8.15.2) with ESMTP id uBM2r1b3039107 for ; Thu, 22 Dec 2016 02:53:02 GMT (envelope-from bugzilla-noreply@freebsd.org) From: bugzilla-noreply@freebsd.org To: freebsd-net@FreeBSD.org Subject: [Bug 196361] Constrain IPv6 routes to each FIB (Consistent with IPv4 route behaviour) Date: Thu, 22 Dec 2016 02:53:01 +0000 X-Bugzilla-Reason: AssignedTo X-Bugzilla-Type: changed X-Bugzilla-Watch-Reason: None X-Bugzilla-Product: Base System X-Bugzilla-Component: kern X-Bugzilla-Version: 10.1-RELEASE X-Bugzilla-Keywords: needs-patch, needs-qa X-Bugzilla-Severity: Affects Only Me X-Bugzilla-Who: jhujhiti@adjectivism.org X-Bugzilla-Status: New X-Bugzilla-Resolution: X-Bugzilla-Priority: --- X-Bugzilla-Assigned-To: freebsd-net@FreeBSD.org X-Bugzilla-Flags: X-Bugzilla-Changed-Fields: attachments.created Message-ID: In-Reply-To: References: Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Bugzilla-URL: https://bugs.freebsd.org/bugzilla/ Auto-Submitted: auto-generated MIME-Version: 1.0 X-BeenThere: freebsd-net@freebsd.org X-Mailman-Version: 2.1.23 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, 22 Dec 2016 02:53:02 -0000 https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D196361 --- Comment #9 from jhujhiti@adjectivism.org --- Created attachment 178192 --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D178192&action= =3Dedit Respect net.add_addr_allfibs=3D0 for inet6 (revision 1) I didn't forget about this! I implemented against 10.3 about a year ago and finally found the time to port it to HEAD. This patch essentially makes IPv6 respect net.add_addr_allfibs the same way IPv4 does. This is my first patch against base - any feedback is welcome. The changes here are mostly straightforward: where we have an ifp, we can u= se its FIB, and where we've previously assumed the default FIB, we should cons= ider that local routes can exist outside of it now. A couple changes are more noteworthy: * Default router selection (defrouter_ functions) can select multiple route= rs, up to one per FIB. defrouter_select() now takes a FIB argument to simplify = the logic inside the function. It is up to the caller to determine if we should re-select routers for all FIBs, by making multiple calls, or not. * In icmp6_reflect(), there may be an edge case where source address select= ion fails to use the correct FIB if in6ifa_ifwithaddr() returns NULL. I don't f= ully understand the situations in which this can happen (or if it's possible at all). * rtinit() didn't use the interface's FIB for both AF_INET as well as AF_IN= ET6 and I don't understand why. For all uses of the function in AF_INET context, using the interface FIB seems correct to me, but previous in_addprefix() and rip_ctlinput() seem a little strange. Here's what this looks like when net.add_addr_allfibs is 0. em0 and epair0b here are bridged together and there is a router advertising fd00::/64. em0: flags=3D8943 metric 0 = mtu 1500 options=3D42098 ether e0:cb:4e:00:5c:99 inet6 fe80::e2cb:4eff:fe00:5c99%em0 prefixlen 64 scopeid 0x1=20 inet6 fd00::e2cb:4eff:fe00:5c99 prefixlen 64 autoconf=20 nd6 options=3D23 media: Ethernet autoselect (1000baseT ) status: active epair0b: flags=3D8843 metric 0 mtu = 1500 options=3D8 ether 04:ef:30:02:88:af inet6 fe80::6ef:30ff:fe02:88af%epair0b prefixlen 64 scopeid 0x6=20 inet6 fd00::6ef:30ff:fe02:88af prefixlen 64 autoconf=20 nd6 options=3D23 media: Ethernet 10Gbase-T (10Gbase-T ) status: active fib: 1 groups: epair=20 % ndp -na Neighbor Linklayer Address Netif Expire S F= lags fe80::ff:30ff:fe02:80d%epair0b 02:ff:30:02:08:0d epair0b 23h45m16s S R fd00::6ef:30ff:fe02:88af 04:ef:30:02:88:af epair0b permanent R= =20 fe80::6ef:30ff:fe02:88af%epair0b 04:ef:30:02:88:af epair0b permanent R= =20 fe80::ff:30ff:fe02:80d%em0 02:ff:30:02:08:0d em0 23h43m46s S R fd00::e2cb:4eff:fe00:5c99 e0:cb:4e:00:5c:99 em0 permanent R=20 fe80::e2cb:4eff:fe00:5c99%em0 e0:cb:4e:00:5c:99 em0 permanent R % ndp -np=20 fd00::/64 if=3Depair0b flags=3DLAO vltime=3D600, pltime=3D300, expire=3D8m8s, ref=3D1 advertised by fe80::ff:30ff:fe02:80d%epair0b (reachable) fe80::%epair0b/64 if=3Depair0b flags=3DLAO vltime=3Dinfinity, pltime=3Dinfinity, expire=3DNever, ref=3D0 No advertising router fd00::/64 if=3Dem0 flags=3DLAO vltime=3D600, pltime=3D300, expire=3D8m8s, ref=3D1 advertised by fe80::ff:30ff:fe02:80d%em0 (reachable) fe80::%em0/64 if=3Dem0 flags=3DLAO vltime=3Dinfinity, pltime=3Dinfinity, expire=3DNever, ref=3D0 No advertising router fe80::%lo0/64 if=3Dlo0 flags=3DLAO vltime=3Dinfinity, pltime=3Dinfinity, expire=3DNever, ref=3D0 No advertising router % netstat -rnf inet6 -F0 Routing tables Internet6: Destination Gateway Flags N= etif Expire ::/96 ::1 UGRS = lo0 default fe80::ff:30ff:fe02:80d%em0 UG = em0 ::1 link#3 UH = lo0 ::ffff:0.0.0.0/96 ::1 UGRS = lo0 fd00::/64 link#1 U = em0 fd00::e2cb:4eff:fe00:5c99 link#1 UHS = lo0 fe80::/10 ::1 UGRS = lo0 fe80::%em0/64 link#1 U = em0 fe80::e2cb:4eff:fe00:5c99%em0 link#1 UHS = lo0 fe80::%lo0/64 link#3 U = lo0 fe80::1%lo0 link#3 UHS = lo0 ff02::/16 ::1 UGRS = lo0 % netstat -rnf inet6 -F1 Routing tables (fib: 1) Internet6: Destination Gateway Flags N= etif Expire ::/96 ::1 UGRS = lo0 default fe80::ff:30ff:fe02:80d%epair0b UG epa= ir0b ::1 lo0 UHS = lo0 ::ffff:0.0.0.0/96 ::1 UGRS = lo0 fd00::/64 link#6 U epa= ir0b fd00::6ef:30ff:fe02:88af link#6 UHS = lo0 fe80::/10 ::1 UGRS = lo0 fe80::%epair0b/64 link#6 U epa= ir0b fe80::6ef:30ff:fe02:88af%epair0b link#6 UHS = lo0 ff02::/16 ::1 UGRS = lo0 % ifmcstat -f inet6 em0: inet6 fe80::e2cb:4eff:fe00:5c99%em0 scopeid 0x1 mldv2 flags=3D2 rv 2 qi 125 qri 10 uri 3 group ff01::1%em0 scopeid 0x1 mode exclude mcast-macaddr 33:33:00:00:00:01 group ff02::2:c26b:b618%em0 scopeid 0x1 mode exclude mcast-macaddr 33:33:c2:6b:b6:18 group ff02::2:ffc2:6bb6%em0 scopeid 0x1 mode exclude mcast-macaddr 33:33:ff:c2:6b:b6 group ff02::1%em0 scopeid 0x1 mode exclude mcast-macaddr 33:33:00:00:00:01 group ff02::1:ff00:5c99%em0 scopeid 0x1 mode exclude mcast-macaddr 33:33:ff:00:5c:99 lo0: inet6 fe80::1%lo0 scopeid 0x3 mldv2 flags=3D2 rv 2 qi 125 qri 10 uri 3 group ff01::1%lo0 scopeid 0x3 mode exclude group ff02::2:c26b:b618%lo0 scopeid 0x3 mode exclude group ff02::2:ffc2:6bb6%lo0 scopeid 0x3 mode exclude group ff02::1%lo0 scopeid 0x3 mode exclude group ff02::1:ff00:1%lo0 scopeid 0x3 mode exclude epair0b: inet6 fe80::6ef:30ff:fe02:88af%epair0b scopeid 0x6 mldv2 flags=3D2 rv 2 qi 125 qri 10 uri 3 group ff01::1%epair0b scopeid 0x6 mode exclude mcast-macaddr 33:33:00:00:00:01 group ff02::2:c26b:b618%epair0b scopeid 0x6 mode exclude mcast-macaddr 33:33:c2:6b:b6:18 group ff02::2:ffc2:6bb6%epair0b scopeid 0x6 mode exclude mcast-macaddr 33:33:ff:c2:6b:b6 group ff02::1%epair0b scopeid 0x6 mode exclude mcast-macaddr 33:33:00:00:00:01 group ff02::1:ff02:88af%epair0b scopeid 0x6 mode exclude mcast-macaddr 33:33:ff:02:88:af --=20 You are receiving this mail because: You are the assignee for the bug.=