vpp
vpp copied to clipboard
fib: fib_entry_flags_update wrong behavior
The function is called in fib_entry_src_action_path_add, fib_entry_src_action_path_remove and fib_entry_src_action_path_swap and works on route paths (rpaths) that are provided to these functions.
There are 2 problems with this function:
- The function works on a per route path basis. In the loop over rpaths, if path is attached it sets the
ATTACHEDflag and if it is not removes it without considering previous paths. - I believe that the function should be called after these functions are done and work on final path-set. For example in
fib_entry_src_action_path_removethe rpaths are the paths that are to be removed and we should not set flags based on them.
For a detailed example, adding a non-attached could clear ATTACHED flag even when existing attached paths still contributes. Also
removing a attached path, does not clear the ATTACHED flag and cause a stale flag to be set.