freebsd-dev/sys/netinet6
Jonathan T. Looney 440598dd9e Fix implicit automatic local port selection for IPv6 during connect calls.
When a user creates a TCP socket and tries to connect to the socket without
explicitly binding the socket to a local address, the connect call
implicitly chooses an appropriate local port. When evaluating candidate
local ports, the algorithm checks for conflicts with existing ports by
doing a lookup in the connection hash table.

In this circumstance, both the IPv4 and IPv6 code look for exact matches
in the hash table. However, the IPv4 code goes a step further and checks
whether the proposed 4-tuple will match wildcard (e.g. TCP "listen")
entries. The IPv6 code has no such check.

The missing wildcard check can cause problems when connecting to a local
server. It is possible that the algorithm will choose the same value for
the local port as the foreign port uses. This results in a connection with
identical source and destination addresses and ports. Changing the IPv6
code to align with the IPv4 code's behavior fixes this problem.

Reviewed by:	tuexen
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D27164
2020-11-14 14:50:34 +00:00
..
dest6.c
frag6.c
icmp6.c Fix use-after-free in icmp6_notify_error(). 2020-10-28 20:22:20 +00:00
icmp6.h
in6_cksum.c
in6_fib.c Implement flowid calculation for outbound connections to balance 2020-10-18 17:15:47 +00:00
in6_fib.h Implement flowid calculation for outbound connections to balance 2020-10-18 17:15:47 +00:00
in6_gif.c
in6_ifattach.c
in6_ifattach.h
in6_jail.c
in6_mcast.c
in6_pcb.c Fix implicit automatic local port selection for IPv6 during connect calls. 2020-11-14 14:50:34 +00:00
in6_pcb.h
in6_pcbgroup.c
in6_proto.c Remove unused nhop_ref_any() function. 2020-09-20 21:32:52 +00:00
in6_rmx.c Introduce scalable route multipath. 2020-10-03 10:47:17 +00:00
in6_rss.c Implement flowid calculation for outbound connections to balance 2020-10-18 17:15:47 +00:00
in6_rss.h Implement flowid calculation for outbound connections to balance 2020-10-18 17:15:47 +00:00
in6_src.c Remove unused nhop_ref_any() function. 2020-09-20 21:32:52 +00:00
in6_var.h
in6.c
in6.h Add IP(V6)_VLAN_PCP to set 802.1 priority per-flow. 2020-10-09 12:06:43 +00:00
ip6_ecn.h
ip6_fastfwd.c
ip6_forward.c
ip6_gre.c
ip6_id.c
ip6_input.c
ip6_mroute.c
ip6_mroute.h
ip6_output.c Implement flowid calculation for outbound connections to balance 2020-10-18 17:15:47 +00:00
ip6_var.h
ip6.h
ip6protosw.h
ip_fw_nat64.h
ip_fw_nptv6.h
mld6_var.h
mld6.c
mld6.h
nd6_nbr.c icmp6: Count packets dropped due to an invalid hop limit 2020-10-19 17:07:19 +00:00
nd6_rtr.c icmp6: Count packets dropped due to an invalid hop limit 2020-10-19 17:07:19 +00:00
nd6.c Introduce scalable route multipath. 2020-10-03 10:47:17 +00:00
nd6.h
pim6_var.h
pim6.h
raw_ip6.c Implement flowid calculation for outbound connections to balance 2020-10-18 17:15:47 +00:00
raw_ip6.h
route6.c
scope6_var.h
scope6.c
sctp6_usrreq.c
sctp6_var.h
send.c
send.h
tcp6_var.h
udp6_usrreq.c Implement flowid calculation for outbound connections to balance 2020-10-18 17:15:47 +00:00
udp6_var.h