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/linux (1 of 1 file). Show all

Unified · Split

include/uapi/linux/if.h+2−2
@@ -31,7 +31,7 @@ · 30 unmodified lines
3131 #include <linux/hdlc/ioctl.h>
3232
3333 /* 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 || \
3535 __UAPI_DEF_IF_NET_DEVICE_FLAGS != 0
3636 /**
3737 * enum net_device_flags - &struct net_device flags
@@ -99,7 +99,7 @@ enum net_device_flags { · 61 unmodified lines
9999 IFF_ECHO = 1<<18, /* volatile */
100100 #endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */
101101 };
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 */
103103
104104 /* for compatibility with glibc net/if.h */
105105 #if __UAPI_DEF_IF_NET_DEVICE_FLAGS