summaryrefslogtreecommitdiffstats
path: root/net/ipv4/udp_diag.c
diff options
context:
space:
mode:
authorLorenzo Colitti <lorenzo@google.com>2016-09-07 06:38:35 +0200
committerDavid S. Miller <davem@davemloft.net>2016-09-08 02:31:30 +0200
commitf95bf346226b9b79352e05508beececc807cc37a (patch)
tree38a250371a5277987b81069b88d4509067733ab5 /net/ipv4/udp_diag.c
parentnetlink: don't forget to release a rhashtable_iter structure (diff)
downloadlinux-f95bf346226b9b79352e05508beececc807cc37a.tar.xz
linux-f95bf346226b9b79352e05508beececc807cc37a.zip
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") Signed-off-by: Lorenzo Colitti <lorenzo@google.com> Acked-by: Eric Dumazet <edumazet@google.com> Acked-by: David Ahern <dsa@cumulusnetworks.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/udp_diag.c')
-rw-r--r--net/ipv4/udp_diag.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/udp_diag.c b/net/ipv4/udp_diag.c
index 8a9f6e535caa..58b79c0c0d69 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