Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

selftests: net: ip_local_port_range: define IPPROTO_MPTCP

Older glibc's netinet/in.h may leave IPPROTO_MPTCP undefined when
building ip_local_port_range.c, that leads to "error: use of undeclared
identifier 'IPPROTO_MPTCP'".

Define IPPROTO_MPTCP in such cases, just like in other MPTCP selftests.

Fixes: 122db5e3634b ("selftests/net: add MPTCP coverage for IP_LOCAL_PORT_RANGE")
Reported-by: Linux Kernel Functional Testing <lkft@linaro.org>
Closes: https://lore.kernel.org/netdev/CA+G9fYvGO5q4o_Td_kyQgYieXWKw6ktMa-Q0sBu6S-0y3w2aEQ@mail.gmail.com/
Signed-off-by: Maxim Galaganov <max@internet.ru>
Tested-by: Linux Kernel Functional Testing <lkft@linaro.org>
Link: https://lore.kernel.org/r/20240209132512.254520-1-max@internet.ru
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

authored by

Maxim Galaganov and committed by
Jakub Kicinski
c2b3ec36 73d9629e

+4
+4
tools/testing/selftests/net/ip_local_port_range.c
··· 16 16 #define IP_LOCAL_PORT_RANGE 51 17 17 #endif 18 18 19 + #ifndef IPPROTO_MPTCP 20 + #define IPPROTO_MPTCP 262 21 + #endif 22 + 19 23 static __u32 pack_port_range(__u16 lo, __u16 hi) 20 24 { 21 25 return (hi << 16) | (lo << 0);