Re: [libvirt PATCH v2 19/56] src: conditionalize use of net/if.h

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Tue, Jan 28, 2020 at 01:11:00PM +0000, Daniel P. Berrangé wrote:
> The net/if.h is not portable so we must check for its
> existance and avoid using it when missing. Some use
> of net/if.h was redundant and could be removed.
> 
> Signed-off-by: Daniel P. Berrangé <berrange@xxxxxxxxxx>
> ---
>  build-aux/syntax-check.mk  | 2 +-
>  configure.ac               | 1 +
>  src/util/virnetdev.c       | 1 -
>  src/util/virnetdev.h       | 4 +++-
>  src/util/virnetdevbridge.c | 4 +++-
>  src/util/virnetdevip.c     | 4 +++-
>  src/util/virnetdevtap.c    | 4 +++-
>  7 files changed, 14 insertions(+), 6 deletions(-)

Another mess with ifdefs in our code.  The header net/if.h provides:

    struct ifreq{} which we guard with HAVE_STRUCT_IFREQ,

    if_nametoindex which we guard with HAVE_STRUCT_IFREQ or
        with __linux__ && HAVE_LIBNL or with IFDATA_DRIVERNAME

    if_indextoname which we guard with HAVE_IF_INDEXTONAME

Commit <ccaf0beec84b3f55f5206a71e2f1b768cc58cdda> removed the
HAVE_NET_IF_H guard for net/if.h in favor of the gnulib module which
is essentially reverted by this patch.

I would like to cleanup this ifdef guard mess someday but that is out of
scope of this patch series.  I just wanted to point it out.

Reviewed-by: Pavel Hrdina <phrdina@xxxxxxxxxx>

Attachment: signature.asc
Description: PGP signature


[Index of Archives]     [Virt Tools]     [Libvirt Users]     [Lib OS Info]     [Fedora Users]     [Fedora Desktop]     [Fedora SELinux]     [Big List of Linux Books]     [Yosemite News]     [KDE Users]     [Fedora Tools]

  Powered by Linux