opnsense-src/sys/netinet
Bjoern A. Zeeb 0895aec30c Implement IPv4 source address selection for unbound sockets.
For the jail case we are already looping over the interface addresses
before falling back to the only IP address of a jail in case of no
match. This is in preparation for the upcoming multi-IPv4/v6/no-IP
jail patch this change was developed with initially.

This also changes the semantics of selecting the IP for processes within
a jail as it now uses the same logic as outside the jail (with additional
checks) but no longer is on a mutually exclusive code path.

Benchmarks had shown no difference at 95.0% confidence for neither the
plain nor the jail case (even with the additional overhead).  See:
http://lists.freebsd.org/pipermail/freebsd-net/2008-September/019531.html

Inpsired by a patch from:	Yahoo! (partially)
Tested by:			latest multi-IP jail patch users (implictly)
Discussed with:			rwatson (general things around this)
Reviewed by:			mostly silence (feedback from bms)
Help with benchmarking from:	kris
MFC after:			2 months
2008-10-03 12:21:21 +00:00
..
libalias Improve the entropy of the source port randomization for network address 2008-08-30 20:58:34 +00:00
accf_data.c Add FBSDID to all files in netinet so that people can more 2007-10-07 20:44:24 +00:00
accf_dns.c Add an accept filter for TCP based DNS requests. It waits until the 2008-07-18 14:44:51 +00:00
accf_http.c Add FBSDID to all files in netinet so that people can more 2007-10-07 20:44:24 +00:00
icmp6.h - Disabled responding to NI queries from a global address by default as 2007-05-17 21:20:24 +00:00
icmp_var.h Attempt to improve feature parity between UDPv4 and UDPv6 by merging 2007-07-19 22:34:25 +00:00
if_atm.c Add code to allow the system to handle multiple routing tables. 2008-05-09 23:03:00 +00:00
if_atm.h /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00
if_ether.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
if_ether.h Don't duplicate the whole of arpresolve to arpresolve 2 for the sake 2007-12-31 23:48:06 +00:00
igmp.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
igmp.h Stub out imported IGMPv3 definitions which clash with those of 2007-06-15 18:59:10 +00:00
igmp_var.h Import rewrite of IPv4 socket multicast layer to support source-specific 2007-06-12 16:24:56 +00:00
in.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
in.h Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
in_cksum.c Add FBSDID to all files in netinet so that people can more 2007-10-07 20:44:24 +00:00
in_gif.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
in_gif.h /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00
in_mcast.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
in_pcb.c Implement IPv4 source address selection for unbound sockets. 2008-10-03 12:21:21 +00:00
in_pcb.h Fix typo in comment. 2008-09-29 13:48:48 +00:00
in_proto.c This patch provides the back end support for equal-cost multi-path 2008-04-13 05:45:14 +00:00
in_rmx.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
in_systm.h /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00
in_var.h Revert a part of the MRT commit that proved un-needed. 2008-09-14 08:19:48 +00:00
ip.h Move CTASSERT from header file to source file, per implementation note now 2008-09-26 18:30:11 +00:00
ip6.h Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
ip_carp.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
ip_carp.h Make sure that carp_header is 36 bytes long 2006-12-01 18:37:41 +00:00
ip_divert.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
ip_divert.h Convert IPDIVERT into a loadable module. This makes use of the dynamic loadability 2004-10-19 21:14:57 +00:00
ip_dummynet.c Consistently check IPFW and DUMMYNET privileges in the configuration 2008-05-22 08:10:31 +00:00
ip_dummynet.h 1) dummynet_io() declaration has changed. 2007-11-06 23:01:42 +00:00
ip_ecn.c Add FBSDID to all files in netinet so that people can more 2007-10-07 20:44:24 +00:00
ip_ecn.h /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00
ip_encap.c Add FBSDID to all files in netinet so that people can more 2007-10-07 20:44:24 +00:00
ip_encap.h /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00
ip_fastfwd.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
ip_fw.h Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
ip_fw2.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
ip_fw_nat.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
ip_fw_pfil.c Commit step 1 of the vimage project, (network stack) 2008-08-17 23:27:27 +00:00
ip_gre.c Enqueue de-capsulated packet instead of performing direct dispatch. It's 2008-07-04 21:01:30 +00:00
ip_gre.h Fix stack corruptions on amd64. 2006-01-21 10:44:34 +00:00
ip_icmp.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
ip_icmp.h Pass icmp_error() the MTU argument directly instead of 2005-05-04 13:09:19 +00:00
ip_id.c Replace the random IP ID generation code we 2008-02-06 15:40:30 +00:00
ip_input.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
ip_ipsec.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
ip_ipsec.h Take the route mtu into account, if available, when sending an 2008-04-09 05:17:18 +00:00
ip_mroute.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
ip_mroute.h Add code to allow the system to handle multiple routing tables. 2008-05-09 23:03:00 +00:00
ip_options.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
ip_options.h Normalize style a bit: reduce pseudo-randomness of comment layout and 2007-05-11 10:48:30 +00:00
ip_output.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
ip_var.h Another V_ forgotten 2008-08-25 05:49:16 +00:00
ipprotosw.h /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00
pim.h /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00
pim_var.h Remove public declarations of variables that were forgotten when they were 2005-08-10 07:10:02 +00:00
raw_ip.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
sctp.h Adds support for the SCTP_PORT_REUSE option 2008-07-31 11:08:30 +00:00
sctp_asconf.c - Out with some printfs. 2008-07-29 09:06:35 +00:00
sctp_asconf.h 1) Adds the rest of the VIMAGE change macros 2008-07-09 16:45:30 +00:00
sctp_auth.c - Macro-izes the packed declaration in all headers. 2008-06-14 07:58:05 +00:00
sctp_auth.h - fix send_failed notification contents 2007-06-09 13:46:57 +00:00
sctp_bsd_addr.c Nit 2008-08-09 11:28:57 +00:00
sctp_bsd_addr.h 1) Adds the rest of the VIMAGE change macros 2008-07-09 16:45:30 +00:00
sctp_cc_functions.c - Macro-izes the packed declaration in all headers. 2008-06-14 07:58:05 +00:00
sctp_cc_functions.h 1) Adds the rest of the VIMAGE change macros 2008-07-09 16:45:30 +00:00
sctp_constants.h - Out with some printfs. 2008-07-29 09:06:35 +00:00
sctp_crc32.c - Copyright change, cisco's silly tool wants it to say: 2007-05-08 17:01:12 +00:00
sctp_crc32.h 1) Adds the rest of the VIMAGE change macros 2008-07-09 16:45:30 +00:00
sctp_header.h - Macro-izes the packed declaration in all headers. 2008-06-14 07:58:05 +00:00
sctp_indata.c - Make strict-sacks be the default. 2008-08-28 09:44:07 +00:00
sctp_indata.h 1) Adds the rest of the VIMAGE change macros 2008-07-09 16:45:30 +00:00
sctp_input.c - Out with some printfs. 2008-07-29 09:06:35 +00:00
sctp_input.h 1) Adds the rest of the VIMAGE change macros 2008-07-09 16:45:30 +00:00
sctp_lock_bsd.h - Make strict-sacks be the default. 2008-08-28 09:44:07 +00:00
sctp_os.h - Fix address add handling to clear cached routes and source addresses 2007-08-24 00:53:53 +00:00
sctp_os_bsd.h Commit step 1 of the vimage project, (network stack) 2008-08-17 23:27:27 +00:00
sctp_output.c - Make strict-sacks be the default. 2008-08-28 09:44:07 +00:00
sctp_output.h 1) Adds the rest of the VIMAGE change macros 2008-07-09 16:45:30 +00:00
sctp_pcb.c - When we close a socket with pending assoc's that are still 2008-08-27 13:13:35 +00:00
sctp_pcb.h Adds support for the SCTP_PORT_REUSE option 2008-07-31 11:08:30 +00:00
sctp_peeloff.c - Macro-izes the packed declaration in all headers. 2008-06-14 07:58:05 +00:00
sctp_peeloff.h - Copyright change, cisco's silly tool wants it to say: 2007-05-08 17:01:12 +00:00
sctp_structs.h - Adds support for the multi-asconf (From Kozuka-san) 2008-05-20 13:47:46 +00:00
sctp_sysctl.c - Macro-izes the packed declaration in all headers. 2008-06-14 07:58:05 +00:00
sctp_sysctl.h - Make strict-sacks be the default. 2008-08-28 09:44:07 +00:00
sctp_timer.c ok, non static the function and put in the .h so 2008-08-28 20:31:24 +00:00
sctp_timer.h ok, non static the function and put in the .h so 2008-08-28 20:31:24 +00:00
sctp_uio.h 1) Adds the rest of the VIMAGE change macros 2008-07-09 16:45:30 +00:00
sctp_usrreq.c Adds support for the SCTP_PORT_REUSE option 2008-07-31 11:08:30 +00:00
sctp_var.h - Make strict-sacks be the default. 2008-08-28 09:44:07 +00:00
sctputil.c - Make strict-sacks be the default. 2008-08-28 09:44:07 +00:00
sctputil.h 1) Adds the rest of the VIMAGE change macros 2008-07-09 16:45:30 +00:00
tcp.h add rcv_nxt, snd_nxt, and toe offload id to FreeBSD-specific 2008-05-05 20:13:31 +00:00
tcp_debug.c To my reading there are no real consumers of ip6_plen (IPv6 2008-09-07 20:44:45 +00:00
tcp_debug.h o Use a define for a buffer size. 2007-03-24 22:15:02 +00:00
tcp_fsm.h Make tcpstates[] static, and make sure TCPSTATES is defined before 2007-07-30 11:06:42 +00:00
tcp_hostcache.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
tcp_input.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
tcp_lro.c Don't calculate checksum if it has already been validated 2008-08-24 02:31:09 +00:00
tcp_lro.h Add generic TCP LOR into netinet 2008-06-11 22:12:50 +00:00
tcp_offload.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
tcp_offload.h - Switch to INP_WLOCK macro from inp_wlock 2008-07-21 21:22:56 +00:00
tcp_output.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
tcp_reass.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
tcp_sack.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
tcp_seq.h Remove T/TCP RFC1644 Connection Count comparison macros. They are no longer 2006-06-18 14:24:12 +00:00
tcp_subr.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
tcp_syncache.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
tcp_syncache.h Move some struct defs around. This is a prep step for Vimage.A 2008-08-25 00:33:30 +00:00
tcp_timer.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
tcp_timer.h Two changes: 2007-09-24 05:26:24 +00:00
tcp_timewait.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
tcp_usrreq.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
tcp_var.h Split tcp_mss() in tcp_mss() and tcp_mss_update() where the former 2008-09-07 18:50:25 +00:00
tcpip.h /* -> /*- for license, minor formatting changes 2005-01-07 01:45:51 +00:00
toedev.h Don't check if an interface can do tcp offload if there are no offload devices registered on the system. 2008-09-01 05:30:22 +00:00
udp.h Gratuitous UDP restyling toward style(9) in 7.x. 2007-02-20 10:13:11 +00:00
udp_usrreq.c Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00
udp_var.h Further cleanup of UDPv4: 2007-07-10 09:30:46 +00:00
vinet.h Step 1.5 of importing the network stack virtualization infrastructure 2008-10-02 15:37:58 +00:00