zephyr: IPPROTO_RAW wrongly used with AF_PACKET
Describe the bug
Zephyr specifies the use of IPPROTO_RAW with AF_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 with AF_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):
- OS: Linux
- Toolchain: Zephyr SDK
- Commit SHA: df5318479b914d320f52870c6dfd0420779fc5c0
Additional context None.
About this issue
- Original URL
- State: closed
- Created 2 years ago
- Comments: 16 (15 by maintainers)
Commits related to this issue
- net: sockets: Fix IPPROTO_RAW wrongly used with AF_PACKET The issue described in #86827 indicates that IPPROTO_RAW should only be used with AF_INET/AF_INET6 sockets via SOCK_RAW, not with AF_PACKET s... — committed to mkschreder/zephyr by mkschreder 2 years ago
- net: sockets: Fix IPPROTO_RAW wrongly used with AF_PACKET The issue described in #86827 indicates that IPPROTO_RAW should only be used with AF_INET/AF_INET6 sockets via SOCK_RAW, not with AF_PACKET s... — committed to mkschreder/zephyr by mkschreder 2 years ago
- net: ip: Do not use IPPROTO_RAW for AF_PACKET sockets The AF_PACKET socket protocol field needs to be according to ETH_P_* values (defined in include/net/ethernet.h) and not for IPPROTO_RAW which is ... — committed to jukkar/zephyr by jukkar 2 years ago
@go2sh I constructed a table above to cover all combinations so that we can agree what would need to happen in different case. Please take a look if it makes sense to you.
Lets agree on the table first and then just implement it in a PR to get this working properly. We probably need to mention this table somewhere in the network documentation and link to that in the migration guide to help user to understand what is going on.