From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751845AbcLEReG (ORCPT ); Mon, 5 Dec 2016 12:34:06 -0500 Received: from mail.kapsi.fi ([217.30.184.167]:60575 "EHLO mail.kapsi.fi" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751080AbcLEReF (ORCPT ); Mon, 5 Dec 2016 12:34:05 -0500 Date: Mon, 5 Dec 2016 19:34:02 +0200 From: Mikko Rapeli To: Jonas Gorski Cc: linux-kernel@vger.kernel.org, "David S. Miller" , Zhang Shengju Subject: Re: [PATCH] uapi glibc compat: fix outer guard of net device flags enum Message-ID: <20161205173401.GU8342@lakka.kapsi.fi> References: <1480782705-2638-1-git-send-email-jonas.gorski@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <1480782705-2638-1-git-send-email-jonas.gorski@gmail.com> X-SA-Exim-Connect-IP: 2001:1bc8:1004::1 X-SA-Exim-Mail-From: mikko.rapeli@iki.fi X-SA-Exim-Scanned: No (on mail.kapsi.fi); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Sat, Dec 03, 2016 at 05:31:45PM +0100, Jonas Gorski wrote: > 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: 4a91cb61bb99 ("uapi glibc compat: fix compile errors when glibc net/if.h included before linux/if.h") > Signed-off-by: Jonas Gorski Reviewed-by: Mikko Rapeli Yep, sorry about the logic error. Thanks for the fix! -Mikko > --- > Patch applies cleanly to both linus' HEAD and net-next. I wasn't sure > which one's the right one. > > include/uapi/linux/if.h | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/include/uapi/linux/if.h b/include/uapi/linux/if.h > index e601c8c..1158a04 100644 > --- a/include/uapi/linux/if.h > +++ b/include/uapi/linux/if.h > @@ -31,7 +31,7 @@ > #include > > /* For glibc compatibility. An empty enum does not compile. */ > -#if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO != 0 && \ > +#if __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO != 0 || \ > __UAPI_DEF_IF_NET_DEVICE_FLAGS != 0 > /** > * enum net_device_flags - &struct net_device flags > @@ -99,7 +99,7 @@ enum net_device_flags { > IFF_ECHO = 1<<18, /* volatile */ > #endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO */ > }; > -#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO != 0 && __UAPI_DEF_IF_NET_DEVICE_FLAGS != 0 */ > +#endif /* __UAPI_DEF_IF_NET_DEVICE_FLAGS_LOWER_UP_DORMANT_ECHO != 0 || __UAPI_DEF_IF_NET_DEVICE_FLAGS != 0 */ > > /* for compatibility with glibc net/if.h */ > #if __UAPI_DEF_IF_NET_DEVICE_FLAGS > -- > 2.1.4 >