From 61f94f95f8ed9e3a5e9d9c64687e869d7a9830b5 Mon Sep 17 00:00:00 2001 From: David L Stevens Date: Wed, 9 May 2007 13:53:44 -0700 Subject: [PATCH] --- yaml --- r: 55960 b: refs/heads/master c: 5bb1ab09e4f6287c0b6c9cdbd463147cbd003f54 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/net/ipv6/ip6_output.c | 13 ++++++++++--- 2 files changed, 11 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index c991bb3dbbf4..185e31412408 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: ac40e41f4ddec8882d3f7bc8fa98a4fce8796aff +refs/heads/master: 5bb1ab09e4f6287c0b6c9cdbd463147cbd003f54 diff --git a/trunk/net/ipv6/ip6_output.c b/trunk/net/ipv6/ip6_output.c index f508171bab73..4704b5fc3085 100644 --- a/trunk/net/ipv6/ip6_output.c +++ b/trunk/net/ipv6/ip6_output.c @@ -463,10 +463,17 @@ int ip6_forward(struct sk_buff *skb) */ if (xrlim_allow(dst, 1*HZ)) ndisc_send_redirect(skb, n, target); - } else if (ipv6_addr_type(&hdr->saddr)&(IPV6_ADDR_MULTICAST|IPV6_ADDR_LOOPBACK - |IPV6_ADDR_LINKLOCAL)) { + } else { + int addrtype = ipv6_addr_type(&hdr->saddr); + /* This check is security critical. */ - goto error; + if (addrtype & (IPV6_ADDR_MULTICAST|IPV6_ADDR_LOOPBACK)) + goto error; + if (addrtype & IPV6_ADDR_LINKLOCAL) { + icmpv6_send(skb, ICMPV6_DEST_UNREACH, + ICMPV6_NOT_NEIGHBOUR, 0, skb->dev); + goto error; + } } if (skb->len > dst_mtu(dst)) {