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

Zebra neigh update #15179

Merged
merged 3 commits into from
Jan 23, 2024
Merged

Zebra neigh update #15179

merged 3 commits into from
Jan 23, 2024

Conversation

donaldsharp
Copy link
Member

a) Abstract neighbor events away from nhrp specific.
b) Add a sharp watch neighbor command so that neighbor events can be monitored.

Effectively future commits will have other daemons watching more neighbor events.

sharpd/sharp_vty.c Outdated Show resolved Hide resolved
This does not need to be nhrp specific.

Signed-off-by: Donald Sharp <[email protected]>
This is needed to be generic.  Let's make it so.

Signed-off-by: Donald Sharp <[email protected]>
Copy link
Member

@ton31337 ton31337 left a comment

Choose a reason for hiding this comment

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

LGTM

@ton31337 ton31337 merged commit 92a56d2 into FRRouting:master Jan 23, 2024
9 checks passed
@pbrisset pbrisset self-requested a review January 24, 2024 21:15
Copy link

@pbrisset pbrisset left a comment

Choose a reason for hiding this comment

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

As discussed, applying your patch file internally and completing the bgp code.
Thank you for this work

@@ -154,6 +154,10 @@ int nhrp_neighbor_operation(ZAPI_CALLBACK_ARGS)
struct zapi_neigh_ip api = {};

zclient_neigh_ip_decode(zclient->ibuf, &api);

Choose a reason for hiding this comment

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

Perhaps a comment on why you are allowing only /32 is welcome.

Copy link
Member Author

Choose a reason for hiding this comment

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

lol. That is what the original code did. I just moved it from Zebra to up into nhrpd. I don't fully understand it but if I had to guess it's a RTM_NEIGH entry where the lladr is set to a v4 address. I left it alone mainly because I didn't know and didn't want to take the time to figure it out.

in, out, ifp,
out ? ZEBRA_NEIGH_STATE_REACHABLE
: ZEBRA_NEIGH_STATE_FAILED,
0);
Copy link

@pbrisset pbrisset Jan 24, 2024

Choose a reason for hiding this comment

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

please add comment of the meaning of 0 (hardcoded value)
something like

0); // meaning something cool

This is the ip_len. Why are you using 0?

@@ -27,6 +27,32 @@

DEFINE_MTYPE_STATIC(SHARPD, SRV6_LOCATOR, "SRv6 Locator");

DEFPY(watch_neighbor, watch_neighbor_cmd,

Choose a reason for hiding this comment

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

Should we have a v6 watch too?

Copy link
Member Author

Choose a reason for hiding this comment

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

This was a Proof of Concept bit of code. I don't mind having it and I don't mind not having it. An end operator is not likely to ever use this.

@@ -989,6 +989,41 @@ static int sharp_zebra_process_srv6_locator_chunk(ZAPI_CALLBACK_ARGS)
return 0;
}

static int sharp_zebra_process_neigh(ZAPI_CALLBACK_ARGS)

Choose a reason for hiding this comment

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

This function always return 0.
What is the difference between failure and success?

Copy link
Member Author

Choose a reason for hiding this comment

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

This is a bit of a historical baggage that is carried around at the moment, that needs to be cleaned up. The original code all had this idea of returning error messages. But whenever a non-zero was returned it was always ignored. When the current handler code was abstracted, by Quentin, to use arrays of function pointers it got carried over. The original coder of a lot of functionality in FRR had this idea of returning 0 or 1 for success and immediately throwing the answer away and never using it. We've cleaned up large swaths. This is just another example of something that needs to be fixed from my perspective.

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