Skip to content

Simplify IPv4 address validation in NewPacket #32

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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

tklauser
Copy link

Use netip.Addr.Is4 to validate both source and destination IP. Also drop the redundant check for an invalid IP. netip.Addr.Is4 will return false for an invalid netip.Addr.

Use netip.Addr.Is4 to validate both source and destination IP. Also drop
the redundant check for an invalid IP. netip.Addr.Is4 will return false
for an invalid netip.Addr.
@tklauser tklauser force-pushed the newpacket-address-validate-simplify branch from f7a002a to 6d0004c Compare December 13, 2024 09:42
@tklauser
Copy link
Author

@mdlayher any chance you could take a quick look? Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant