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.
Showing the changes to include/uapi (1 of 1 file). Show all
Unified · Split
| @@ -2,16 +2,17 @@ · 1 unmodified line | ||
| 2 | 2 | #ifndef _UAPI_MPTCP_H |
| 3 | 3 | #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 | 10 | #include <linux/const.h> |
| 6 | 11 | #include <linux/types.h> |
| 7 | 12 | #include <linux/in.h> /* for sockaddr_in */ |
| 8 | 13 | #include <linux/in6.h> /* for sockaddr_in6 */ |
| 9 | 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 | 16 | #define MPTCP_SUBFLOW_FLAG_MCAP_REM _BITUL(0) |
| 16 | 17 | #define MPTCP_SUBFLOW_FLAG_MCAP_LOC _BITUL(1) |
| 17 | 18 | #define MPTCP_SUBFLOW_FLAG_JOIN_REM _BITUL(2) |