-
Notifications
You must be signed in to change notification settings - Fork 7.1k
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
IPPROTO_RAW wrongly used with AF_PACKET #86827
Comments
The original plan was to be aligned with Linux here, but it seems that target was missed then. I suppose you are talking about this line
I think we can easily remove that one, the original plan was to have some default value if user gives proto as 0 which is not a valid value.
|
More info. According to this page https://stackoverflow.com/questions/49309029/confusion-with-af-inet-with-sock-raw-as-the-socket-type-v-s-af-packet-with-so the protocol field should be allowed to be 0 with |
It's not only this line. This adds additional overhead: zephyr/subsys/net/ip/net_core.c Line 131 in 658f935
|
Here is also more info: https://man7.org/linux/man-pages/man7/raw.7.html |
I think raw7 manual page only talks about AF_INET/6 sockets, not AF_PACKET ones. |
https://man7.org/linux/man-pages/man7/packet.7.html Doesn't talk about IPPROTO_RAW either. AF_PACKET is a layer 2 socket and IPPROTO_RAW is used at l3/l4 sockets. |
Yes, I noticed the same, it does not talk about IPPROTO_RAW. Only place IPPROTO_RAW is mentioned is in raw(7). |
Describe the bug
Zephyr specifies the use of
IPPROTO_RAW
withAF_PACKET
sockets. This is not in line how Linux specifies this. `IPPROTO_RAW´ is specified as sub type for IP frames. [1] Used as EtherType this specifies an old length field type. [2]To Reproduce
Use AF_PACKET socket.
Expected behavior
IPPROTO_RAW
is not treated as a protocol withAF_PACKET
sockets, but with AF_INET/AF_INET6 through a SOCK_RAW socket.Impact
Incompatibility (and maintaining this). overhead when using AF_PACKET.
Logs and console output
None.
Environment (please complete the following information):
Additional context
None.
The text was updated successfully, but these errors were encountered: