Page MenuHomeVyOS Platform

vyos-netlinkd: DHCP client on a QinQ interface (vif-s/vif-c) is not restarted after link down/up
Open, NormalPublicBUG

Description

On a QinQ interface with address dhcp (e.g. interfaces ethernet eth1 vif-s 40 vif-c 41 address dhcp), a link down/up of the interface (ip link set dev eth1.40.41 down, 5 s, up) stops dhclient@eth1.40.41 and never starts it again: the interface keeps no address and the DHCP client stays inactive until a commit or reboot. 1.5.1 restarts the client and the address returns.

Rolling, after the down/up:

verdict=NOT-RETURNED  eth1.40.41 address: none (want yes)  dhclient@eth1.40.41: inactive (want active)  ping over the QinQ link: FAIL

1.5.1: verdict=RETURNED, no difference from the pre-event state.

Cause (code reading)
src/services/vyos-netlinkd, UP branch: interface_path = Section.get_config_path(ifname, delimiter='.') gives a hyphenated path such as ethernet.eth1.vif-s.40.vif-c.41, but the config dict is read with key_mangling=('-', '_'), so its keys are vif_s / vif_c. dict_search(f'{interface_path}.address', config_dict) never matches for a QinQ interface, so the DHCP client is not restarted. The DOWN branch stops the client by unit name without a lookup, so the stop works and the restart does not. (Plain vif interfaces have no hyphen in the path; expected unaffected, not measured.)

Suggested fix
Mangle the path the same way as the dict (replace - with _ in interface_path), or read the config dict without key mangling for this lookup.

Details

Version
rolling, 1.5
Is it a breaking change?
Unspecified (possibly destroys the router)
Issue type
Bug (incorrect behavior)