Skip to content

Commit efc4515

Browse files
KanjiMonsterdavem330
authored andcommitted
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. Fixes: 4a91cb6 ("uapi glibc compat: fix compile errors when glibc net/if.h included before linux/if.h") Signed-off-by: Jonas Gorski <jonas.gorski@gmail.com> Reviewed-by: Mikko Rapeli <mikko.rapeli@iki.fi> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 6b3374c commit efc4515

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

  • include/uapi/linux

‎include/uapi/linux/if.h‎

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@
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 {
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

0 commit comments

Comments
 (0)