Skip to content

Commit f00f18e

Browse files
grawitygregkh
authored andcommitted
net: ipv6: check route protocol when deleting routes
commit c2ed1880fd61a998e3ce40254a99a2ad000f1a7d upstream. The protocol field is checked when deleting IPv4 routes, but ignored for IPv6, which causes problems with routing daemons accidentally deleting externally set routes (observed by multiple bird6 users). This can be verified using `ip -6 route del <prefix> proto something`. Signed-off-by: Mantas Mikulėnas <grawity@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net> Cc: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent 990a142 commit f00f18e

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

net/ipv6/route.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2084,6 +2084,8 @@ static int ip6_route_del(struct fib6_config *cfg)
20842084
continue;
20852085
if (cfg->fc_metric && cfg->fc_metric != rt->rt6i_metric)
20862086
continue;
2087+
if (cfg->fc_protocol && cfg->fc_protocol != rt->rt6i_protocol)
2088+
continue;
20872089
dst_hold(&rt->dst);
20882090
read_unlock_bh(&table->tb6_lock);
20892091

0 commit comments

Comments
 (0)