-
Notifications
You must be signed in to change notification settings - Fork 13
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
misc fixes: ip6 #174
misc fixes: ip6 #174
Conversation
christophefontaine
commented
Mar 4, 2025
•
edited
Loading
edited
- Simple fix on interface creation.
- Cleanup ip6 rib when an IPv6 address is deleted
When an interface was created with a wrong configuration, such as: $ add interface port p1 devargs net_tap1,iface=p1 mac f0:0d:ac:dc:00:01 rxqs 2 The interface isn't created and the graph is destroyed. As the stats pointer is NULL, and rte_graph_cluster_stats_destroy doesn't validate its input, Grout crashes. Signed-off-by: Christophe Fontaine <[email protected]>
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'm not sure about the fix. Let me know what you think.
6a80370
to
f67009e
Compare
f67009e
to
e7d58d5
Compare
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 didn't check in detail, but we may need to audit rib*_cleanup functions to ensure no loose treads.
modules/ip6/control/route.c
Outdated
rib6_delete(nh->vrf_id, nh->iface_id, &nh->ipv6, RTE_IPV6_MAX_DEPTH); | ||
rib6_delete(nh->vrf_id, nh->iface_id, &nh->ipv6, nh->prefixlen); |
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 have a feeling that we should keep this at the beginning:
rib6_delete(nh->vrf_id, nh->iface_id, &nh->ipv6, RTE_IPV6_MAX_DEPTH);
And only call the second one if nh->prefixlen != 0
(i.e. it is a local interface address). Gateway nexthops do not have their prefixlen set to anything:
if (nh->prefixlen != 0)
rib6_delete(nh->vrf_id, nh->iface_id, &nh->ipv6, nh->prefixlen);
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.
Yes, that's why I didn't want to merge this immediately (even if I need it !) that I put this PR in draft first.
If the gateway NH has not prefix len set, shouldn't we instead set it to RTE_IPv6_MAX_DEPTH / RTE_IPv4_MAX_DEPTH ?
We couldn't add a previously added IPv6 on an interface, either through the command line, or for link local ip when we add/delete/add an interface. In rib6_cleanup, call rib6_delete with the prefixlen instead of the max prefix. Add these checks in the existing test. Signed-off-by: Christophe Fontaine <[email protected]>
Similar to ipv6 nexthop suppression, check the NH flags to delete either with embedded prefix len or the max prefix len (/32). Update test to ensure we can add/del/add the same address. Signed-off-by: Christophe Fontaine <[email protected]>
e7d58d5
to
d87170b
Compare