Skip to content

Commit f7c4615

Browse files
akodanevdavem330
authored andcommitted
udp6: add missing rehash callback to udplite
After commit 23b0269 ("net: udp6: prefer listeners bound to an address"), UDP-Lite only works when specifying a local address for the sockets. This is related to the problem addressed in the commit 719f835 ("udp: add rehash on connect()"). Moreover, __udp6_lib_lookup() now looks for a socket immediately in the secondary hash table. And this issue was found with LTP/network tests as well. Fixes: 23b0269 ("net: udp6: prefer listeners bound to an address") Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com> Reviewed-by: Eric Dumazet <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 8f6b539 commit f7c4615

File tree

3 files changed

+3
-1
lines changed

3 files changed

+3
-1
lines changed

net/ipv6/udp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -102,7 +102,7 @@ int udp_v6_get_port(struct sock *sk, unsigned short snum)
102102
return udp_lib_get_port(sk, snum, hash2_nulladdr);
103103
}
104104

105-
static void udp_v6_rehash(struct sock *sk)
105+
void udp_v6_rehash(struct sock *sk)
106106
{
107107
u16 new_hash = ipv6_portaddr_hash(sock_net(sk),
108108
&sk->sk_v6_rcv_saddr,

net/ipv6/udp_impl.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,6 +13,7 @@ int __udp6_lib_err(struct sk_buff *, struct inet6_skb_parm *, u8, u8, int,
1313
__be32, struct udp_table *);
1414

1515
int udp_v6_get_port(struct sock *sk, unsigned short snum);
16+
void udp_v6_rehash(struct sock *sk);
1617

1718
int udpv6_getsockopt(struct sock *sk, int level, int optname,
1819
char __user *optval, int __user *optlen);

net/ipv6/udplite.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -49,6 +49,7 @@ struct proto udplitev6_prot = {
4949
.recvmsg = udpv6_recvmsg,
5050
.hash = udp_lib_hash,
5151
.unhash = udp_lib_unhash,
52+
.rehash = udp_v6_rehash,
5253
.get_port = udp_v6_get_port,
5354
.memory_allocated = &udp_memory_allocated,
5455
.sysctl_mem = sysctl_udp_mem,

0 commit comments

Comments
 (0)