Add types and macros for ICMPv6 filtering#5225
Open
Skyb0rg007 wants to merge 1 commit into
Open
Conversation
efdab70 to
5d1ba9f
Compare
Collaborator
5d1ba9f to
8bbb220
Compare
Author
|
Sorry for spamming the CI; I couldn't get it to work on my fork. Anyways, I'm mostly confident with this PR. The missing parts are:
Some notes on the implementation:
|
8bbb220 to
0936f92
Compare
This commit adds the icmp6_filter type and the corresponding ICMP6_FILTER macros. These functions are tested in a similar manner to the CMSG macros.
0936f92 to
c7dad56
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
This commit adds the icmp6_filter type and the corresponding ICMP6_FILTER macros.
The API is defined in RFC 2292; I split-off this code from #4954 because the testing code here is more substantial.
These functions are tested in a similar manner to the CMSG macros, as the implementation differs between Linux and BSDs.
Sources
https://github.com/bminor/glibc/blob/04e750e75b73957cf1c791535a3f4319534a52fc/inet/netinet/icmp6.h
https://github.com/kraj/musl/blob/kraj/master/include/netinet/icmp6.h
https://github.com/freebsd/freebsd-src/blob/9ae367d11de8abbdf53884836c9ba30908c5c8db/sys/netinet/icmp6.h
https://github.com/apple-oss-distributions/xnu/blob/main/bsd/netinet/icmp6.h
Also in the RFC: https://datatracker.ietf.org/doc/html/rfc2292#section-3.2
Checklist
libc-test/semverhave been updated*LASTor*MAXareincluded (see #3131)
cd libc-test && cargo test --target mytarget);especially relevant for platforms that may not be checked in CI
@rustbot label +stable-nominated