mirror of
https://github.com/RT-Thread/rt-thread.git
synced 2026-11-16 01:05:15 +08:00
[net][sal] validate RAW socket protocol (#11888)
* [net][sal] validate RAW socket protocol - replace the IPPROTO_RAW-only check with VALID_PROTOCOL() - allow RAW sockets for protocols such as ICMP - keep the existing domain and type validation unchanged * [net][sal] fix clang-format alignment - align the macro continuation after the RAW protocol check - no functional change
This commit is contained in:
1 parent
f29b9ae21c
commit
9e7065c85a
1 file changed
+1
-1
@@ -49,7 +49,7 @@
|
||||
(((domain) == AF_INET || (domain) == AF_INET6) && \
|
||||
(((type) == SOCK_STREAM && ((protocol) == 0 || (protocol) == IPPROTO_TCP)) || \
|
||||
((type) == SOCK_DGRAM && ((protocol) == 0 || (protocol) == IPPROTO_UDP)) || \
|
||||
((type) == SOCK_RAW && ((protocol) == IPPROTO_RAW)))) || \
|
||||
((type) == SOCK_RAW && VALID_PROTOCOL(protocol)))) || \
|
||||
((domain) == AF_UNIX && ((type) == SOCK_STREAM || (type) == SOCK_DGRAM) && (protocol) == 0) || \
|
||||
((domain) == AF_NETLINK && (type) == SOCK_RAW && (protocol) == 0))
|
||||
|
||||
|
||||
Reference in new issue
Block a user