-
Notifications
You must be signed in to change notification settings - Fork 1.3k
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
Static stuff #1819
Static stuff #1819
Conversation
Continuous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-2725/ This is a comment from an EXPERIMENTAL automated CI system. CLANG Static Analyzer Summary
No Changes in Static Analysis warnings compared to base19 Static Analyzer issues remaining.See details at |
💚 Basic BGPD CI results: SUCCESS, 0 tests failedResults table
For details, please contact louberger |
zebra/zebra_vty.c
Outdated
return CMD_SUCCESS; | ||
} | ||
|
||
assert(0); |
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've seen a neat assert variant used elsewhere in the codebase that provides some debugging info, it looks like this:
assert(!"my error message")
It's helped me in the past with debugging. Alternatively a comment around this area might be good.
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.
fixed
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.
2 remarks:
- what about cases where routes are installed but fail due to other error ( no mpls, bad mpls value, bad format)
- some errors should be displayed upon vrf on
shr->dest_str, shr->mask_str, shr->src_str, | ||
shr->gate_str, shr->ifname, shr->flag_str, shr->tag_str, | ||
shr->distance_str, shr->label_str); | ||
|
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.
getting the returned value of zebra_statis_route_leak could permit to know exactly if an entry has been installed or not ( case mpls is not present in kernel)
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.
Not much to do with it other than to notice the rejection.
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.
can't we remove the static entry from the list ?
zebra/zebra_vty.c
Outdated
vty_out(vty, "%% Nexthop interface cannot be Null0, reject or blackhole\n"); | ||
if (vty) | ||
vty_out(vty, | ||
"%% Nexthop interface cannot be Null0, reject or blackhole\n"); | ||
return CMD_WARNING_CONFIG_FAILED; |
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.
that event should be logged into a zlog_xxx
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.
done
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.
thanks
zebra/zebra_vty.c
Outdated
vty_out(vty, | ||
"%% Cannot use reserved label(s) (%d-%d)\n", | ||
MPLS_LABEL_RESERVED_MIN, | ||
MPLS_LABEL_RESERVED_MAX); | ||
break; |
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.
that event should be logged into a zlog_xxx
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.
dibe
zebra/zebra_vty.c
Outdated
"%% MPLS not turned on in kernel, ignoring command\n"); | ||
if (vty) | ||
vty_out(vty, | ||
"%% MPLS not turned on in kernel, ignoring command\n"); | ||
return CMD_WARNING_CONFIG_FAILED; |
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.
that event should be logged into a zlog_xxx
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.
done
When you have individual 'ip route..' commands under a VRF allow them to be displayed properly Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
When zebra is being configed we allow for static routes to be entered. This presents a problem for when a vrf is cli configed but not kernel configed yet. Modify zebra to notice that when a static route is entered and either the nexthop vrf or the vrf is not fully configed, to save that config to the side. When vrf's become active( kernel configed ) parse through the list of saved to the side static routes and determine if any of them can be installed. Additionally modify the cli to output the saved to the side cli, so that we can properly handle a wr mem. Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
908e1b2
to
4060008
Compare
💚 Basic BGPD CI results: SUCCESS, 0 tests failedResults table
For details, please contact louberger |
Continuous Integration Result: SUCCESSFULCongratulations, this patch passed basic tests Tested-by: NetDEF / OpenSourceRouting.org CI System CI System Testrun URL: https://ci1.netdef.org/browse/FRR-FRRPULLREQ-2793/ This is a comment from an EXPERIMENTAL automated CI system. Warnings Generated during build:Checkout code: Successful with additional warnings:
CLANG Static Analyzer Summary
No Changes in Static Analysis warnings compared to base19 Static Analyzer issues remaining.See details at |
I wonder if we couldn't solve this problem in a simpler way. We used to have a similar problem with static routes pointing to non-existing interfaces. This was fixed by this commit: c3c04063 In short, the fix was to store nexthop interfaces using their names and not their ifindexes. Then, pior to calling I think we could try to do something similar here. We could change the |
Also, this diff doesn't solve the problem completely:
If we store VRF using their names then the commands above will work even if the VRFs don't exist. |
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 don't know if Renatos idea could be applied to this.
I would tend to think this change could be done.
-like that, my comment on "removing the static entry from the list " could be ignored, since all entries may be valid but will really be taken into account if underlying ( lets start with vrf) are available.
shr->dest_str, shr->mask_str, shr->src_str, | ||
shr->gate_str, shr->ifname, shr->flag_str, shr->tag_str, | ||
shr->distance_str, shr->label_str); | ||
|
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.
can't we remove the static entry from the list ?
zebra/zebra_vty.c
Outdated
vty_out(vty, "%% Nexthop interface cannot be Null0, reject or blackhole\n"); | ||
if (vty) | ||
vty_out(vty, | ||
"%% Nexthop interface cannot be Null0, reject or blackhole\n"); | ||
return CMD_WARNING_CONFIG_FAILED; |
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.
thanks
I agree to keep the changes as they are |
In the light of #1887, I think these changes can get in and we should take the issue of non-existing VRFs into consideration when refactoring the handling of static routes in zebra. Will merge now. |
It is possible to cause zebra to crash when you have static routes configured under a non-fully initialized vrf. These commits fix this issue.