From: Lorenzo Colitti Date: Wed, 7 Sep 2016 04:38:35 +0000 (+0900) Subject: net: diag: make udp_diag_destroy work for mapped addresses. X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=513e28e1983a31c52f30b4ca1b1e69e4c25b71fe;p=GitHub%2Fexynos8895%2Fandroid_kernel_samsung_universal8895.git 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. [cherry-pick of net-next f95bf346226b9b79352e05508beececc807cc37a] Change-Id: Ia369482c4645bcade320b2c33a763f1ce4378ff1 Tested: https://android-review.googlesource.com/269874 Fixes: 5d77dca82839 ("net: diag: support SOCK_DESTROY for UDP sockets") Signed-off-by: Lorenzo Colitti Acked-by: Eric Dumazet Acked-by: David Ahern Signed-off-by: David S. Miller --- diff --git a/net/ipv4/udp_diag.c b/net/ipv4/udp_diag.c index 8b9570c84fd5..39e0b8347bd2 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); else