linux-cp: reflect hw link state on tap on pair creation 28/35528/2
authorAlexander Chernavin <[email protected]>
Fri, 4 Feb 2022 10:15:31 +0000 (10:15 +0000)
committerMatthew Smith <[email protected]>
Thu, 3 Mar 2022 13:44:19 +0000 (13:44 +0000)
commitadac308aa8033de28ec9e627af2ed517f37aba6a
tree7eed0d3956802fb567c0410d449cfb1fea8dbbdb
parent53f8a272a63444b61b700690a2f438fa5066f37b
linux-cp: reflect hw link state on tap on pair creation

Type: fix

Currently, a tap interface created to be a member of a linux-cp pair has
default link state (down) and default link speed (10Mb/s). Then the
plugin monitors the link state of the paired hardware interface and if
it changes, the new link state is reflected on the tap interface. And
when the new link state is "up", the link speed is also reflected on the
tap interface.

The problem is that this scheme implies that the hardware interface's
link state is "down" at the moment of the linux-cp pair creation and
then changes. But there are cases when the link state is already "up" at
that moment. If that is the case, the link speed on the tap interface
will remain the default one until the link comes down and then comes up.

With this fix, when a linux-cp pair is created, reflect current link
state of the hardware interface being paired on the created tap
interface.

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