Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

zebra: fix wrong linkdown flag #17403

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

anlancs
Copy link
Contributor

@anlancs anlancs commented Nov 10, 2024

Add this one line command to one down interface (mask is 192.168.0.0/24):

ip link set dev enp2s0 up;ip route add 3.3.3.3/32 via 192.168.0.1 dev enp2s0 proto kernel onlink

Before:

K>* 3.3.3.3/32 [0/0] via 192.168.0.1, enp2s0 onlink linkdown, weight 1, 00:00:02

After:

K>* 3.3.3.3/32 [0/0] via 192.168.0.1, enp2s0 onlink, weight 1, 00:00:02

It's only display problem, just correct this linkdown flag.

Add this one line command to one down interface (mask is 192.168.0.0/24):
```
ip link set dev enp2s0 up;ip route add 3.3.3.3/32 via 192.168.0.1 dev enp2s0 proto kernel onlink
```

Before:
```
K>* 3.3.3.3/32 [0/0] via 192.168.0.1, enp2s0 onlink linkdown, weight 1, 00:00:02
```

After:
```
K>* 3.3.3.3/32 [0/0] via 192.168.0.1, enp2s0 onlink, weight 1, 00:00:02
```

It's only display problem, just correct this linkdown flag.

Signed-off-by: anlan_cs <anlan_cs@126.com>
@ton31337
Copy link
Member

@Mergifyio backport stable/10.2 stable/10.1 stable/10.0 stable/9.1 stable/9.0

Copy link

mergify bot commented Nov 10, 2024

backport stable/10.2 stable/10.1 stable/10.0 stable/9.1 stable/9.0

🟠 Waiting for conditions to match

  • merged [📌 backport requirement]

@ton31337 ton31337 added this to the 10.2 milestone Nov 10, 2024
Copy link
Member

@donaldsharp donaldsharp left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why is this not being set on link up?

@anlancs
Copy link
Contributor Author

anlancs commented Nov 12, 2024

Why is this not being set on link up?

It is the time issue. If with two commands in two lines, there is no this issue. Now they are combined into one line, so the UP message of netlink comes later. @donaldsharp

@donaldsharp
Copy link
Member

I am not seeing this problem:

sharpd@eva ~/f/t/t/bgp_bmp (master)> sudo vtysh -c "show ip route kernel"
Codes: K - kernel route, C - connected, L - local, S - static,
       R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric, t - Table-Direct,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

K>* 0.0.0.0/0 [0/100] via 192.168.119.1, enp13s0, weight 1, 03:34:37
K>* 169.254.0.0/16 [0/1000] is directly connected, virbr2 linkdown, weight 1, 04:22:24
sharpd@eva ~/f/t/t/bgp_bmp (master)> sudo ip link set dev dummy1 up; sudo ip route add 3.3.3.3/32 via 192.168.0.1 dev dummy1 proto kernel onlink
sharpd@eva ~/f/t/t/bgp_bmp (master)> sudo vtysh -c "show ip route kernel"
Codes: K - kernel route, C - connected, L - local, S - static,
       R - RIP, O - OSPF, I - IS-IS, B - BGP, E - EIGRP, N - NHRP,
       T - Table, v - VNC, V - VNC-Direct, A - Babel, D - SHARP,
       F - PBR, f - OpenFabric, t - Table-Direct,
       > - selected route, * - FIB route, q - queued, r - rejected, b - backup
       t - trapped, o - offload failure

K>* 0.0.0.0/0 [0/100] via 192.168.119.1, enp13s0, weight 1, 03:34:48
K>* 3.3.3.3/32 [0/0] via 192.168.0.1, dummy1 onlink, weight 1, 00:00:02
K>* 169.254.0.0/16 [0/1000] is directly connected, virbr2 linkdown, weight 1, 04:22:35
sharpd@eva ~/f/t/t/bgp_bmp (master)> 

How exactly do you reproduce?

@anlancs
Copy link
Contributor Author

anlancs commented Nov 15, 2024

@donaldsharp Use the REAL interface, try your enp13s0?

@donaldsharp
Copy link
Member

if the up comes later we should scan the kernel routes and set the flag there. Hence this is the wrong spot to do the work.

@anlancs
Copy link
Contributor Author

anlancs commented Nov 22, 2024

imo just check this UP interface at this spot is enough, can't find a better spot… @donaldsharp

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants