]> pilppa.org Git - linux-2.6-omap-h63xx.git/blobdiff - net/ipv6/ip6_output.c
Merge master.kernel.org:/pub/scm/linux/kernel/git/davej/cpufreq
[linux-2.6-omap-h63xx.git] / net / ipv6 / ip6_output.c
index 0f56e9e69a8f984804e6ab85ec1e6789ce7a64e4..66716911962eb967aa487b964895548c3542ea8c 100644 (file)
@@ -345,6 +345,16 @@ static int ip6_forward_proxy_check(struct sk_buff *skb)
                }
        }
 
+       /*
+        * The proxying router can't forward traffic sent to a link-local
+        * address, so signal the sender and discard the packet. This
+        * behavior is clarified by the MIPv6 specification.
+        */
+       if (ipv6_addr_type(&hdr->daddr) & IPV6_ADDR_LINKLOCAL) {
+               dst_link_failure(skb);
+               return -1;
+       }
+
        return 0;
 }
 
@@ -402,9 +412,16 @@ int ip6_forward(struct sk_buff *skb)
                return -ETIMEDOUT;
        }
 
-       if (pneigh_lookup(&nd_tbl, &hdr->daddr, skb->dev, 0)) {
-               if (ip6_forward_proxy_check(skb))
+       /* XXX: idev->cnf.proxy_ndp? */
+       if (ipv6_devconf.proxy_ndp &&
+           pneigh_lookup(&nd_tbl, &hdr->daddr, skb->dev, 0)) {
+               int proxied = ip6_forward_proxy_check(skb);
+               if (proxied > 0)
                        return ip6_input(skb);
+               else if (proxied < 0) {
+                       IP6_INC_STATS(IPSTATS_MIB_INDISCARDS);
+                       goto drop;
+               }
        }
 
        if (!xfrm6_route_forward(skb)) {