Commit 50fb0faf authored by Sabrina Dubroca's avatar Sabrina Dubroca Committed by Jiri Slaby

ipv6: don't set DST_NOCOUNT for remotely added routes

[ Upstream commit c88507fb ]

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: default avatarSabrina Dubroca <sd@queasysnail.net>
Acked-by: default avatarHannes Frederic Sowa <hannes@stressinduktion.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarJiri Slaby <jslaby@suse.cz>
parent 38de8fd0
......@@ -1500,7 +1500,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;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment