fib: support "midchain delegate" removal 92/36892/2
authorAlexander Chernavin <[email protected]>
Fri, 12 Aug 2022 13:19:49 +0000 (13:19 +0000)
committerNeale Ranns <[email protected]>
Wed, 17 Aug 2022 01:53:29 +0000 (01:53 +0000)
commitd5e4e25849be4e58420de5c0d02ab4e244f334b6
tree20343bac8ab01e7f22da246696e65400c78f38fb
parentc7f93b321d02c532f612587f939f8188526139ac
fib: support "midchain delegate" removal

Type: improvement

Currently, once an adjacency is stacked on a FIB entry via
adj_midchain_delegate_stack(), "midchain delegate" is created for the
adjacency and the FIB index is stored there. And all further calls to
adj_midchain_delegate_stack() even passing another FIB index will cause
the function to still use the stored one. In other words, there is
currently no way to stack an adjacency on another FIB index if "midchain
delegate" already exists for it.

Being able to stack on another FIB index is needed for the wireguard
plugin. As per the protocol, peers can roam between different external
endpoints. When an authenticated packet is received and it was sent from
a different endpoint than currently stored, the endpoint needs to be
updated and all futher communication needs to happen with that endpoint.
Thus, the corresponding to that peer adjacencies need to be stacked on
the FIB entry that corresponds to the new endpoint.

With this change, add adj_midchain_delegate_remove() that removes
"midchain delegate". When stacking on another FIB entry is needed,
existing "midchain delegate" can be removed and then, a new one created
with a new FIB index via adj_midchain_delegate_stack().

Signed-off-by: Alexander Chernavin <[email protected]>
Change-Id: Ibc1c99b248a5ef8ef64867f39f494fab627a1741
src/vnet/adj/adj_midchain.h
src/vnet/adj/adj_midchain_delegate.c