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: cleanup netlink_ipneigh_change #9827

Closed

Conversation

idryzhov
Copy link
Contributor

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]

@frrbot frrbot bot added the zebra label Oct 13, 2021
@LabN-CI
Copy link
Collaborator

LabN-CI commented Oct 13, 2021

Outdated results 💚

Basic BGPD CI results: SUCCESS, 0 tests failed

_ _
Result SUCCESS git merge/9827 2316d11
Date 10/13/2021
Start 16:37:12
Finish 17:03:29
Run-Time 26:17
Total 1813
Pass 1813
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2021-10-13-16:37:12.txt
Log autoscript-2021-10-13-16:38:22.log.bz2
Memory 516 501 429

For details, please contact louberger

@idryzhov idryzhov force-pushed the netlink_ipneigh_change-cleanup branch from 2316d11 to 69b7bf9 Compare October 17, 2021 15:36
@LabN-CI
Copy link
Collaborator

LabN-CI commented Oct 17, 2021

Outdated results 💚

Basic BGPD CI results: SUCCESS, 0 tests failed

_ _
Result SUCCESS git merge/9827 69b7bf9
Date 10/17/2021
Start 11:41:12
Finish 12:07:29
Run-Time 26:17
Total 1813
Pass 1813
Fail 0
Valgrind-Errors 0
Valgrind-Loss 0
Details vncregress-2021-10-17-11:41:12.txt
Log autoscript-2021-10-17-11:42:25.log.bz2
Memory 491 514 428

For details, please contact louberger

@NetDEF-CI
Copy link
Collaborator

NetDEF-CI commented Oct 17, 2021

Continuous Integration Result: SUCCESSFUL

Continuous Integration Result: SUCCESSFUL

Congratulations, 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.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

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]>
@idryzhov idryzhov force-pushed the netlink_ipneigh_change-cleanup branch from 69b7bf9 to 90fd0b3 Compare February 6, 2022 18:27
@idryzhov
Copy link
Contributor Author

idryzhov commented Feb 6, 2022

@donaldsharp hi, you asked for this cleanup, would be great to get a review when you have time.

@NetDEF-CI
Copy link
Collaborator

Continuous Integration Result: SUCCESSFUL

Congratulations, 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.
For questions and feedback in regards to this CI system, please feel free to email
Martin Winter - mwinter (at) opensourcerouting.org.

@github-actions
Copy link

github-actions bot commented Aug 6, 2022

This PR is stale because it has been open 180 days with no activity. Comment or remove the autoclose label in order to avoid having this PR closed.

@github-actions
Copy link

This pull request has conflicts, please resolve those before we can evaluate the pull request.

Copy link
Member

@rzalamena rzalamena left a 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)
Copy link
Member

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;
	}

@idryzhov
Copy link
Contributor Author

Too many changes in master since this code was written. Closing.

@idryzhov idryzhov closed this Jan 31, 2024
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.

4 participants