freebsd-dev/sys/netinet6
Alan Somers 0cfee0c223 Fix subnet and default routes on different FIBs on the same subnet.
These two bugs are closely related.  The root cause is that ifa_ifwithnet
does not consider FIBs when searching for an interface address.

sys/net/if_var.h
sys/net/if.c
	Add a fib argument to ifa_ifwithnet and ifa_ifwithdstadddr.  Those
	functions will only return an address whose interface fib equals the
	argument.

sys/net/route.c
	Update calls to ifa_ifwithnet and ifa_ifwithdstaddr with fib
	arguments.

sys/netinet/in.c
	Update in_addprefix to consider the interface fib when adding
	prefixes.  This will prevent it from not adding a subnet route when
	one already exists on a different fib.

sys/net/rtsock.c
sys/netinet/in_pcb.c
sys/netinet/ip_output.c
sys/netinet/ip_options.c
sys/netinet6/nd6.c
	Add RT_DEFAULT_FIB arguments to ifa_ifwithdstaddr and ifa_ifwithnet.
	In some cases it there wasn't a clear specific fib number to use.
	In others, I was unable to test those functions so I chose
	RT_DEFAULT_FIB to minimize divergence from current behavior.  I will
	fix some of the latter changes along with PR kern/187553.

tests/sys/netinet/fibs_test.sh
tests/sys/netinet/udp_dontroute.c
tests/sys/netinet/Makefile
	Revert r263738.  The udp_dontroute test was right all along.
	However, bugs kern/187550 and kern/187553 cancelled each other out
	when it came to this test.  Because of kern/187553, ifa_ifwithnet
	searched the default fib instead of the requested one, but because
	of kern/187550, there was an applicable subnet route on the default
	fib.  The new test added in r263738 doesn't work right, however.  I
	can verify with dtrace that ifa_ifwithnet returned the wrong address
	before I applied this commit, but route(8) miraculously found the
	correct interface to use anyway.  I don't know how.

	Clear expected failure messages for kern/187550 and kern/187552.

PR:		kern/187550
PR:		kern/187552
Reviewed by:	melifaro
MFC after:	3 weeks
Sponsored by:	Spectra Logic
2014-04-24 23:56:56 +00:00
..
dest6.c The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare 2013-10-26 17:58:36 +00:00
frag6.c The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare 2013-10-26 17:58:36 +00:00
icmp6.c The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare 2013-10-26 17:58:36 +00:00
icmp6.h
in6_cksum.c MFp4 bz_ipv6_fast: 2012-05-24 18:25:09 +00:00
in6_gif.c The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare 2013-10-26 17:58:36 +00:00
in6_gif.h Remove __P. 2012-10-22 21:49:56 +00:00
in6_ifattach.c Add support for UDP-Lite protocol (RFC 3828) to IPv4 and IPv6 stacks. 2014-04-07 01:53:03 +00:00
in6_ifattach.h Use FF02:0:0:0:0:2:FF00::/104 prefix for IPv6 Node Information Group 2013-05-04 19:16:26 +00:00
in6_mcast.c Properly release the in6_multi lock. 2014-04-12 02:05:31 +00:00
in6_pcb.c Several years after initial development, merge prototype support for 2014-03-15 00:57:50 +00:00
in6_pcb.h Remove __P. 2012-10-22 21:49:56 +00:00
in6_pcbgroup.c Several years after initial development, merge prototype support for 2014-03-15 00:57:50 +00:00
in6_proto.c Minor style cleanups. 2014-04-07 01:55:53 +00:00
in6_rmx.c - Remove rt_metrics_lite and simply put its members into rtentry. 2014-03-05 01:17:47 +00:00
in6_src.c Introduce IN6_MASK_ADDR() macro to unify various hand-rolled code 2014-01-08 22:13:32 +00:00
in6_var.h Further rework netinet6 address handling code: 2014-01-19 16:07:27 +00:00
in6.c Further rework netinet6 address handling code: 2014-01-19 16:07:27 +00:00
in6.h Since both netinet/ and netinet6/ call into netipsec/ and netpfil/, 2014-03-12 14:29:08 +00:00
ip6_ecn.h
ip6_forward.c Remove unused label. 2014-03-31 14:40:35 +00:00
ip6_id.c Provide includes that are needed in these files, and before were read 2013-10-26 18:18:50 +00:00
ip6_input.c Remove unused variable. 2014-04-17 06:40:11 +00:00
ip6_ipsec.c - Remove rt_metrics_lite and simply put its members into rtentry. 2014-03-05 01:17:47 +00:00
ip6_ipsec.h
ip6_mroute.c Only count table lookups when we're actually processing packets. 2014-02-10 14:47:51 +00:00
ip6_mroute.h revert part of r260485 which changes how part of the header gets 2014-01-09 22:41:18 +00:00
ip6_output.c - Remove rt_metrics_lite and simply put its members into rtentry. 2014-03-05 01:17:47 +00:00
ip6_var.h Since both netinet/ and netinet6/ call into netipsec/ and netpfil/, 2014-03-12 14:29:08 +00:00
ip6.h
ip6protosw.h Remove __P. 2012-10-22 21:49:56 +00:00
mld6_var.h
mld6.c Mechanically replace direct accessing to if_xname to using if_name() macro. 2014-01-10 12:33:28 +00:00
mld6.h
nd6_nbr.c lla_lookup() does modification only when LLE_CREATE is specified. 2014-01-02 08:40:37 +00:00
nd6_rtr.c Use in6_localip() instead of hand-rolled cycle. 2014-01-18 20:54:55 +00:00
nd6.c Fix subnet and default routes on different FIBs on the same subnet. 2014-04-24 23:56:56 +00:00
nd6.h Further rework netinet6 address handling code: 2014-01-19 16:07:27 +00:00
pim6_var.h Remove more constants related to static sysctl nodes. The MAXID constants 2014-02-25 18:44:33 +00:00
pim6.h
raw_ip6.c The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare 2013-10-26 17:58:36 +00:00
raw_ip6.h Migrate structs ip6stat, icmp6stat and rip6stat to PCPU counters. 2013-07-09 09:54:54 +00:00
route6.c The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare 2013-10-26 17:58:36 +00:00
scope6_var.h - Move definition of V_deembed_scopeid to scope6_var.h. 2012-12-05 19:45:24 +00:00
scope6.c The r48589 promised to remove implicit inclusion of if_var.h soon. Prepare 2013-10-26 17:58:36 +00:00
sctp6_usrreq.c Changes from upstream to improve compilation when INET or INET6 2013-11-02 20:12:19 +00:00
sctp6_var.h Add support for SCTP/UDP/IPV6. 2012-11-17 20:04:04 +00:00
send.c Free mbuf in case of error. 2013-12-17 10:53:17 +00:00
send.h Use uint8_t for sockaddr sa_len. 2011-06-05 11:40:30 +00:00
tcp6_var.h Remove __P. 2012-10-22 21:49:56 +00:00
udp6_usrreq.c Add support for UDP-Lite protocol (RFC 3828) to IPv4 and IPv6 stacks. 2014-04-07 01:53:03 +00:00
udp6_var.h Add support for UDP-Lite protocol (RFC 3828) to IPv4 and IPv6 stacks. 2014-04-07 01:53:03 +00:00