Commit 58e3bdd5 authored by Ido Schimmel's avatar Ido Schimmel Committed by David S. Miller

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: default avatarIdo Schimmel <idosch@mellanox.com>
Signed-off-by: default avatarJiri Pirko <jiri@mellanox.com>
CC: Alexander Duyck <alexander.h.duyck@intel.com>
CC: Patrick McHardy <kaber@trash.net>
Reviewed-by: default avatarAlexander Duyck <alexander.h.duyck@intel.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a507c346
...@@ -1963,7 +1963,8 @@ int fib_table_flush(struct net *net, struct fib_table *tb) ...@@ -1963,7 +1963,8 @@ int fib_table_flush(struct net *net, struct fib_table *tb)
hlist_for_each_entry_safe(fa, tmp, &n->leaf, fa_list) { hlist_for_each_entry_safe(fa, tmp, &n->leaf, fa_list) {
struct fib_info *fi = fa->fa_info; struct fib_info *fi = fa->fa_info;
if (!fi || !(fi->fib_flags & RTNH_F_DEAD)) { if (!fi || !(fi->fib_flags & RTNH_F_DEAD) ||
tb->tb_id != fa->tb_id) {
slen = fa->fa_slen; slen = fa->fa_slen;
continue; continue;
} }
......
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