Skip to content

Commit c2ed188

Browse files
grawitydavem330
authored andcommitted
net: ipv6: check route protocol when deleting routes
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>
1 parent c762eaa commit c2ed188

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

net/ipv6/route.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2174,6 +2174,8 @@ static int ip6_route_del(struct fib6_config *cfg)
21742174
continue;
21752175
if (cfg->fc_metric && cfg->fc_metric != rt->rt6i_metric)
21762176
continue;
2177+
if (cfg->fc_protocol && cfg->fc_protocol != rt->rt6i_protocol)
2178+
continue;
21772179
dst_hold(&rt->dst);
21782180
read_unlock_bh(&table->tb6_lock);
21792181

0 commit comments

Comments
 (0)