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: Use resolved next-hops for redistributed routes to the clients #15948

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

ton31337
Copy link
Member

@ton31337 ton31337 commented May 7, 2024

No description provided.

E.g. using this configuration:

```
router ospf
 redistribute bgp route-map red
!
route-map red permit 10
 match interface eth0
```

And having a recursive route (iBGP), `match interface` won't work because
the interface's ifindex is not valid.

Signed-off-by: Donatas Abraitis <[email protected]>
By using `match interface`.

Signed-off-by: Donatas Abraitis <[email protected]>
@frrbot frrbot bot added tests Topotests, make check, etc zebra labels May 7, 2024
@@ -563,6 +563,9 @@ int zsend_redistribute_route(int cmd, struct zserv *client,

for (nexthop = re->nhe->nhg.nexthop;
nexthop; nexthop = nexthop->next) {
if (CHECK_FLAG(nexthop->flags, NEXTHOP_FLAG_RECURSIVE))
Copy link
Member

Choose a reason for hiding this comment

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

This is not quite correct as that nexthops are stored as ->next points to the next in the original chain of nexthops. while ->resolved points to the resolved ones. As I am reading this we are only sending the ->next nexthops. We should be sending just the list of resolved nexthops up to the requestor. This can be a combination of both ->next and ->resolved. Imagine we have this

nh A
resolved to B
resolved to C
nh D
resolved to E
resolved to F

This code as I read it would just send B and C, We need to send B,C,E and F.

Copy link
Member

Choose a reason for hiding this comment

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

Currently we send A and D without this change correct?

Copy link
Member Author

Choose a reason for hiding this comment

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

With and without the patch the RIB, OSPF database look the same

leaf2# show ip route 10.10.10.10/32 longer-prefixes 
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

B>  10.10.10.10/32 [200/0] via 192.168.1.0 (recursive), weight 1, 00:01:23
  *                          via 192.168.2.1, leaf2-eth0, weight 1, 00:01:23
                           via 192.168.1.2 (recursive), weight 1, 00:01:23
  *                          via 192.168.2.3, leaf2-eth1, weight 1, 00:01:23
leaf2# 

leaf2# show ip ospf database external 10.10.10.10

       OSPF Router with ID (192.168.2.0)

                AS External Link States 

  LS age: 140
  Options: 0x2  : *|-|-|-|-|-|E|-
  LS Flags: 0xb  
  LS Type: AS-external-LSA
  Link State ID: 10.10.10.10 (External Network Number)
  Advertising Router: 192.168.2.0
  LS Seq Number: 80000001
  Checksum: 0xc367
  Length: 36

  Network Mask: /32
        Metric Type: 2 (Larger than any link state path)
        TOS: 0
        Metric: 20
        Forward Address: 0.0.0.0
        External Route Tag: 0

leaf2#

The neighborship leaf2 < -- > exit1:

exit1# show ip route 10.10.10.10/32 longer-prefixes 
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

O>* 10.10.10.10/32 [110/20] via 192.168.3.1, exit1-eth0, weight 1, 00:01:56
exit1# 

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
master size/L tests Topotests, make check, etc zebra
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants