Skip to content

Commit 58e3bdd

Browse files
idoschdavem330
authored andcommitted
ipv4: fib: Only flush FIB aliases belonging to currently flushed table
In case the MAIN table is flushed and its trie is shared with the LOCAL table, then we might be flushing FIB aliases belonging to the latter. This can lead to FIB_ENTRY_DEL notifications sent with the wrong table ID. The above doesn't affect current listeners, as the table ID is ignored during entry deletion, but this will change later in the patchset. When flushing a particular table, skip any aliases belonging to a different one. Signed-off-by: Ido Schimmel <[email protected]> Signed-off-by: Jiri Pirko <[email protected]> CC: Alexander Duyck <[email protected]> CC: Patrick McHardy <[email protected]> Reviewed-by: Alexander Duyck <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent a507c34 commit 58e3bdd

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

net/ipv4/fib_trie.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1963,7 +1963,8 @@ int fib_table_flush(struct net *net, struct fib_table *tb)
19631963
hlist_for_each_entry_safe(fa, tmp, &n->leaf, fa_list) {
19641964
struct fib_info *fi = fa->fa_info;
19651965

1966-
if (!fi || !(fi->fib_flags & RTNH_F_DEAD)) {
1966+
if (!fi || !(fi->fib_flags & RTNH_F_DEAD) ||
1967+
tb->tb_id != fa->tb_id) {
19671968
slen = fa->fa_slen;
19681969
continue;
19691970
}

0 commit comments

Comments
 (0)