-
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
zebra: Modify how we display/store os description #4220
Conversation
The alias/description of an interface in linux was being used to override the internal description. As such let's fix the display to keep track of both if we have it. Config in FRR: ! interface docker0 description another combination ! interface enp3s0 description BAMBOOZLE ME WILL YOU ! Config in linux: sharpd@robot ~/f/zebra> ip link show 1: lo: <LOOPBACK,UP,LOWER_UP> mtu 65536 qdisc noqueue state UNKNOWN mode DEFAULT group default qlen 1000 link/loopback 00:00:00:00:00:00 brd 00:00:00:00:00:00 alias This is the loopback you cabbage 2: enp3s0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc fq_codel state UP mode DEFAULT group default qlen 1000 link/ether 74:d0:2b:9c:16:eb brd ff:ff:ff:ff:ff:ff alias HI HI HI Now the 'show int descr' command: robot# show int description Interface Status Protocol Description docker0 up down another combination enp3s0 up up BAMBOOZLE ME WILL YOU HI HI HI lo up up This is the loopback you cabbage Fixes: FRRouting#4191 Signed-off-by: Donald Sharp <sharpd@cumulusnetworks.com>
e8df4f5
to
c74147d
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-7397/ This is a comment from an automated CI system. CLANG Static Analyzer Summary
No Changes in Static Analysis warnings compared to base12 Static Analyzer issues remaining.See details at |
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.
Some nits, particularly the null checks before free aren't necessary
zebra/if_netlink.c
Outdated
@@ -707,6 +704,12 @@ static int netlink_interface(struct nlmsghdr *h, ns_id_t ns_id, int startup) | |||
zif = (struct zebra_if *)ifp->info; | |||
zif->link_ifindex = link_ifindex; | |||
|
|||
if (desc) { | |||
if (zif->desc) | |||
XFREE(MTYPE_TMP, zif->desc); |
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.
No need for the null check here.
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
zebra/if_netlink.c
Outdated
zif = ifp->info; | ||
if (zif) { | ||
if (zif->desc) | ||
XFREE(MTYPE_TMP, zif->desc); |
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.
Same thing
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
zebra/interface.c
Outdated
@@ -181,6 +181,8 @@ static int if_zebra_delete_hook(struct interface *ifp) | |||
list_delete(&rtadv->AdvDNSSLList); | |||
#endif /* HAVE_RTADV */ | |||
|
|||
if (zebra_if->desc) | |||
XFREE(MTYPE_TMP, zebra_if->desc); |
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.
Same here
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
struct zebra_if *zif; | ||
bool intf_desc; | ||
|
||
intf_desc = false; |
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.
bool intf_desc = false
?
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.
intf_desc was being set to false once with the bool intf_desc = false
why? I am not sure as that was a bit surprising too me. So I just moved it down one line to ensure it was reset at the top of the loop every time.
c74147d
to
ba5165e
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-7406/ This is a comment from an automated CI system. CLANG Static Analyzer Summary
No Changes in Static Analysis warnings compared to base12 Static Analyzer issues remaining.See details at |
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.
looks like everything is fixed on this one, and the code is fine
The alias/description of an interface in linux was being
used to override the internal description. As such let's
fix the display to keep track of both if we have it.
Config in FRR:
Config in linux:
Now the 'show int descr' command:
Fixes: #4191
Signed-off-by: Donald Sharp sharpd@cumulusnetworks.com