History

icmp: standardize naming of RFC 8335 PROBE constants

The current definitions of constants for PROBE, currently defined only in the net-next kernel branch, are inconsistent, with some beginning with ICMP and others with simply EXT. This patch attempts to standardize the naming conventions of the constants for PROBE before their release into a stable Kernel, and to update the relevant definitions in net/ipv4/icmp.c. Similarly, the definitions for the code field (previously ICMP_EXT_MAL_QUERY, etc) use the same prefixes as the type field. This patch adds _CODE_ to the prefix to clarify the distinction of these constants.

Andreas Roeseler committed 5 years ago

Commit e542d291 parent f89271f2 files · +22 −22Browse files

Showing the changes to include/uapi/linux (1 of 2 files). Show all

Unified · Split

include/uapi/linux/icmp.h+14−14
@@ -70,22 +70,22 @@ · 69 unmodified lines
7070 #define ICMP_EXC_FRAGTIME 1 /* Fragment Reass time exceeded */
7171
7272 /* Codes for EXT_ECHO (PROBE) */
73−#define ICMP_EXT_ECHO 42
74−#define ICMP_EXT_ECHOREPLY 43
75−#define ICMP_EXT_MAL_QUERY 1 /* Malformed Query */
76−#define ICMP_EXT_NO_IF 2 /* No such Interface */
77−#define ICMP_EXT_NO_TABLE_ENT 3 /* No such Table Entry */
78−#define ICMP_EXT_MULT_IFS 4 /* Multiple Interfaces Satisfy Query */
73+#define ICMP_EXT_ECHO 42
74+#define ICMP_EXT_ECHOREPLY 43
75+#define ICMP_EXT_CODE_MAL_QUERY 1 /* Malformed Query */
76+#define ICMP_EXT_CODE_NO_IF 2 /* No such Interface */
77+#define ICMP_EXT_CODE_NO_TABLE_ENT 3 /* No such Table Entry */
78+#define ICMP_EXT_CODE_MULT_IFS 4 /* Multiple Interfaces Satisfy Query */
7979
8080 /* Constants for EXT_ECHO (PROBE) */
81−#define EXT_ECHOREPLY_ACTIVE (1 << 2)/* active bit in reply message */
82−#define EXT_ECHOREPLY_IPV4 (1 << 1)/* ipv4 bit in reply message */
83−#define EXT_ECHOREPLY_IPV6 1 /* ipv6 bit in reply message */
84−#define EXT_ECHO_CTYPE_NAME 1
85−#define EXT_ECHO_CTYPE_INDEX 2
86−#define EXT_ECHO_CTYPE_ADDR 3
87−#define ICMP_AFI_IP 1 /* Address Family Identifier for ipv4 */
88−#define ICMP_AFI_IP6 2 /* Address Family Identifier for ipv6 */
81+#define ICMP_EXT_ECHOREPLY_ACTIVE (1 << 2)/* active bit in reply message */
82+#define ICMP_EXT_ECHOREPLY_IPV4 (1 << 1)/* ipv4 bit in reply message */
83+#define ICMP_EXT_ECHOREPLY_IPV6 1 /* ipv6 bit in reply message */
84+#define ICMP_EXT_ECHO_CTYPE_NAME 1
85+#define ICMP_EXT_ECHO_CTYPE_INDEX 2
86+#define ICMP_EXT_ECHO_CTYPE_ADDR 3
87+#define ICMP_AFI_IP 1 /* Address Family Identifier for ipv4 */
88+#define ICMP_AFI_IP6 2 /* Address Family Identifier for ipv6 */
8989
9090 struct icmphdr {
9191 __u8 type;