]> git.proxmox.com Git - mirror_iproute2.git/commitdiff
uapi: wrap SIOCGSTAMP and SIOCGSTAMPNS in ifndef
authorDavid Ahern <dsahern@gmail.com>
Thu, 2 May 2019 23:13:21 +0000 (16:13 -0700)
committerDavid Ahern <dsahern@gmail.com>
Fri, 3 May 2019 15:23:08 +0000 (08:23 -0700)
These warnings:
    ../include/uapi/linux/sockios.h:42:0: warning: "SIOCGSTAMP" redefined
    ../include/uapi/linux/sockios.h:43:0: warning: "SIOCGSTAMPNS" redefined

are from kernel commit 0768e17073dc5 ("net: socket: implement 64-bit
timestamps"). This commit moved the definitions of SIOCGSTAMP and
SIOCGSTAMPNS from include/asm-generic/sockios.h to
include/uapi/linux/sockios.h. Older OS'es already define them in
/usr/include/asm-generic/sockios.h resulting in ugly compile errors now:

In file included from ll_types.c:24:0:
../include/uapi/linux/sockios.h:42:0: warning: "SIOCGSTAMP" redefined
 #define SIOCGSTAMP SIOCGSTAMP_OLD

In file included from /usr/include/x86_64-linux-gnu/asm/sockios.h:1:0,
                 from /usr/include/asm-generic/socket.h:5,
                 from /usr/include/x86_64-linux-gnu/asm/socket.h:1,
                 from /usr/include/x86_64-linux-gnu/bits/socket.h:368,
                 from /usr/include/x86_64-linux-gnu/sys/socket.h:38,
                 from ll_types.c:17:
/usr/include/asm-generic/sockios.h:11:0: note: this is the location of the previous definition
 #define SIOCGSTAMP 0x8906  /* Get stamp (timeval) */

so wrap them in #ifndef.

Signed-off-by: David Ahern <dsahern@gmail.com>
include/uapi/linux/sockios.h

index 7d1bccbbef781f2c0064b568ee22dba135b5b87e..35d7a60f9b7a12f68e30e46f0b8ab19bd06f8bd7 100644 (file)
 
 #if __BITS_PER_LONG == 64 || (defined(__x86_64__) && defined(__ILP32__))
 /* on 64-bit and x32, avoid the ?: operator */
+#ifndef SIOCGSTAMP
 #define SIOCGSTAMP     SIOCGSTAMP_OLD
+#endif
+#ifndef SIOCGSTAMPNS
 #define SIOCGSTAMPNS   SIOCGSTAMPNS_OLD
+#endif
 #else
 #define SIOCGSTAMP     ((sizeof(struct timeval))  == 8 ? \
                         SIOCGSTAMP_OLD   : SIOCGSTAMP_NEW)