diff options
Diffstat (limited to 'net')
-rw-r--r-- | net/ipv6/ip6_output.c | 13 |
1 files changed, 10 insertions, 3 deletions
diff --git a/net/ipv6/ip6_output.c b/net/ipv6/ip6_output.c index f508171bab73..4704b5fc3085 100644 --- a/net/ipv6/ip6_output.c +++ b/net/ipv6/ip6_output.c | |||
@@ -463,10 +463,17 @@ int ip6_forward(struct sk_buff *skb) | |||
463 | */ | 463 | */ |
464 | if (xrlim_allow(dst, 1*HZ)) | 464 | if (xrlim_allow(dst, 1*HZ)) |
465 | ndisc_send_redirect(skb, n, target); | 465 | ndisc_send_redirect(skb, n, target); |
466 | } else if (ipv6_addr_type(&hdr->saddr)&(IPV6_ADDR_MULTICAST|IPV6_ADDR_LOOPBACK | 466 | } else { |
467 | |IPV6_ADDR_LINKLOCAL)) { | 467 | int addrtype = ipv6_addr_type(&hdr->saddr); |
468 | |||
468 | /* This check is security critical. */ | 469 | /* This check is security critical. */ |
469 | goto error; | 470 | if (addrtype & (IPV6_ADDR_MULTICAST|IPV6_ADDR_LOOPBACK)) |
471 | goto error; | ||
472 | if (addrtype & IPV6_ADDR_LINKLOCAL) { | ||
473 | icmpv6_send(skb, ICMPV6_DEST_UNREACH, | ||
474 | ICMPV6_NOT_NEIGHBOUR, 0, skb->dev); | ||
475 | goto error; | ||
476 | } | ||
470 | } | 477 | } |
471 | 478 | ||
472 | if (skb->len > dst_mtu(dst)) { | 479 | if (skb->len > dst_mtu(dst)) { |