Commit c2def959 authored by Maxim Galaganov's avatar Maxim Galaganov Committed by Geliang Tang
Browse files

selftests: net: ip_local_port_range: define IPPROTO_MPTCP

mainline inclusion
from mainline-v6.8-rc5
commit c2b3ec36b422a331e153a9e40d14adcf82685cee
category: feature
bugzilla: https://gitee.com/openeuler/kernel/issues/I9VYQ9
CVE: NA

Reference: https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git/commit/?id=c2b3ec36b422a331e153a9e40d14adcf82685cee



--------------------------------

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: default avatarLinux Kernel Functional Testing <lkft@linaro.org>
Closes: https://lore.kernel.org/netdev/CA+G9fYvGO5q4o_Td_kyQgYieXWKw6ktMa-Q0sBu6S-0y3w2aEQ@mail.gmail.com/


Signed-off-by: default avatarMaxim Galaganov <max@internet.ru>
Tested-by: default avatarLinux Kernel Functional Testing <lkft@linaro.org>
Link: https://lore.kernel.org/r/20240209132512.254520-1-max@internet.ru


Signed-off-by: default avatarJakub Kicinski <kuba@kernel.org>
Signed-off-by: default avatarGeliang Tang <tanggeliang@kylinos.cn>
parent 6d922fd6
Loading
Loading
Loading
Loading
+4 −0
Original line number Diff line number Diff line
@@ -16,6 +16,10 @@
#define IP_LOCAL_PORT_RANGE 51
#endif

#ifndef IPPROTO_MPTCP
#define IPPROTO_MPTCP 262
#endif

static __u32 pack_port_range(__u16 lo, __u16 hi)
{
	return (hi << 16) | (lo << 0);