ipv4: fib: Send deletion notification with actual FIB alias type
authorIdo Schimmel <idosch@mellanox.com>
Thu, 9 Feb 2017 09:28:39 +0000 (10:28 +0100)
committerDavid S. Miller <davem@davemloft.net>
Fri, 10 Feb 2017 16:32:12 +0000 (11:32 -0500)
When a FIB alias is removed, a notification is sent using the type
passed from user space - can be RTN_UNSPEC - instead of the actual type
of the removed alias. This is problematic for listeners of the FIB
notification chain, as several FIB aliases can exist with matching
parameters, but the type.

Solve this by passing the actual type of the removed FIB alias.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
CC: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/fib_trie.c

index 5ef4596d7afcd28fc1c7b0d4f1e820cd65190586..b0bfb1cc791aa3026241cadcdb1edfae97122650 100644 (file)
@@ -1653,8 +1653,8 @@ int fib_table_delete(struct net *net, struct fib_table *tb,
                return -ESRCH;
 
        call_fib_entry_notifiers(net, FIB_EVENT_ENTRY_DEL, key, plen,
-                                fa_to_delete->fa_info, tos, cfg->fc_type,
-                                tb->tb_id, 0);
+                                fa_to_delete->fa_info, tos,
+                                fa_to_delete->fa_type, tb->tb_id, 0);
        rtmsg_fib(RTM_DELROUTE, htonl(key), fa_to_delete, plen, tb->tb_id,
                  &cfg->fc_nlinfo, 0);