* [PATCH net 1/2] udp: add missing rehash callback to udplite
@ 2019-01-16 16:17 Alexey Kodanev
2019-01-16 16:17 ` [PATCH net 2/2] udp6: " Alexey Kodanev
` (2 more replies)
0 siblings, 3 replies; 6+ messages in thread
From: Alexey Kodanev @ 2019-01-16 16:17 UTC (permalink / raw)
To: netdev; +Cc: Peter Oskolkov, Eric Dumazet, David Miller, Alexey Kodanev
After commit 4cdeeee9252a ("net: udp: 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 719f835853a9
("udp: add rehash on connect()"). Moreover, __udp4_lib_lookup() now
looks for a socket immediately in the secondary hash table.
The issue was found with LTP/network tests (UDP-Lite test-cases).
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
net/ipv4/udp.c | 2 +-
net/ipv4/udp_impl.h | 1 +
net/ipv4/udplite.c | 1 +
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/ipv4/udp.c b/net/ipv4/udp.c
index 3fb0ed5..26d3a4c 100644
--- a/net/ipv4/udp.c
+++ b/net/ipv4/udp.c
@@ -1918,7 +1918,7 @@ void udp_lib_rehash(struct sock *sk, u16 newhash)
}
EXPORT_SYMBOL(udp_lib_rehash);
-static void udp_v4_rehash(struct sock *sk)
+void udp_v4_rehash(struct sock *sk)
{
u16 new_hash = ipv4_portaddr_hash(sock_net(sk),
inet_sk(sk)->inet_rcv_saddr,
diff --git a/net/ipv4/udp_impl.h b/net/ipv4/udp_impl.h
index 3226726..6b2fa77 100644
--- a/net/ipv4/udp_impl.h
+++ b/net/ipv4/udp_impl.h
@@ -10,6 +10,7 @@
int __udp4_lib_err(struct sk_buff *, u32, struct udp_table *);
int udp_v4_get_port(struct sock *sk, unsigned short snum);
+void udp_v4_rehash(struct sock *sk);
int udp_setsockopt(struct sock *sk, int level, int optname,
char __user *optval, unsigned int optlen);
diff --git a/net/ipv4/udplite.c b/net/ipv4/udplite.c
index 39c7f17..3c94b8f 100644
--- a/net/ipv4/udplite.c
+++ b/net/ipv4/udplite.c
@@ -53,6 +53,7 @@ struct proto udplite_prot = {
.sendpage = udp_sendpage,
.hash = udp_lib_hash,
.unhash = udp_lib_unhash,
+ .rehash = udp_v4_rehash,
.get_port = udp_v4_get_port,
.memory_allocated = &udp_memory_allocated,
.sysctl_mem = sysctl_udp_mem,
--
1.8.3.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* [PATCH net 2/2] udp6: add missing rehash callback to udplite
2019-01-16 16:17 [PATCH net 1/2] udp: add missing rehash callback to udplite Alexey Kodanev
@ 2019-01-16 16:17 ` Alexey Kodanev
2019-01-16 16:34 ` Eric Dumazet
2019-01-17 23:03 ` David Miller
2019-01-16 16:33 ` [PATCH net 1/2] udp: " Eric Dumazet
2019-01-17 23:03 ` David Miller
2 siblings, 2 replies; 6+ messages in thread
From: Alexey Kodanev @ 2019-01-16 16:17 UTC (permalink / raw)
To: netdev; +Cc: Peter Oskolkov, Eric Dumazet, David Miller, Alexey Kodanev
After commit 23b0269e58ae ("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 719f835853a9
("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.
Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
---
net/ipv6/udp.c | 2 +-
net/ipv6/udp_impl.h | 1 +
net/ipv6/udplite.c | 1 +
3 files changed, 3 insertions(+), 1 deletion(-)
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index 7c35050..c9144bc 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -102,7 +102,7 @@ int udp_v6_get_port(struct sock *sk, unsigned short snum)
return udp_lib_get_port(sk, snum, hash2_nulladdr);
}
-static void udp_v6_rehash(struct sock *sk)
+void udp_v6_rehash(struct sock *sk)
{
u16 new_hash = ipv6_portaddr_hash(sock_net(sk),
&sk->sk_v6_rcv_saddr,
diff --git a/net/ipv6/udp_impl.h b/net/ipv6/udp_impl.h
index 5730e65..20e324b 100644
--- a/net/ipv6/udp_impl.h
+++ b/net/ipv6/udp_impl.h
@@ -13,6 +13,7 @@ int __udp6_lib_err(struct sk_buff *, struct inet6_skb_parm *, u8, u8, int,
__be32, struct udp_table *);
int udp_v6_get_port(struct sock *sk, unsigned short snum);
+void udp_v6_rehash(struct sock *sk);
int udpv6_getsockopt(struct sock *sk, int level, int optname,
char __user *optval, int __user *optlen);
diff --git a/net/ipv6/udplite.c b/net/ipv6/udplite.c
index a125aeb..f359078 100644
--- a/net/ipv6/udplite.c
+++ b/net/ipv6/udplite.c
@@ -49,6 +49,7 @@ struct proto udplitev6_prot = {
.recvmsg = udpv6_recvmsg,
.hash = udp_lib_hash,
.unhash = udp_lib_unhash,
+ .rehash = udp_v6_rehash,
.get_port = udp_v6_get_port,
.memory_allocated = &udp_memory_allocated,
.sysctl_mem = sysctl_udp_mem,
--
1.8.3.1
^ permalink raw reply related [flat|nested] 6+ messages in thread
* Re: [PATCH net 1/2] udp: add missing rehash callback to udplite
2019-01-16 16:17 [PATCH net 1/2] udp: add missing rehash callback to udplite Alexey Kodanev
2019-01-16 16:17 ` [PATCH net 2/2] udp6: " Alexey Kodanev
@ 2019-01-16 16:33 ` Eric Dumazet
2019-01-17 23:03 ` David Miller
2 siblings, 0 replies; 6+ messages in thread
From: Eric Dumazet @ 2019-01-16 16:33 UTC (permalink / raw)
To: Alexey Kodanev; +Cc: netdev, Peter Oskolkov, David Miller
On Wed, Jan 16, 2019 at 8:08 AM Alexey Kodanev
<alexey.kodanev@oracle.com> wrote:
>
> After commit 4cdeeee9252a ("net: udp: 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 719f835853a9
> ("udp: add rehash on connect()"). Moreover, __udp4_lib_lookup() now
> looks for a socket immediately in the secondary hash table.
>
> The issue was found with LTP/network tests (UDP-Lite test-cases).
>
> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Note that we prefer having the Fixes: tag to help automation.
Thanks !
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net 2/2] udp6: add missing rehash callback to udplite
2019-01-16 16:17 ` [PATCH net 2/2] udp6: " Alexey Kodanev
@ 2019-01-16 16:34 ` Eric Dumazet
2019-01-17 23:03 ` David Miller
1 sibling, 0 replies; 6+ messages in thread
From: Eric Dumazet @ 2019-01-16 16:34 UTC (permalink / raw)
To: Alexey Kodanev; +Cc: netdev, Peter Oskolkov, David Miller
On Wed, Jan 16, 2019 at 8:08 AM Alexey Kodanev
<alexey.kodanev@oracle.com> wrote:
>
> After commit 23b0269e58ae ("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 719f835853a9
> ("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.
>
> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Thanks for the fix !
Reviewed-by: Eric Dumazet <edumazet@google.com>
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net 1/2] udp: add missing rehash callback to udplite
2019-01-16 16:17 [PATCH net 1/2] udp: add missing rehash callback to udplite Alexey Kodanev
2019-01-16 16:17 ` [PATCH net 2/2] udp6: " Alexey Kodanev
2019-01-16 16:33 ` [PATCH net 1/2] udp: " Eric Dumazet
@ 2019-01-17 23:03 ` David Miller
2 siblings, 0 replies; 6+ messages in thread
From: David Miller @ 2019-01-17 23:03 UTC (permalink / raw)
To: alexey.kodanev; +Cc: netdev, posk, edumazet
From: Alexey Kodanev <alexey.kodanev@oracle.com>
Date: Wed, 16 Jan 2019 19:17:44 +0300
> After commit 4cdeeee9252a ("net: udp: 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 719f835853a9
> ("udp: add rehash on connect()"). Moreover, __udp4_lib_lookup() now
> looks for a socket immediately in the secondary hash table.
>
> The issue was found with LTP/network tests (UDP-Lite test-cases).
>
> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Applied with Fixes: tag added.
^ permalink raw reply [flat|nested] 6+ messages in thread
* Re: [PATCH net 2/2] udp6: add missing rehash callback to udplite
2019-01-16 16:17 ` [PATCH net 2/2] udp6: " Alexey Kodanev
2019-01-16 16:34 ` Eric Dumazet
@ 2019-01-17 23:03 ` David Miller
1 sibling, 0 replies; 6+ messages in thread
From: David Miller @ 2019-01-17 23:03 UTC (permalink / raw)
To: alexey.kodanev; +Cc: netdev, posk, edumazet
From: Alexey Kodanev <alexey.kodanev@oracle.com>
Date: Wed, 16 Jan 2019 19:17:45 +0300
> After commit 23b0269e58ae ("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 719f835853a9
> ("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.
>
> Signed-off-by: Alexey Kodanev <alexey.kodanev@oracle.com>
Applied with Fixes: tag added.
^ permalink raw reply [flat|nested] 6+ messages in thread
end of thread, other threads:[~2019-01-17 23:03 UTC | newest]
Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-01-16 16:17 [PATCH net 1/2] udp: add missing rehash callback to udplite Alexey Kodanev
2019-01-16 16:17 ` [PATCH net 2/2] udp6: " Alexey Kodanev
2019-01-16 16:34 ` Eric Dumazet
2019-01-17 23:03 ` David Miller
2019-01-16 16:33 ` [PATCH net 1/2] udp: " Eric Dumazet
2019-01-17 23:03 ` David Miller
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.