From: "Ryan O'Hara" <rohara@redhat.com>
To: Jesper Dangaard Brouer <brouer@redhat.com>
Cc: Simon Horman <horms@verge.net.au>,
Wensong Zhang <wensong@linux-vs.org>,
Thomas Graf <tgraf@redhat.com>, Julian Anastasov <ja@ssi.bg>,
Jesper Dangaard Brouer <jbrouer@redhat.com>,
lvs-devel@vger.kernel.org, Daniel Borkmann <dborkman@redhat.com>
Subject: Re: [PATCH] ipvsadm: fix compiling tool on distros with only libnl-1
Date: Thu, 8 Aug 2013 15:00:17 -0500 [thread overview]
Message-ID: <20130808200017.GA3075@redhat.com> (raw)
In-Reply-To: <20130808121054.26226.26508.stgit@localhost>
On Thu, Aug 08, 2013 at 02:10:54PM +0200, Jesper Dangaard Brouer wrote:
> Some distros have not moved to libnl3 yet. Add a fallback option
> for compiling on distro's with only libnl1.
>
> Using pkg-config to detect what versions of libnl is available.
>
> Signed-off-by: Jesper Dangaard Brouer <brouer@redhat.com>
This patch looks fine, but I think it only solves part of the
problem. The Makefile still contains following code:
ifneq (0,$(HAVE_NL))
LIBS += -lnl
endif
First, I think the HAVE_NL conditional can be removed. But more
importantly the correct netlink library should be appended to the
LIBS variable. With the current code we'll always link against
libnl-1.
On Fedora with both libnl and libnl-3 installed:
$ pkg-config --libs libnl-3.0
-lnl-3
$ pkg-config --libs libnl-1
-lnl
Ryan
> ---
> libipvs/Makefile | 5 +++++
> libipvs/libipvs.c | 5 +++++
> 2 files changed, 10 insertions(+)
>
> diff --git a/libipvs/Makefile b/libipvs/Makefile
> index a527a7f..eafc3e5 100644
> --- a/libipvs/Makefile
> +++ b/libipvs/Makefile
> @@ -10,6 +10,11 @@ INCLUDE += $(shell if [ -f ../../ip_vs.h ]; then \
> echo "-I../../."; fi;)
> DEFINES = $(shell if [ ! -f ../../ip_vs.h ]; then \
> echo "-DHAVE_NET_IP_VS_H"; fi;)
> +DEFINES += $(shell if which pkg-config > /dev/null 2>&1; then \
> + if pkg-config --exists libnl-3.0; then :; \
> + elif pkg-config --exists libnl-2.0; then :; \
> + elif pkg-config --exists libnl-1; \
> + then echo "-DFALLBACK_LIBNL1"; fi; fi)
>
> .PHONY = all clean install dist distclean rpm rpms
> STATIC_LIB = libipvs.a
> diff --git a/libipvs/libipvs.c b/libipvs/libipvs.c
> index c3c3b0a..2b066d2 100644
> --- a/libipvs/libipvs.c
> +++ b/libipvs/libipvs.c
> @@ -32,6 +32,11 @@ static void* ipvs_func = NULL;
> struct ip_vs_getinfo ipvs_info;
>
> #ifdef LIBIPVS_USE_NL
> +#ifdef FALLBACK_LIBNL1
> +#define nl_sock nl_handle
> +#define nl_socket_alloc nl_handle_alloc
> +#define nl_socket_free nl_handle_destroy
> +#endif
> static struct nl_sock *sock = NULL;
> static int family, try_nl = 1;
> #endif
>
next prev parent reply other threads:[~2013-08-08 20:00 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-08 4:59 [PATCH] Allow override of CFLAGS Simon Horman
2013-08-08 6:13 ` Julian Anastasov
2013-08-08 7:34 ` Simon Horman
2013-08-08 8:30 ` Julian Anastasov
2013-08-08 7:47 ` Daniel Borkmann
2013-08-08 8:19 ` ipvsadm git head not compiling on RHEL6 Jesper Dangaard Brouer
2013-08-08 8:27 ` Daniel Borkmann
2013-08-08 9:00 ` Simon Horman
2013-08-08 9:17 ` Jesper Dangaard Brouer
2013-08-08 9:23 ` Daniel Borkmann
2013-08-08 9:33 ` Thomas Graf
2013-08-08 9:00 ` [PATCH] Allow override of CFLAGS Simon Horman
2013-08-08 9:05 ` Daniel Borkmann
2013-08-08 12:10 ` [PATCH] ipvsadm: fix compiling tool on distros with only libnl-1 Jesper Dangaard Brouer
2013-08-08 12:23 ` Daniel Borkmann
2013-08-08 20:00 ` Ryan O'Hara [this message]
2013-08-09 5:47 ` Simon Horman
2013-08-09 6:27 ` [PATCH v2] " Jesper Dangaard Brouer
2013-08-09 8:32 ` Simon Horman
2013-08-09 6:43 ` [PATCH] " Jesper Dangaard Brouer
2013-08-09 6:55 ` Daniel Borkmann
2013-08-09 8:31 ` Simon Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20130808200017.GA3075@redhat.com \
--to=rohara@redhat.com \
--cc=brouer@redhat.com \
--cc=dborkman@redhat.com \
--cc=horms@verge.net.au \
--cc=ja@ssi.bg \
--cc=jbrouer@redhat.com \
--cc=lvs-devel@vger.kernel.org \
--cc=tgraf@redhat.com \
--cc=wensong@linux-vs.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.