Skip to content

Commit

Permalink
ipv6: don't set DST_NOCOUNT for remotely added routes
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sabrina Dubroca authored and David S. Miller committed Mar 6, 2014
1 parent 9798935 commit c88507f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/ipv6/route.c
Original file line number Diff line number Diff line change
Expand Up @@ -1513,7 +1513,7 @@ int ip6_route_add(struct fib6_config *cfg)
if (!table)
goto out;

rt = ip6_dst_alloc(net, NULL, DST_NOCOUNT, table);
rt = ip6_dst_alloc(net, NULL, (cfg->fc_flags & RTF_ADDRCONF) ? 0 : DST_NOCOUNT, table);

if (!rt) {
err = -ENOMEM;
Expand Down

0 comments on commit c88507f

Please sign in to comment.