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

nhrpd: unset noarp flag using a zapi message #15173

Merged
merged 4 commits into from
Jan 24, 2024

Conversation

louis-6wind
Copy link
Contributor

Unset the IFF_NOARP interface flag using a ZAPI message. It removes the dependency to if.h headers.

Copy link
Contributor

@mjstapp mjstapp left a comment

Choose a reason for hiding this comment

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

just had a couple of questions

@@ -351,6 +351,7 @@ void nhrp_interface_update(struct interface *ifp)
if (!if_ad->configured) {
os_configure_dmvpn(ifp->ifindex, ifp->name,
afi2family(afi));
nhrp_interface_update_arp(ifp, true);
Copy link
Contributor

Choose a reason for hiding this comment

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

did you move this out of "configure_dmvpn" on purpose, for some specific reason?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

the goal is to migrate all things from nhrp_linux.c

@@ -314,6 +314,8 @@ extern int if_ipv6_address_install(struct interface *ifp, struct prefix *prefix,
extern int if_ip_address_uinstall(struct interface *ifp, struct prefix *prefix);
extern int if_shutdown(struct interface *ifp);
extern int if_no_shutdown(struct interface *ifp);
extern int if_arp_set(struct interface *ifp);
Copy link
Contributor

Choose a reason for hiding this comment

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

looks like these two functions are almost identical - could you converge to one, that takes a boolean?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

other functions in interface.* are dispatched. Just used the same pattern.
Moreover, it is more readable

Copy link
Contributor

Choose a reason for hiding this comment

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

well, "same pattern", we have lots of patterns that are old, and that we don't want to continue to use, eh?
for me, the duplication of code is enough that it's not clearer: it'd be better to have 20 lines once, and then just the two different "set/unset" lines.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

OK done

lib/zclient.c Outdated

zclient_create_header(s, ZEBRA_INTERFACE_SET_ARP, ifp->vrf->vrf_id);

stream_putl(s, ifp->vrf->vrf_id);
Copy link
Contributor

Choose a reason for hiding this comment

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

do you need this, since we have the vrf id in the message already?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

fixed

@louis-6wind louis-6wind force-pushed the nhrp-noarp branch 2 times, most recently from e142b77 to 7f037f1 Compare January 18, 2024 17:02
@Jafaral Jafaral self-requested a review January 23, 2024 16:37
Copy link
Contributor

@mjstapp mjstapp left a comment

Choose a reason for hiding this comment

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

Looks fine to me now, thanks. But there is a python style warning - can you clear that?

Add a ZAPI message to control the setting of the IFF_NOARP flag.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Unset the IFF_NOARP interface flag using a ZAPI message. It removes the
dependency to if.h headers.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Test the absence the NOARP flag on rX-gre0 interfaces. It is present by
default.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
Remove the unused netlink_configure_arp() declaration.

Signed-off-by: Louis Scalbert <louis.scalbert@6wind.com>
@donaldsharp donaldsharp merged commit c3a66e5 into FRRouting:master Jan 24, 2024
9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants