freebsd-nq/sys/netinet
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
..
cc
khelp
libalias
accf_data.c
accf_dns.c
accf_http.c
cc.h
icmp6.h
icmp_var.h
if_atm.c
if_atm.h
if_ether.c
if_ether.h
igmp_var.h
igmp.c
igmp.h
in_cksum.c
in_debug.c
in_gif.c
in_gif.h
in_kdtrace.c
in_kdtrace.h
in_mcast.c
in_pcb.c Fix subnet and default routes on different FIBs on the same subnet. 2014-04-24 23:56:56 +00:00
in_pcb.h Fix jailed raw sockets not setting the correct source address by 2014-04-24 12:52:31 +00:00
in_pcbgroup.c
in_proto.c
in_rmx.c
in_rss.c
in_rss.h
in_systm.h
in_var.h
in.c Fix subnet and default routes on different FIBs on the same subnet. 2014-04-24 23:56:56 +00:00
in.h
ip6.h
ip_carp.c
ip_carp.h
ip_divert.c
ip_divert.h
ip_dummynet.h
ip_ecn.c
ip_ecn.h
ip_encap.c
ip_encap.h
ip_fastfwd.c
ip_fw.h
ip_gre.c
ip_gre.h
ip_icmp.c
ip_icmp.h
ip_id.c
ip_input.c
ip_ipsec.c
ip_ipsec.h
ip_mroute.c
ip_mroute.h
ip_options.c Fix subnet and default routes on different FIBs on the same subnet. 2014-04-24 23:56:56 +00:00
ip_options.h
ip_output.c Fix subnet and default routes on different FIBs on the same subnet. 2014-04-24 23:56:56 +00:00
ip_var.h
ip.h
pim_var.h
pim.h
raw_ip.c Fix jailed raw sockets not setting the correct source address by 2014-04-24 12:52:31 +00:00
sctp_asconf.c
sctp_asconf.h
sctp_auth.c
sctp_auth.h
sctp_bsd_addr.c
sctp_bsd_addr.h
sctp_cc_functions.c
sctp_constants.h
sctp_crc32.c
sctp_crc32.h
sctp_dtrace_declare.h
sctp_dtrace_define.h
sctp_header.h
sctp_indata.c Don't free an mbuf twice. This only happens in very rare error 2014-04-23 21:20:55 +00:00
sctp_indata.h
sctp_input.c
sctp_input.h
sctp_lock_bsd.h
sctp_os_bsd.h
sctp_os.h
sctp_output.c
sctp_output.h
sctp_pcb.c
sctp_pcb.h
sctp_peeloff.c
sctp_peeloff.h
sctp_ss_functions.c
sctp_structs.h
sctp_sysctl.c
sctp_sysctl.h
sctp_timer.c
sctp_timer.h
sctp_uio.h
sctp_usrreq.c
sctp_var.h
sctp.h
sctputil.c Send also a packet containing an ABORT chunk in response to an OOTB packet 2014-04-20 18:15:23 +00:00
sctputil.h
siftr.c
tcp_debug.c
tcp_debug.h
tcp_fsm.h
tcp_hostcache.c
tcp_hostcache.h
tcp_input.c
tcp_lro.c
tcp_lro.h
tcp_offload.c
tcp_offload.h
tcp_output.c
tcp_reass.c
tcp_sack.c
tcp_seq.h
tcp_subr.c Add {} braces so that the code conforms to the indentation. 2014-04-21 19:17:19 +00:00
tcp_syncache.c
tcp_syncache.h
tcp_timer.c
tcp_timer.h
tcp_timewait.c
tcp_usrreq.c
tcp_var.h
tcp.h
tcpip.h
toecore.c
toecore.h
toeplitz.c
toeplitz.h
udp_usrreq.c
udp_var.h
udp.h
udplite.h