linux-cp: handle ipv4 routes when link goes down on subif 32/35532/6
authorAlexander Chernavin <[email protected]>
Mon, 14 Feb 2022 12:59:28 +0000 (12:59 +0000)
committerMatthew Smith <[email protected]>
Tue, 29 Mar 2022 13:31:02 +0000 (13:31 +0000)
commit851215a04ff53df2eb153133e3f47f514facde3a
tree33a92330d070d9f7319ecdc66f5a67acf838b5a8
parent1c5b127d2247b68f362b3caac8ff229406fab4d0
linux-cp: handle ipv4 routes when link goes down on subif

Type: improvement

Currently, the plugin can monitor link state changes on hardware
interfaces for which a linux-cp pair exists. When the link goes down on
one of the hardware interfaces, the plugin processes IPv4 routes that
resolve through that interface according to the configurations:
del-static-on-link-down and del-dynamic-on-link-down.

The problem is that link state changes are not signaled for
subinterfaces and the code that handles IPv4 routes is not triggered.
When the link on a hardware interface goes down, it implies
that subinterfaces added to that interface also will have the link in
the down state.

With this change, when the link goes down on a hardware interface,
iterate over subinterfaces added to the interface and apply the same
logic of routes processing as for hardware interfaces.

Signed-off-by: Alexander Chernavin <[email protected]>
Change-Id: I97337d2e328437c73f2d99a00737768778f197a1
src/plugins/linux-cp/lcp_router.c