Skip to contentSkip to conversation

net: diag: make udp_diag_destroy work for mapped addresses.

PATCH In review Lorenzo Colitti 3 participants 3 messages Sep 7, 2016

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 net: diag: make udp_diag_destroy work for mapped addresses.

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")
---
 net/ipv4/udp_diag.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
net/ipv4/udp_diag.c +2 -2
index 8a9f6e5..58b79c0 100644
@@ -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
Signature · 1 line
2.8.0.rc3.226.g39d4020
Acked-by on v1 1/1
#2 lore raw
In reply to Lorenzo Colitti
Quoted 10 lines · Lorenzo Colitti

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")
---
 net/ipv4/udp_diag.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)