Willem de Bruijn
e72258bf6a
udp: rehash on disconnect
...
[ Upstream commit 303d0403b8c25e994e4a6e45389e173cf8706fb5 ]
As of the below commit, udp sockets bound to a specific address can
coexist with one bound to the any addr for the same port.
The commit also phased out the use of socket hashing based only on
port (hslot), in favor of always hashing on {addr, port} (hslot2).
The change broke the following behavior with disconnect (AF_UNSPEC):
server binds to 0.0.0.0:1337
server connects to 127.0.0.1:80
server disconnects
client connects to 127.0.0.1:1337
client sends "hello"
server reads "hello" // times out, packet did not find sk
On connect the server acquires a specific source addr suitable for
routing to its destination. On disconnect it reverts to the any addr.
The connect call triggers a rehash to a different hslot2. On
disconnect, add the same to return to the original hslot2.
Skip this step if the socket is going to be unhashed completely.
Fixes: 4cdeeee925 ("net: udp: prefer listeners bound to an address")
Reported-by: Pavel Roskin <[email protected] >
Signed-off-by: Willem de Bruijn <[email protected] >
Reviewed-by: Eric Dumazet <[email protected] >
Signed-off-by: David S. Miller <[email protected] >
Signed-off-by: Greg Kroah-Hartman <[email protected] >
2020-03-05 16:43:33 +01:00
..
bpfilter
netfilter
netfilter: arp_tables: init netns pointer in xt_tgdtor_param struct
2020-01-23 08:22:47 +01:00
af_inet.c
net: remove empty inet_exit_net
2019-08-19 18:22:54 -07:00
ah4.c
xfrm: remove type and offload_type map from xfrm_state_afinfo
2019-06-06 08:34:50 +02:00
arp.c
cipso_ipv4.c
datagram.c
inet: stop leaking jiffies on the wire
2019-11-01 14:57:52 -07:00
devinet.c
inet: protect against too small mtu values.
2019-12-18 16:08:17 +01:00
esp4.c
xfrm: remove get_mtu indirection from xfrm_type
2019-07-01 06:16:40 +02:00
esp4_offload.c
xfrm: support output_mark for offload ESP packets
2020-01-29 16:45:31 +01:00
fib_frontend.c
ipv4: fix route update on metric change.
2019-10-26 11:25:53 -07:00
fib_lookup.h
ipv4: Use accessors for fib_info nexthop data
2019-06-04 19:26:49 -07:00
fib_notifier.c
fib_rules.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
2019-06-07 11:00:14 -07:00
fib_semantics.c
ipv4: Fix table id reference in fib_sync_down_addr
2019-11-07 16:14:36 -08:00
fib_trie.c
ipv4: Detect rollover in specific fib table dump
2020-01-29 16:45:24 +01:00
fou.c
fou: Fix IPv6 netlink policy
2020-01-29 16:45:22 +01:00
gre_demux.c
gre: refetch erspan header from skb->data after pskb_may_pull()
2019-12-18 16:08:51 +01:00
gre_offload.c
icmp.c
net: icmp: fix data-race in cmp_global_allow()
2020-01-04 19:18:40 +01:00
igmp.c
net: fix __ip_mc_inc_group usage
2019-08-20 12:48:06 -07:00
inet_connection_sock.c
net: add bool confirm_neigh parameter for dst_ops.update_pmtu
2020-01-04 19:18:58 +01:00
inet_diag.c
tcp/dccp: fix possible race __inet_lookup_established()
2020-01-04 19:19:13 +01:00
inet_fragment.c
inet: frags: re-introduce skb coalescing for local delivery
2019-08-08 15:55:10 -07:00
inet_hashtables.c
tcp/dccp: fix possible race __inet_lookup_established()
2020-01-04 19:19:13 +01:00
inet_timewait_sock.c
inetpeer.c
inetpeer: fix data-race in inet_putpeer / inet_putpeer
2020-01-04 19:18:39 +01:00
ip_forward.c
ipv4: Revert removal of rt_uses_gateway
2019-09-20 18:23:33 -07:00
ip_fragment.c
inet: frags: re-introduce skb coalescing for local delivery
2019-08-08 15:55:10 -07:00
ip_gre.c
erspan: fix the tun_info options_len check for erspan
2019-10-29 17:36:42 -07:00
ip_input.c
netfilter: drop bridge nf reset from nf_reset
2019-10-01 18:42:15 +02:00
ip_options.c
netfilter: nf_tables: add support for matching IPv4 options
2019-06-21 18:35:51 +02:00
ip_output.c
inet: protect against too small mtu values.
2019-12-18 16:08:17 +01:00
ip_sockglue.c
ip_tunnel.c
net, ip_tunnel: fix namespaces move
2020-01-29 16:45:20 +01:00
ip_tunnel_core.c
ip_tunnel: allow not to count pkts on tstats by setting skb's dev to NULL
2019-06-18 20:48:45 -04:00
ip_vti.c
vti[6]: fix packet tx through bpf_redirect()
2020-02-05 21:22:48 +00:00
ipcomp.c
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/klassert/ipsec-next
2019-07-05 15:01:15 -07:00
ipconfig.c
ipip.c
ipip: validate header length in ipip_tunnel_xmit
2019-07-25 17:23:40 -07:00
ipmr.c
ipmr: Fix skb headroom in ipmr_get_route().
2019-11-16 13:06:54 -08:00
ipmr_base.c
Kconfig
net: Fix Kconfig indentation
2019-09-26 08:56:17 +02:00
Makefile
metrics.c
netfilter.c
netlink.c
nexthop.c
net: include struct nhmsg size in nh nlmsg size
2020-02-01 09:34:39 +00:00
ping.c
ip: support SO_MARK cmsg
2019-09-13 21:44:19 +02:00
proc.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
2019-06-17 20:20:36 -07:00
protocol.c
raw.c
netfilter: drop bridge nf reset from nf_reset
2019-10-01 18:42:15 +02:00
raw_diag.c
net: don't warn in inet diag when IPV6 is disabled
2019-07-03 11:26:35 -07:00
route.c
net: add bool confirm_neigh parameter for dst_ops.update_pmtu
2020-01-04 19:18:58 +01:00
syncookies.c
sysctl_net_ipv4.c
net/ipv4: fix sysctl max for fib_multipath_hash_policy
2019-11-18 17:25:36 -08:00
tcp.c
tcp: clear tp->segs_{in|out} in tcp_disconnect()
2020-02-11 04:35:06 -08:00
tcp_bbr.c
tcp_bbr: improve arithmetic division in bbr_update_bw()
2020-01-29 16:45:21 +01:00
tcp_bic.c
tcp_bpf.c
bpf/sockmap: Read psock ingress_msg before sk_receive_queue
2020-01-23 08:22:47 +01:00
tcp_cdg.c
tcp_cong.c
tcp: fix tcp_set_congestion_control() use from bpf hook
2019-07-18 20:33:48 -07:00
tcp_cubic.c
tcp_dctcp.c
tcp_dctcp.h
tcp_diag.c
tcp: annotate tp->write_seq lockless reads
2019-10-13 10:13:08 -07:00
tcp_fastopen.c
tcp: add rcu protection around tp->fastopen_rsk
2019-10-13 10:13:08 -07:00
tcp_highspeed.c
tcp_htcp.c
tcp_hybla.c
tcp_illinois.c
tcp_input.c
tcp: do not leave dangling pointers in tp->highest_sack
2020-01-29 16:45:22 +01:00
tcp_ipv4.c
tcp/dccp: fix possible race __inet_lookup_established()
2020-01-04 19:19:13 +01:00
tcp_lp.c
tcp_metrics.c
tcp_minisocks.c
tcp: annotate tp->snd_nxt lockless reads
2019-10-13 10:13:08 -07:00
tcp_nv.c
tcp_offload.c
tcp_output.c
tcp: do not leave dangling pointers in tp->highest_sack
2020-01-29 16:45:22 +01:00
tcp_rate.c
tcp_recovery.c
tcp_scalable.c
tcp_timer.c
tcp: add rcu protection around tp->fastopen_rsk
2019-10-13 10:13:08 -07:00
tcp_ulp.c
bpf: Sockmap/tls, push write_space updates through ulp updates
2020-01-23 08:22:45 +01:00
tcp_vegas.c
tcp_vegas.h
tcp_veno.c
tcp_westwood.c
tcp_yeah.c
tunnel4.c
udp.c
udp: rehash on disconnect
2020-03-05 16:43:33 +01:00
udp_diag.c
udp_impl.h
udp_offload.c
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
2019-06-22 08:59:24 -04:00
udp_tunnel.c
udplite.c
xfrm4_input.c
xfrm4_output.c
xfrm4_policy.c
net: add bool confirm_neigh parameter for dst_ops.update_pmtu
2020-01-04 19:18:58 +01:00
xfrm4_protocol.c
xfrm4_state.c
xfrm: remove eth_proto value from xfrm_state_afinfo
2019-06-06 08:34:50 +02:00
xfrm4_tunnel.c
xfrm: remove type and offload_type map from xfrm_state_afinfo
2019-06-06 08:34:50 +02:00