-
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: cleanup netlink_ipneigh_change #9827
Conversation
Outdated results 💚Basic BGPD CI results: SUCCESS, 0 tests failed
For details, please contact louberger |
2316d11
to
69b7bf9
Compare
Outdated results 💚Basic BGPD CI results: SUCCESS, 0 tests failed
For details, please contact louberger |
Continuous Integration Result: SUCCESSFULContinuous 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-PULLREQ2-805/ This is a comment from an automated CI system. |
Don't parse netlink messages twice, and don't mix parsing and processing code. First, parse the message, then process it. Signed-off-by: Igor Ryzhov <[email protected]>
69b7bf9
to
90fd0b3
Compare
@donaldsharp hi, you asked for this cleanup, would be great to get a review when you have time. |
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-PULLREQ2-3244/ This is a comment from an automated CI system. |
This PR is stale because it has been open 180 days with no activity. Comment or remove the |
This pull request has conflicts, please resolve those before we can evaluate the pull request. |
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.
PR looks good, I made one comment about handling bad values.
netlink_nbr_entry_state_to_zclient(ndm->ndm_state), l2_data, | ||
l2_len); | ||
|
||
if (h->nlmsg_type == RTM_GETNEIGH) |
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.
This code is not 1:1 functionality with the previous one. Suggestion: make this if
into a switch
and reject anything other than RTM_NEWNEIGH
, RTM_DELNEIGH
.
Here is what the previous remove code did (right above these lines addition):
if (h->nlmsg_type == RTM_NEWNEIGH)
cmd = ZEBRA_NHRP_NEIGH_ADDED;
else if (h->nlmsg_type == RTM_GETNEIGH)
cmd = ZEBRA_NHRP_NEIGH_GET;
else if (h->nlmsg_type == RTM_DELNEIGH)
cmd = ZEBRA_NHRP_NEIGH_REMOVED;
else {
zlog_debug("%s(): unknown nlmsg type %u", __func__,
h->nlmsg_type);
return 0;
}
Too many changes in master since this code was written. Closing. |
Don't parse netlink messages twice, and don't mix parsing and processing
code. First, parse the message, then process it.
Signed-off-by: Igor Ryzhov [email protected]