summaryrefslogtreecommitdiffstats
path: root/net/ipv6
diff options
context:
space:
mode:
authorSabrina Dubroca <sd@queasysnail.net>2014-03-06 17:51:57 +0100
committerBen Hutchings <ben@decadent.org.uk>2014-04-30 16:23:18 +0100
commit5aa3bcddc8ddc4a8c09541d4b608bfa765631a6d (patch)
tree86b4a1810a21df7790ca8a341351880a8a7b4193 /net/ipv6
parentb2d56d0f73e93d78a9983d1c4dc512a68f63ab98 (diff)
downloadlinux-stable-5aa3bcddc8ddc4a8c09541d4b608bfa765631a6d.tar.gz
linux-stable-5aa3bcddc8ddc4a8c09541d4b608bfa765631a6d.tar.bz2
linux-stable-5aa3bcddc8ddc4a8c09541d4b608bfa765631a6d.zip
ipv6: don't set DST_NOCOUNT for remotely added routes
commit c88507fbad8055297c1d1e21e599f46960cbee39 upstream. DST_NOCOUNT should only be used if an authorized user adds routes locally. In case of routes which are added on behalf of router advertisments this flag must not get used as it allows an unlimited number of routes getting added remotely. Signed-off-by: Sabrina Dubroca <sd@queasysnail.net> Acked-by: Hannes Frederic Sowa <hannes@stressinduktion.org> Signed-off-by: David S. Miller <davem@davemloft.net> [bwh: Backported to 3.2: adjust context] Acked-by: David S. Miller <davem@davemloft.net> Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
Diffstat (limited to 'net/ipv6')
-rw-r--r--net/ipv6/route.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c
index 9a4f4377ce92..39e11f923a73 100644
--- a/net/ipv6/route.c
+++ b/net/ipv6/route.c
@@ -1250,7 +1250,7 @@ int ip6_route_add(struct fib6_config *cfg)
goto out;
}
- rt = ip6_dst_alloc(&net->ipv6.ip6_dst_ops, NULL, DST_NOCOUNT);
+ rt = ip6_dst_alloc(&net->ipv6.ip6_dst_ops, NULL, (cfg->fc_flags & RTF_ADDRCONF) ? 0 : DST_NOCOUNT);
if (rt == NULL) {
err = -ENOMEM;