History

mptcp: fix conflict with <netinet/in.h>

Including <linux/mptcp.h> before the C library <netinet/in.h> header causes symbol redefinition errors at compile-time due to duplicate declarations and definitions in the <linux/in.h> header included by <linux/mptcp.h>. Explicitly include <netinet/in.h> before <linux/in.h> in <linux/mptcp.h> when __KERNEL__ is not defined so that the C library compatibility logic in <linux/libc-compat.h> is enabled when including <linux/mptcp.h> in user space code.

Ossama Othman committed 4 years ago

Commit 06e445f1 parent 42fb6cd1 file · +5 −4Browse files

Showing the changes to include/uapi (1 of 1 file). Show all

Unified · Split

include/uapi/linux/mptcp.h+5−4
@@ -2,16 +2,17 @@ · 1 unmodified line
2#ifndef _UAPI_MPTCP_H2#ifndef _UAPI_MPTCP_H
3#define _UAPI_MPTCP_H3#define _UAPI_MPTCP_H
4 4
5#ifndef __KERNEL__
6#include <netinet/in.h> /* for sockaddr_in and sockaddr_in6 */
7#include <sys/socket.h> /* for struct sockaddr */
8#endif
9
5#include <linux/const.h>10#include <linux/const.h>
6#include <linux/types.h>11#include <linux/types.h>
7#include <linux/in.h> /* for sockaddr_in */12#include <linux/in.h> /* for sockaddr_in */
8#include <linux/in6.h> /* for sockaddr_in6 */13#include <linux/in6.h> /* for sockaddr_in6 */
9#include <linux/socket.h> /* for sockaddr_storage and sa_family */14#include <linux/socket.h> /* for sockaddr_storage and sa_family */
10 15
11#ifndef __KERNEL__
12#include <sys/socket.h> /* for struct sockaddr */
13#endif
14
15#define MPTCP_SUBFLOW_FLAG_MCAP_REM _BITUL(0)16#define MPTCP_SUBFLOW_FLAG_MCAP_REM _BITUL(0)
16#define MPTCP_SUBFLOW_FLAG_MCAP_LOC _BITUL(1)17#define MPTCP_SUBFLOW_FLAG_MCAP_LOC _BITUL(1)
17#define MPTCP_SUBFLOW_FLAG_JOIN_REM _BITUL(2)18#define MPTCP_SUBFLOW_FLAG_JOIN_REM _BITUL(2)