History

uapi glibc compat: fix outer guard of net device flags enum

Fix a wrong condition preventing the higher net device flags IFF_LOWER_UP etc to be defined if net/if.h is included before linux/if.h. The comment makes it clear the intention was to allow partial definition with either parts. This fixes compilation of userspace programs trying to use IFF_LOWER_UP, IFF_DORMANT or IFF_ECHO.

Jonas Gorski committed 9 years ago

Commit efc45151 parent 6b3374c1 file · +2 −2Browse files

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

Unified · Split

include/uapi/linux/if.h+2−2
@@ -31,7 +31,7 @@ · 30 unmodified lines
31#include <linux/hdlc/ioctl.h>31#include <linux/hdlc/ioctl.h>
32 32
33/* For glibc compatibility. An empty enum does not compile. */33/* For glibc compatibility. An empty enum does not compile. */
34#if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO != 0 && \34#if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO != 0 || \
35 __UAPI_DEF_IF_NET_DEVICE_FLAGS != 035 __UAPI_DEF_IF_NET_DEVICE_FLAGS != 0
36/**36/**
37 * enum net_device_flags - &struct net_device flags37 * enum net_device_flags - &struct net_device flags
@@ -99,7 +99,7 @@ enum net_device_flags { · 61 unmodified lines
99 IFF_ECHO = 1<<18, /* volatile */99 IFF_ECHO = 1<<18, /* volatile */
100#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */100#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */
101};101};
102#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO != 0 && __UAPI_DEF_IF_NET_DEVICE_FLAGS != 0 */102#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO != 0 || __UAPI_DEF_IF_NET_DEVICE_FLAGS != 0 */
103 103
104/* for compatibility with glibc net/if.h */104/* for compatibility with glibc net/if.h */
105#if __UAPI_DEF_IF_NET_DEVICE_FLAGS105#if __UAPI_DEF_IF_NET_DEVICE_FLAGS