[PATCH net-next] net: diag: make udp_diag_destroy work for mapped addresses.

Subsystems: networking [general], the rest

STALE3687d

3 messages, 3 authors, 2016-09-07 · open the first message on its own page

[PATCH net-next] net: diag: make udp_diag_destroy work for mapped addresses.

From: Lorenzo Colitti <hidden>
Date: 2016-09-07 04:38:48

udp_diag_destroy does look up the IPv4 UDP hashtable for mapped
addresses, but it gets the IPv4 address to look up from the
beginning of the IPv6 address instead of the end.

Tested: https://android-review.googlesource.com/269874
Fixes: 5d77dca82839 ("net: diag: support SOCK_DESTROY for UDP sockets")
Signed-off-by: Lorenzo Colitti <redacted>
---
 net/ipv4/udp_diag.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/udp_diag.c b/net/ipv4/udp_diag.c
index 8a9f6e5..58b79c0 100644
--- a/net/ipv4/udp_diag.c
+++ b/net/ipv4/udp_diag.c
@@ -186,8 +186,8 @@ static int __udp_diag_destroy(struct sk_buff *in_skb,
 		if (ipv6_addr_v4mapped((struct in6_addr *)req->id.idiag_dst) &&
 		    ipv6_addr_v4mapped((struct in6_addr *)req->id.idiag_src))
 			sk = __udp4_lib_lookup(net,
-					req->id.idiag_dst[0], req->id.idiag_dport,
-					req->id.idiag_src[0], req->id.idiag_sport,
+					req->id.idiag_dst[3], req->id.idiag_dport,
+					req->id.idiag_src[3], req->id.idiag_sport,
 					req->id.idiag_if, tbl, NULL);
 
 		else
-- 
2.8.0.rc3.226.g39d4020

Re: [PATCH net-next] net: diag: make udp_diag_destroy work for mapped addresses.

From: Eric Dumazet <hidden>
Date: 2016-09-07 13:36:24

On Wed, 2016-09-07 at 13:38 +0900, Lorenzo Colitti wrote:
udp_diag_destroy does look up the IPv4 UDP hashtable for mapped
addresses, but it gets the IPv4 address to look up from the
beginning of the IPv6 address instead of the end.

Tested: https://android-review.googlesource.com/269874
Fixes: 5d77dca82839 ("net: diag: support SOCK_DESTROY for UDP sockets")
Signed-off-by: Lorenzo Colitti <redacted>
---
Acked-by: Eric Dumazet <redacted>

Re: [PATCH net-next] net: diag: make udp_diag_destroy work for mapped addresses.

From: David Ahern <hidden>
Date: 2016-09-07 14:32:47

On 9/6/16 10:38 PM, Lorenzo Colitti wrote:
udp_diag_destroy does look up the IPv4 UDP hashtable for mapped
addresses, but it gets the IPv4 address to look up from the
beginning of the IPv6 address instead of the end.

Tested: https://android-review.googlesource.com/269874
Fixes: 5d77dca82839 ("net: diag: support SOCK_DESTROY for UDP sockets")
Signed-off-by: Lorenzo Colitti <redacted>
---
 net/ipv4/udp_diag.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
Acked-by: David Ahern <redacted>
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help