Home Home > GIT Browse > openSUSE-15.0
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJiri Slaby <jslaby@suse.cz>2019-07-18 08:26:13 +0200
committerJiri Slaby <jslaby@suse.cz>2019-07-18 09:30:37 +0200
commit9d4c0cda8b8d6bd3d3f3171993b21f985d6b005f (patch)
tree75805cb739f8915ed010132155a16838c2c1883b
parent65ef679045a90f89fadb3588b05d10d3fd74d23b (diff)
ipv6: fix EFAULT on sendto with icmpv6 and hdrincl
(networking-stable-19_06_09). suse-commit: 07894ad6aec7c0480055b2f47f907233f3dc996c
-rw-r--r--net/ipv6/raw.c13
1 files changed, 8 insertions, 5 deletions
diff --git a/net/ipv6/raw.c b/net/ipv6/raw.c
index d3eeffea5e31..581d4535097e 100644
--- a/net/ipv6/raw.c
+++ b/net/ipv6/raw.c
@@ -894,11 +894,14 @@ static int rawv6_sendmsg(struct sock *sk, struct msghdr *msg, size_t len)
opt = ipv6_fixup_options(&opt_space, opt);
fl6.flowi6_proto = proto;
- rfv.msg = msg;
- rfv.hlen = 0;
- err = rawv6_probe_proto_opt(&rfv, &fl6);
- if (err)
- goto out;
+
+ if (!hdrincl) {
+ rfv.msg = msg;
+ rfv.hlen = 0;
+ err = rawv6_probe_proto_opt(&rfv, &fl6);
+ if (err)
+ goto out;
+ }
if (!ipv6_addr_any(daddr))
fl6.daddr = *daddr;