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

staticd: fix missing static routes #16373

Merged
merged 1 commit into from
Jul 15, 2024

Conversation

anlancs
Copy link
Contributor

@anlancs anlancs commented Jul 12, 2024

Use vtysh with this input file:

ip route A nh1
ip route A nh2
ip route B nh1
ip route B nh2

When running "ip route B" with "nh1" and "nh2", the procedure maybe is:

  1. Create the two nexthops: "nh1" and "nh2".
  2. Register "nh1" with static_zebra_nht_register(), then the states of both
    "nh1" and "nht2" are set to "STATIC_SENT_TO_ZEBRA".
  3. Register "nh2" with static_zebra_nht_register(), then only the routes with
    nexthop of "STATIC_START" will be sent to zebra.

So, send the routes with the nexthop of "STATIC_SENT_TO_ZEBRA" to zebra.

Use `vtysh` with this input file:
```
ip route A nh1
ip route A nh2
ip route B nh1
ip route B nh2
```

When running "ip route B" with "nh1" and "nh2", the procedure maybe is:
1) Create the two nexthops: "nh1" and "nh2".
2) Register "nh1" with `static_zebra_nht_register()`, then the states of both
   "nh1" and "nht2" are set to "STATIC_SENT_TO_ZEBRA".
3) Register "nh2" with `static_zebra_nht_register()`, then only the routes with
   nexthop of "STATIC_START" will be sent to zebra.

So, send the routes with the nexthop of "STATIC_SENT_TO_ZEBRA" to zebra.

Signed-off-by: anlan_cs <vic.lan@pica8.com>
@anlancs anlancs force-pushed the zebra/fix-nexthop-synchronization branch from b5254f5 to 4518d38 Compare July 12, 2024 14:26
@anlancs anlancs changed the title zebra: fix missing static routes staticd: fix missing static routes Jul 13, 2024
@anlancs
Copy link
Contributor Author

anlancs commented Jul 15, 2024

vtysh -f this file:

ip route 9.5.0.0/16 44.1.1.1                                                        
ip route 9.5.0.0/16 88.1.1.1                                                        
ip route 9.3.0.0/16 44.1.1.1                                                        
ip route 9.3.0.0/16 88.1.1.1                                                        

Or devide it into two files:

ip route 9.5.0.0/16 44.1.1.1                                                        
ip route 9.5.0.0/16 88.1.1.1                                                        

And

ip route 9.3.0.0/16 44.1.1.1                                                        
ip route 9.3.0.0/16 88.1.1.1                                                        

Before:

S>* 9.3.0.0/16 [1/0] via 44.1.1.1, enp1s0, weight 1, 00:00:02                       
S>* 9.5.0.0/16 [1/0] via 88.1.1.1, enp3s0, weight 1, 00:00:05                       
  *                  via 44.1.1.1, enp1s0, weight 1, 00:00:05                       

After:

S>* 9.3.0.0/16 [1/0] via 88.1.1.1, enp3s0, weight 1, 00:41:41                       
  *                  via 44.1.1.1, enp1s0, weight 1, 00:41:41                       
S>* 9.5.0.0/16 [1/0] via 88.1.1.1, enp3s0, weight 1, 03:58:04                       
  *                  via 44.1.1.1, enp1s0, weight 1, 03:58:04                       

Copy link
Contributor

@mjstapp mjstapp left a comment

Choose a reason for hiding this comment

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

Thanks - looks good

@mjstapp
Copy link
Contributor

mjstapp commented Jul 15, 2024

https://github.com/Mergifyio backport dev/10.1 stable/10.0 stable/9.1 stable/9.0

Copy link

mergify bot commented Jul 15, 2024

backport dev/10.1 stable/10.0 stable/9.1 stable/9.0

✅ Backports have been created

@Jafaral Jafaral merged commit 74e720c into FRRouting:master Jul 15, 2024
11 checks passed
mjstapp added a commit that referenced this pull request Jul 16, 2024
staticd: fix missing static routes (backport #16373)
mjstapp added a commit that referenced this pull request Jul 16, 2024
mjstapp added a commit that referenced this pull request Jul 16, 2024
Jafaral added a commit that referenced this pull request Jul 16, 2024
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