freebsd-skq/sys/netinet
asomers a8aa481895 MFC changes relating to running multiple interfaces on different fibs but
with addresses on the same subnet.

MFC r266860

Fix unintended KBI change from r264905.  Add _fib versions of
ifa_ifwithnet() and ifa_ifwithdstaddr()  The legacy functions will call the
_fib() versions with RT_ALL_FIBS, preserving legacy behavior.

sys/net/if_var.h
sys/net/if.c
        Add legacy-compatible functions as described above.  Ensure legacy
        behavior when RT_ALL_FIBS is passed as fibnum.

sys/netinet/in_pcb.c
sys/netinet/ip_output.c
sys/netinet/ip_options.c
sys/net/route.c
sys/net/rtsock.c
sys/netinet6/nd6.c
        Call with _fib() functions if we must use a specific fib, or the
        legacy functions otherwise.

tests/sys/netinet/fibs_test.sh
tests/sys/netinet/udp_dontroute.c
        Improve the udp_dontroute test.  The bug that this test exercises is
        that ifa_ifwithnet() will return the wrong address, if multiple
        interfaces have addresses on the same subnet but with different
        fibs.  The previous version of the test only considered one possible
        failure mode: that ifa_ifwithnet_fib() might fail to find any
        suitable address at all.  The new version also checks whether
        ifa_ifwithnet_fib() finds the correct address by checking where the
        ARP request goes.

MFC r264917

Style fixes, mostly trailing whitespace elimination.  No functional change.

MFC r264905

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.

MFC r263738

tests/sys/netinet/Makefile
tests/sys/netinet/fibs.sh
        Replace fibs:udp_dontroute with fibs:src_addr_selection_by_subnet.
        The original test was poorly written; it was actually testing
        kern/167947 instead of the desired kern/187553.  The root cause of the
        bug is that ifa_ifwithnet did not have a fib argument.  The new test
        more directly targets that behavior.

tests/sys/netinet/udp_dontroute.c
        Delete the auxilliary binary used by the old test
2014-06-06 20:35:40 +00:00
..
cc Merge r261590: Fixup for r261590 (vnet sysctl handlers cleanup) 2014-03-04 14:05:37 +00:00
khelp The TCP PAWS fix for kernels with fast tick rates (r231767) changed the TCP 2012-08-17 01:49:51 +00:00
libalias In m_megapullup() instead of reserving some space at the end of packet, 2013-03-17 07:37:10 +00:00
accf_data.c
accf_dns.c
accf_http.c Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs. 2011-11-07 15:43:11 +00:00
cc.h
icmp6.h Migrate structs in6_ifstat and icmp6_ifstat to PCPU counters. 2013-07-09 09:59:46 +00:00
icmp_var.h Remove most of the remaining sysctl name list macros. They were only 2013-08-26 18:16:05 +00:00
if_atm.c Add const qualifier to the dst parameter of the ifnet if_output method. 2013-04-26 12:50:32 +00:00
if_atm.h Add const qualifier to the dst parameter of the ifnet if_output method. 2013-04-26 12:50:32 +00:00
if_ether.c MFC r263779 2014-06-06 17:42:55 +00:00
if_ether.h Add const qualifier to the dst parameter of the ifnet if_output method. 2013-04-26 12:50:32 +00:00
igmp_var.h Remove most of the remaining sysctl name list macros. They were only 2013-08-26 18:16:05 +00:00
igmp.c Restructure the mbuf pkthdr to make it fit for upcoming capabilities and 2013-08-24 19:51:18 +00:00
igmp.h
in_cksum.c nobody uses this file except the userspace ipfw code, but the cast 2012-07-31 08:04:49 +00:00
in_debug.c Remove last remnants of classful addressing: 2011-10-15 16:28:06 +00:00
in_gif.c Mechanically substitute flags from historic mbuf allocator with 2012-12-05 08:04:20 +00:00
in_gif.h
in_kdtrace.c MFC r258622: dtrace sdt: remove the ugly sname parameter of SDT_PROBE_DEFINE 2014-01-17 10:58:59 +00:00
in_kdtrace.h MFC r258622: dtrace sdt: remove the ugly sname parameter of SDT_PROBE_DEFINE 2014-01-17 10:58:59 +00:00
in_mcast.c MFC 260796 2014-02-03 03:31:35 +00:00
in_pcb.c MFC r264879 2014-05-26 22:54:15 +00:00
in_pcb.h MFC r264879 2014-05-26 22:54:15 +00:00
in_pcbgroup.c Implement a CPU-affine TCP and UDP connection lookup data structure, 2011-06-06 12:55:02 +00:00
in_proto.c MFC r264212,r264213,r264248,r265776,r265811,r265909: 2014-05-13 06:05:53 +00:00
in_rmx.c Merge r262763, r262767, r262771, r262806 from head: 2014-03-21 15:15:30 +00:00
in_systm.h
in_var.h Back out r249318, r249320 and r249327 due to a heisenbug most 2013-05-06 16:42:18 +00:00
in.c MFC changes relating to running multiple interfaces on different fibs but 2014-06-06 20:35:40 +00:00
in.h MFC r264212,r264213,r264248,r265776,r265811,r265909: 2014-05-13 06:05:53 +00:00
ip6.h Use IP6STAT_INC/IP6STAT_DEC macros to update ip6 stats. 2013-04-09 07:11:22 +00:00
ip_carp.c Merge r262341: 2014-04-04 10:33:59 +00:00
ip_carp.h Migrate struct carpstats to PCPU counters. 2013-07-09 10:02:51 +00:00
ip_divert.c Switch the entire IPv4 stack to keep the IP packet header 2012-10-22 21:09:03 +00:00
ip_divert.h
ip_dummynet.h s/lenght/length/ in comments 2012-08-07 07:52:25 +00:00
ip_ecn.c
ip_ecn.h
ip_encap.c
ip_encap.h
ip_fastfwd.c Merge r262763, r262767, r262771, r262806 from head: 2014-03-21 15:15:30 +00:00
ip_fw.h Add ipfw support for setting/matching DiffServ codepoints (DSCP). 2013-03-20 10:35:33 +00:00
ip_gre.c Add IFF_MONITOR support to gre(4). 2013-05-11 19:05:38 +00:00
ip_gre.h
ip_icmp.c MFC r263966: 2014-04-07 12:50:08 +00:00
ip_icmp.h
ip_id.c Back out r249318, r249320 and r249327 due to a heisenbug most 2013-05-06 16:42:18 +00:00
ip_input.c MFC r265942: 2014-05-16 05:05:53 +00:00
ip_ipsec.c Merge r262763, r262767, r262771, r262806 from head: 2014-03-21 15:15:30 +00:00
ip_ipsec.h
ip_mroute.c Merge 261024: fix PIM input regression. 2014-01-27 09:33:30 +00:00
ip_mroute.h Migrate structs arpstat, icmpstat, mrtstat, pimstat and udpstat to PCPU 2013-07-09 09:50:15 +00:00
ip_options.c - Replace compat macros with function calls. 2013-03-16 08:58:28 +00:00
ip_options.h In ip_stripoptions(): 2012-10-12 09:24:24 +00:00
ip_output.c Merge r262763, r262767, r262771, r262806 from head: 2014-03-21 15:15:30 +00:00
ip_var.h Merge r263091: fix mbuf flags clash that lead to failure of operation 2014-03-18 16:56:05 +00:00
ip.h Add ToS definitions for DiffServ Codepoints as per RFC2474. 2012-05-04 21:00:32 +00:00
pim_var.h Remove most of the remaining sysctl name list macros. They were only 2013-08-26 18:16:05 +00:00
pim.h
raw_ip.c MFC r264879 2014-05-26 22:54:15 +00:00
sctp_asconf.c MFC r256556: 2013-11-21 23:00:09 +00:00
sctp_asconf.h Pass the src and dst address of a received packet explicitly around. 2012-06-28 16:01:08 +00:00
sctp_auth.c MFC r256556: 2013-11-21 23:00:09 +00:00
sctp_auth.h MFC r256556: 2013-11-21 23:00:09 +00:00
sctp_bsd_addr.c MFC r258574: 2013-12-03 20:55:37 +00:00
sctp_bsd_addr.h Do packet logging in a consistent way. 2012-06-24 21:25:54 +00:00
sctp_cc_functions.c Get rid of a gcc'ism. 2012-09-06 07:03:56 +00:00
sctp_constants.h MFC r256556: 2013-11-21 23:00:09 +00:00
sctp_crc32.c Use consistent text at the begining of the files. 2012-05-23 11:26:28 +00:00
sctp_crc32.h Use consistent text at the begining of the files. 2012-05-23 11:26:28 +00:00
sctp_dtrace_declare.h Use consistent text at the begining of the files. 2012-05-23 11:26:28 +00:00
sctp_dtrace_define.h MFC r258622: dtrace sdt: remove the ugly sname parameter of SDT_PROBE_DEFINE 2014-01-17 10:58:59 +00:00
sctp_header.h Don't include a structure containing a flexible array in another 2012-09-07 13:36:42 +00:00
sctp_indata.c MFC r256556: 2013-11-21 23:00:09 +00:00
sctp_indata.h Code cleanups. 2013-07-03 18:48:43 +00:00
sctp_input.c Provide human readable debug output. 2013-08-25 12:44:03 +00:00
sctp_input.h Don't include a structure containing a flexible array in another 2012-09-07 13:36:42 +00:00
sctp_lock_bsd.h Use consistent text at the begining of the files. 2012-05-23 11:26:28 +00:00
sctp_os_bsd.h Merge r262763, r262767, r262771, r262806 from head: 2014-03-21 15:15:30 +00:00
sctp_os.h Use consistent text at the begining of the files. 2012-05-23 11:26:28 +00:00
sctp_output.c MFC r256556: 2013-11-21 23:00:09 +00:00
sctp_output.h Cleanup the handling of address scopes. Announce in the INIT/INIT-ACK 2013-02-09 17:26:14 +00:00
sctp_pcb.c MFC r258574: 2013-12-03 20:55:37 +00:00
sctp_pcb.h Make the features a 64-bit value instead of 32-bit. 2013-08-12 13:52:15 +00:00
sctp_peeloff.c Add support for sctp_peeloff() also in the front states of the 2012-11-26 16:44:03 +00:00
sctp_peeloff.h Remove unused function. 2012-11-25 14:25:08 +00:00
sctp_ss_functions.c Use consistent text at the begining of the files. 2012-05-23 11:26:28 +00:00
sctp_structs.h Remove redundant field pr_sctp_on. 2013-09-03 19:31:59 +00:00
sctp_sysctl.c Merge r261590: Fixup for r261590 (vnet sysctl handlers cleanup) 2014-03-04 14:05:37 +00:00
sctp_sysctl.h Fix a bug were only 2048 streams where usable even though more than 2013-07-05 10:08:49 +00:00
sctp_timer.c MFC r256556: 2013-11-21 23:00:09 +00:00
sctp_timer.h Use consistent text at the begining of the files. 2012-05-23 11:26:28 +00:00
sctp_uio.h All changes affect only SCTP-AUTH: 2013-09-02 22:48:41 +00:00
sctp_usrreq.c MFC r259943: 2014-01-07 23:50:02 +00:00
sctp_var.h Whitespace changes due to upstream integration of SCTP changes in the 2012-10-29 20:47:32 +00:00
sctp.h Make the features a 64-bit value instead of 32-bit. 2013-08-12 13:52:15 +00:00
sctputil.c MFC r259943: 2014-01-07 23:50:02 +00:00
sctputil.h Add support for SCTP/UDP/IPV6. 2012-11-17 20:04:04 +00:00
siftr.c The hashmask returned by hashinit() is a valid index in the returned hash array. 2013-03-07 04:42:20 +00:00
tcp_debug.c Switch the entire IPv4 stack to keep the IP packet header 2012-10-22 21:09:03 +00:00
tcp_debug.h
tcp_fsm.h
tcp_hostcache.c - Update cachelimit after hashsize and bucketlimit were set. 2012-10-19 14:00:03 +00:00
tcp_hostcache.h
tcp_input.c MFC r258622: dtrace sdt: remove the ugly sname parameter of SDT_PROBE_DEFINE 2014-01-17 10:58:59 +00:00
tcp_lro.c Merge r254336 from user/np/cxl_tuning. 2013-08-28 23:00:34 +00:00
tcp_lro.h Merge r254336 from user/np/cxl_tuning. 2013-08-28 23:00:34 +00:00
tcp_offload.c - Updated TOE support in the kernel. 2012-06-19 07:34:13 +00:00
tcp_offload.h - Updated TOE support in the kernel. 2012-06-19 07:34:13 +00:00
tcp_output.c Merge r262763, r262767, r262771, r262806 from head: 2014-03-21 15:15:30 +00:00
tcp_reass.c Fix devfs rules not applied by default for jails. 2014-04-30 04:03:05 +00:00
tcp_sack.c
tcp_seq.h Fix PAWS (Protect Against Wrapped Sequence numbers) in cases when 2012-02-15 16:09:56 +00:00
tcp_subr.c MFC: r264739 2014-05-06 22:04:50 +00:00
tcp_syncache.c MFC r260871: 2014-02-10 06:29:05 +00:00
tcp_syncache.h Introduce spares in the TCP syncache and timewait structures 2013-09-21 10:01:51 +00:00
tcp_timer.c - Make callout(9) tickless, relying on eventtimers(4) as backend for 2013-03-04 11:09:56 +00:00
tcp_timer.h Add DELACK to list of timers. 2012-11-27 19:07:28 +00:00
tcp_timewait.c Mechanically substitute flags from historic mbuf allocator with 2012-12-05 08:04:20 +00:00
tcp_usrreq.c Merge r257846: 2014-01-22 10:08:33 +00:00
tcp_var.h Introduce spares in the TCP syncache and timewait structures 2013-09-21 10:01:51 +00:00
tcp.h Add placeholder constants to reserve a portion of the socket option 2013-02-01 15:32:20 +00:00
tcpip.h
toecore.c Teach toe_l2_resolve to resolve IPv6 destinations too. 2013-01-26 00:57:29 +00:00
toecore.h Correctly handle the case where an inp has already been dropped by the time 2012-08-21 18:09:33 +00:00
udp_usrreq.c MFC r264212,r264213,r264248,r265776,r265811,r265909: 2014-05-13 06:05:53 +00:00
udp_var.h MFC r264212,r264213,r264248,r265776,r265811,r265909: 2014-05-13 06:05:53 +00:00
udp.h Add placeholder constants to reserve a portion of the socket option 2013-02-01 15:32:20 +00:00
udplite.h MFC r264212,r264213,r264248,r265776,r265811,r265909: 2014-05-13 06:05:53 +00:00