Message ID | 1434089102-6732-1-git-send-email-chenweilong@huawei.com |
---|---|
State | Not Applicable, archived |
Delegated to: | David Miller |
Headers | show |
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index c8643a3..c604751 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -1661,6 +1661,17 @@ void rt6_redirect(const struct in6_addr *dest, const struct in6_addr *src, goto out; } +#ifdef CONFIG_IPV6_MULTIPLE_TABLES + if (rt == net->ipv6.ip6_blk_hole_entry || + rt == net->ipv6.ip6_prohibit_entry) { + if (net_ratelimit()) + printk(KERN_DEBUG "rt6_redirect: source isn't a valid" \ + " nexthop for redirect target " \ + "(blackhole or prohibited)\n"); + goto out; + } +#endif + /* * We have finally decided to accept it. */