freebsd-dev/sys/netinet6
Alexander V. Chernikov 50fa27e795 netinet6: fix interface handling for loopback traffic
Currently, processing of IPv6 local traffic is partially broken:
 link-local connection fails and global unicast connect() takes
 3 seconds to complete.
This happens due to the combination of multiple factors.
IPv6 code passes original interface "origifp" when passing
traffic via loopack to retain the scope that is mandatory for the
correct hadling of link-local traffic. First problem is that the logic
of passing source interface is not working correcly for TCP connections,
resulting in passing "origifp" on the first 2 connection attempts and
lo0 on the subsequent ones. Second problem is that source address
validation logic skips its checks iff the source interface is loopback,
which doesn't cover "origifp" case.
More detailed description is available at https://reviews.freebsd.org/D35732

Fix the first problem by untangling&simplifying ifp/origifp logic.
Fix the second problem by switching source address validation check to
using M_LOOP mbuf flag instead of interface type.

PR:		265089
Reviewed by:	ae, bz(previous version)
Differential Revision:	https://reviews.freebsd.org/D35732
MFC after:	2 weeks
2022-07-10 12:47:47 +00:00
..
dest6.c
frag6.c netinet6: Fix a typo in a sysctl description 2021-11-30 07:24:44 +01:00
icmp6.c Revert "wpa: Import wpa_supplicant/hostapd commit 14ab4a816" 2021-12-02 14:45:04 -08:00
icmp6.h
in6_cksum.c
in6_fib_algo.c Fix dpdk/ldradix fib lookup algorithm preference calculation. 2021-03-07 22:17:53 +00:00
in6_fib.c Fix unused-function waring when compiling with FIB_ALGO. 2021-01-30 23:25:56 +00:00
in6_fib.h
in6_gif.c net: Introduce IPV6_DSCP(), IPV6_ECN() and IPV6_TRAFFIC_CLASS() macros 2021-03-04 20:56:48 +01:00
in6_ifattach.c nd6: Mark several callouts as MPSAFE 2021-08-09 13:27:52 -04:00
in6_ifattach.h
in6_jail.c sysent: Get rid of bogus sys/sysent.h include. 2022-05-28 20:52:17 +03:00
in6_mcast.c in6p_set_multicast_if(): fix malloc(M_WAITOK) with epoch 2021-12-06 14:33:23 -08:00
in6_pcb.c in_pcb: use jenkins hash over the entire IPv6 (or IPv4) address 2021-12-26 10:47:28 -08:00
in6_pcb.h Revert "wpa: Import wpa_supplicant/hostapd commit 14ab4a816" 2021-12-02 14:45:04 -08:00
in6_proto.c domains: make domain_init() initialize only global state 2022-01-03 10:15:22 -08:00
in6_rmx.c netinet6: Use __diagused for variables only used in KASSERT(). 2022-04-13 16:08:19 -07:00
in6_rss.c Revert "wpa: Import wpa_supplicant/hostapd commit 14ab4a816" 2021-12-02 14:45:04 -08:00
in6_rss.h
in6_src.c netinet6: simplify selectroute() 2022-07-08 11:27:16 +00:00
in6_var.h netinet6: fix ndp proxying 2022-05-30 10:53:33 +00:00
in6.c netinet6: fix panic on kldunload pfsync 2022-06-01 09:26:15 +02:00
in6.h Add in_localip_fib(), in6_localip_fib(). 2021-11-12 08:59:42 -08:00
ip6_ecn.h
ip6_fastfwd.c
ip6_forward.c
ip6_gre.c udp: allow udp_tun_func_t() to indicate it did not eat the packet 2022-04-12 10:04:59 +02:00
ip6_id.c
ip6_input.c netinet6: fix interface handling for loopback traffic 2022-07-10 12:47:47 +00:00
ip6_mroute.c ip6_mroute: Mark a variable only used in a debug trace as unused. 2022-04-06 16:45:29 -07:00
ip6_mroute.h
ip6_output.c netinet6: fix interface handling for loopback traffic 2022-07-10 12:47:47 +00:00
ip6_var.h protocols: init with standard SYSINIT(9) or VNET_SYSINIT 2022-01-03 10:15:21 -08:00
ip6.h
ip6protosw.h
ip_fw_nat64.h
ip_fw_nptv6.h
mld6_var.h
mld6.c mbuf: remove PH_vt alias for mbuf packet header persistent shared data 2022-05-13 13:32:43 -07:00
mld6.h
nd6_nbr.c netinet6: fix ndp proxying 2022-05-30 10:53:33 +00:00
nd6_rtr.c netinet6: Fix a typo in a source code comment 2022-03-28 19:32:10 +02:00
nd6.c netinet6: Fix mbuf leak in NDP 2022-05-31 21:06:14 +00:00
nd6.h lltable: Add support for "child" LLEs holding encap for IPv4oIPv6 entries. 2021-08-21 17:34:35 +00:00
pim6_var.h
pim6.h
raw_ip6.c rip6: Fix a lock order reversal in rip6_bind() 2022-06-14 12:00:59 -04:00
raw_ip6.h
route6.c
scope6_var.h
scope6.c ifnet_byindex() actually requires network epoch 2021-12-06 09:32:31 -08:00
sctp6_usrreq.c sctp: improve sctp_pathmtu_adjustment() 2021-12-30 15:16:05 +01:00
sctp6_var.h
send.c socket: Implement SO_RERROR 2021-07-28 09:35:09 -07:00
send.h
tcp6_var.h tcp: add support for TCP over UDP 2021-04-18 16:16:42 +02:00
udp6_usrreq.c sockbuf: merge two versions of sbcreatecontrol() into one 2022-05-17 10:10:42 -07:00
udp6_var.h