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 Fixup for r261590 (vnet sysctl handlers cleanup). 2014-02-09 08:13:17 +00:00
khelp
libalias It'll be okay to use LibAliasDetachHandlers() here, relying 2013-12-25 09:43:51 +00:00
accf_data.c
accf_dns.c
accf_http.c
cc.h
icmp6.h
icmp_var.h Remove more constants related to static sysctl nodes. The MAXID constants 2014-02-25 18:44:33 +00:00
if_atm.c
if_atm.h
if_ether.c Correct ARP update handling when the routes for network interfaces are 2014-03-26 22:46:03 +00:00
if_ether.h
igmp_var.h Remove more constants related to static sysctl nodes. The MAXID constants 2014-02-25 18:44:33 +00:00
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 Fix various places where we don't properly release a lock 2014-01-16 22:14:54 +00:00
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 Several years after initial development, merge prototype support for 2014-03-15 00:57:50 +00:00
in_proto.c Add support for UDP-Lite protocol (RFC 3828) to IPv4 and IPv6 stacks. 2014-04-07 01:53:03 +00:00
in_rmx.c - Remove rt_metrics_lite and simply put its members into rtentry. 2014-03-05 01:17:47 +00:00
in_rss.c Several years after initial development, merge prototype support for 2014-03-15 00:57:50 +00:00
in_rss.h Several years after initial development, merge prototype support for 2014-03-15 00:57:50 +00:00
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 Add support for UDP-Lite protocol (RFC 3828) to IPv4 and IPv6 stacks. 2014-04-07 01:53:03 +00:00
ip6.h
ip_carp.c Improve logging of send errors, reporting error code and interface. 2014-02-22 19:20:40 +00:00
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 - Remove rt_metrics_lite and simply put its members into rtentry. 2014-03-05 01:17:47 +00:00
ip_fw.h
ip_gre.c Remove AppleTalk support. 2014-03-14 06:29:43 +00:00
ip_gre.h
ip_icmp.c Don't copy the MF flag from original IP header to ICMP error message. 2014-03-31 13:00:49 +00:00
ip_icmp.h
ip_id.c
ip_input.c Since both netinet/ and netinet6/ call into netipsec/ and netpfil/, 2014-03-12 14:29:08 +00:00
ip_ipsec.c - Remove rt_metrics_lite and simply put its members into rtentry. 2014-03-05 01:17:47 +00:00
ip_ipsec.h
ip_mroute.c Fix fallout from r241923. Calculate length of payload in 2014-01-22 10:57:42 +00:00
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 Since both netinet/ and netinet6/ call into netipsec/ and netpfil/, 2014-03-12 14:29:08 +00:00
ip.h
pim_var.h Remove more constants related to static sysctl nodes. The MAXID constants 2014-02-25 18:44:33 +00:00
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 Use SCTP_OVER_UDP_TUNNELING_PORT more consistently. 2014-03-29 20:21:36 +00:00
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 * Provide information in error causes in ASCII instead of 2014-03-16 12:32:16 +00:00
sctp_input.h
sctp_lock_bsd.h
sctp_os_bsd.h - Remove rt_metrics_lite and simply put its members into rtentry. 2014-03-05 01:17:47 +00:00
sctp_os.h
sctp_output.c Increment the SSN only after processing the last fragment of an 2014-04-01 18:38:04 +00:00
sctp_output.h
sctp_pcb.c Handle an edge case of address management similar to TCP. 2014-03-29 21:26:45 +00:00
sctp_pcb.h
sctp_peeloff.c
sctp_peeloff.h
sctp_ss_functions.c
sctp_structs.h
sctp_sysctl.c * Provide information in error causes in ASCII instead of 2014-03-16 12:32:16 +00:00
sctp_sysctl.h Use SCTP_OVER_UDP_TUNNELING_PORT more consistently. 2014-03-29 20:21:36 +00:00
sctp_timer.c * Provide information in error causes in ASCII instead of 2014-03-16 12:32:16 +00:00
sctp_timer.h
sctp_uio.h
sctp_usrreq.c * Provide information in error causes in ASCII instead of 2014-03-16 12:32:16 +00:00
sctp_var.h
sctp.h Send the correct error cause, when a DATA chunk with no user data 2014-04-19 19:21:06 +00:00
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 Send the correct error cause, when a DATA chunk with no user data 2014-04-19 19:21:06 +00:00
siftr.c
tcp_debug.c
tcp_debug.h
tcp_fsm.h
tcp_hostcache.c
tcp_hostcache.h
tcp_input.c Improve readability of comments for DELAY_ACK() macro. 2014-04-03 01:46:03 +00:00
tcp_lro.c
tcp_lro.h
tcp_offload.c
tcp_offload.h
tcp_output.c - Remove rt_metrics_lite and simply put its members into rtentry. 2014-03-05 01:17:47 +00:00
tcp_reass.c Utilize SYSCTL_UMA_CUR() to export usage of syncache and 2014-02-07 14:31:51 +00:00
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 Utilize SYSCTL_UMA_CUR() to export usage of syncache and 2014-02-07 14:31:51 +00:00
tcp_syncache.h
tcp_timer.c Currently, the TCP slow timer can starve TCP input processing while it 2014-04-10 18:15:35 +00:00
tcp_timer.h Currently, the TCP slow timer can starve TCP input processing while it 2014-04-10 18:15:35 +00:00
tcp_timewait.c Some whitespace and style fixes. 2014-04-11 21:00:59 +00:00
tcp_usrreq.c Decrease lock contention within the TCP accept case by removing 2014-01-28 20:28:32 +00:00
tcp_var.h Currently, the TCP slow timer can starve TCP input processing while it 2014-04-10 18:15:35 +00:00
tcp.h
tcpip.h
toecore.c
toecore.h
toeplitz.c Several years after initial development, merge prototype support for 2014-03-15 00:57:50 +00:00
toeplitz.h Several years after initial development, merge prototype support for 2014-03-15 00:57:50 +00:00
udp_usrreq.c Remove a bogus re-assignment. 2014-04-08 01:54:50 +00:00
udp_var.h Minor style cleanups. 2014-04-07 01:55:53 +00:00
udp.h
udplite.h Add support for UDP-Lite protocol (RFC 3828) to IPv4 and IPv6 stacks. 2014-04-07 01:53:03 +00:00