From: Sabrina Dubroca Date: Thu, 6 Mar 2014 16:51:57 +0000 (+0100) Subject: ipv6: don't set DST_NOCOUNT for remotely added routes X-Git-Tag: v3.2.58~76 X-Git-Url: https://git.fsl.cs.sunysb.edu/?a=commitdiff_plain;h=5aa3bcddc8ddc4a8c09541d4b608bfa765631a6d;p=unionfs-2.6.39.y.git 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 Acked-by: Hannes Frederic Sowa Signed-off-by: David S. Miller [bwh: Backported to 3.2: adjust context] Acked-by: David S. Miller Signed-off-by: Ben Hutchings --- diff --git a/net/ipv6/route.c b/net/ipv6/route.c index 9a4f4377ce9..39e11f923a7 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;