]> git.baikalelectronics.ru Git - kernel.git/commit
ipv4: Replace route in list before notifying
authorIdo Schimmel <idosch@mellanox.com>
Tue, 14 Jan 2020 11:23:09 +0000 (13:23 +0200)
committerDavid S. Miller <davem@davemloft.net>
Wed, 15 Jan 2020 02:53:35 +0000 (18:53 -0800)
commitf55ce76b3094115472ebf46fae21c7aad1c5eedc
tree7d26791a03f990af174053d672cc66bc431697ed
parent47d34b103f4d805742f612c4a7741796cf69f223
ipv4: Replace route in list before notifying

Subsequent patches will add an offload / trap indication to routes which
will signal if the route is present in hardware or not.

After programming the route to the hardware, drivers will have to ask
the IPv4 code to set the flags by passing the route's key.

In the case of route replace, the new route is notified before it is
actually inserted into the FIB alias list. This can prevent simple
drivers (e.g., netdevsim) that program the route to the hardware in the
same context it is notified in from being able to set the flag.

Solve this by first inserting the new route to the list and rollback the
operation in case the route was vetoed.

Signed-off-by: Ido Schimmel <idosch@mellanox.com>
Reviewed-by: Jiri Pirko <jiri@mellanox.com>
Reviewed-by: David Ahern <dsahern@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/fib_trie.c