-
Notifications
You must be signed in to change notification settings - Fork 23
Frr srv6 #256
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
Frr srv6 #256
Conversation
Set nexthop family to AF_INET4. Fixes: 3f7be3f ("nexthop: change nexthop_new to accept a full object") Signed-off-by: Maxime Leroy <[email protected]>
When removing an IPv6 route we must send a `GR_IP6_ROUTE_DEL` request to grout, not `GR_IP6_ROUTE_ADD` and the req_size is sizeof(struct gr_ip6_route_del_req). Fixes: 9bf3ff9 ("frr: add frr dplane plugin") Signed-off-by: Maxime Leroy <[email protected]>
d249510 to
3b03e7b
Compare
nexthop_equal previously ignored the nexthop type and private data, which is insufficient for types like SRv6 or DNAT44 that store custom data. This change allows nexthop_type_ops to provide a type-specific equal() function for accurate comparison. Signed-off-by: Maxime Leroy <[email protected]>
rib_insert() now checks nexthop equality and returns EEXIST for a duplicate, so the pre-insert RIB lookup is unnecessary. Remove it. Signed-off-by: Maxime Leroy <[email protected]>
Deleting a DNAT rule needs only iface_id and match address; the replace address is redundant because a (iface_id, match) pair is unique. Remove the field and simplify the API. Signed-off-by: Maxime Leroy <[email protected]>
Let the nh_ops->free callback call snat44_static_rule_del instead of invoking it manually for every DNAT rule deletion. Signed-off-by: Maxime Leroy <[email protected]>
Each DEL_ROUTE/SRV6/DNAT44 callback already looks up the nexthop type. rib4/6_delete() then repeats the lookup to fetch the nexthop, drop its refcnt, and—if required—emit an event. Drop the redundant lookup by letting rib4/6_delete() validate the expected nexthop type directly. Signed-off-by: Maxime Leroy <[email protected]>
grout doesn’t support them. Signed-off-by: Maxime Leroy <[email protected]>
Aligns SRv6 route ops with nexthop/IP route API. Signed-off-by: Maxime Leroy <[email protected]>
Aligns SRv6 localsid ops with nexthop/IP route API. Signed-off-by: Maxime Leroy <[email protected]>
SRv6 nexthop and route entries are currently created with the origin type `LINK`, which is not always appropriate. Extend the API so users can specify the desired origin when adding a localsid or SRv6 route, mirroring the capability already available for IPv4/IPv6 nexthop routes. Signed-off-by: Maxime Leroy <[email protected]>
This commit adds synchronization of SRv6 LocalSIDs from zebra to Grout. We cannot create SRv6 nexthops, because they are of type NEXTHOP_IFINDEX and Grout does not yet support nexthops without a gateway. Therefore, for SRv6 we bypass the nexthop-ID API and create only the LocalSID when the grout dplane plugin processes a GR_IP6_ROUTE_ADD with a srv6 nexthop. Note: USD is always enabled on Grout, whereas on FRR/Linux it is disabled by default and must be enabled manually. Until this is harmonized, zebra logs a debug message if USD is not enabled. Signed-off-by: Maxime Leroy <[email protected]>
The Grout plugin can now add and delete SRv6 route entries—IPv4 or IPv6 prefixes whose nexthop carries an SRv6 segment list. We cannot configure SRv6 nexthops in Grout because that would require support for nexthops with only an interface and no gateway address, which Grout does not support today. Signed-off-by: Maxime Leroy <[email protected]>
Replicates `srv6_test.sh`, but configures SRv6 via staticd/zebra instead of grcli. Signed-off-by: Maxime Leroy <[email protected]>
| rte_rib6_get_nh(rn, &nh_id); | ||
| nh = nh_id_to_ptr(nh_id); | ||
| if (nh->type != nh_type) | ||
| return errno_set(EINVAL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would prefer something like EADDRINUSE. What do you think?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Mmh this happens when you try to remove a route of wrong type. Einval seems logical for me.
| rte_rib_get_nh(rn, &nh_id); | ||
| nh = nh_id_to_ptr(nh_id); | ||
| if (nh->type != nh_type) | ||
| return errno_set(EINVAL); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also EADDRINUSE here?
Synchronize srv6 route/localsid from zebra to grout.
Opposite way it's not supported.