summaryrefslogtreecommitdiffstats
path: root/net/ipv6/udp.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2017-02-17 01:34:01 +0100
committerDavid S. Miller <davem@davemloft.net>2017-02-17 01:34:01 +0100
commit3f64116a838e6c3468f9d5eed7f1f87cf3a2c3eb (patch)
tree388024d2ddbdcb9991ef4b472dfac31e425b807e /net/ipv6/udp.c
parentcxgb4: Remove redundant code in t4_uld_clean_up() (diff)
parentMerge tag 'media/v4.10-5' of git://git.kernel.org/pub/scm/linux/kernel/git/mc... (diff)
downloadlinux-3f64116a838e6c3468f9d5eed7f1f87cf3a2c3eb.tar.xz
linux-3f64116a838e6c3468f9d5eed7f1f87cf3a2c3eb.zip
Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
Diffstat (limited to 'net/ipv6/udp.c')
-rw-r--r--net/ipv6/udp.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/net/ipv6/udp.c b/net/ipv6/udp.c
index df71ba05f41d..4e4c401e3bc6 100644
--- a/net/ipv6/udp.c
+++ b/net/ipv6/udp.c
@@ -1046,6 +1046,10 @@ int udpv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
if (addr_len < SIN6_LEN_RFC2133)
return -EINVAL;
daddr = &sin6->sin6_addr;
+ if (ipv6_addr_any(daddr) &&
+ ipv6_addr_v4mapped(&np->saddr))
+ ipv6_addr_set_v4mapped(htonl(INADDR_LOOPBACK),
+ daddr);
break;
case AF_INET:
goto do_udp_sendmsg;