The code was always building without libmnl support, so it was
doing nothing.
Fixes: b6432e68ac2f ("iproute: Add support for extended ack to rtnl_talk")
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
LDLIBS += $(LIBNETLINK)
ifeq ($(HAVE_ELF),y)
-CFLAGS += -DHAVE_ELF
-LDLIBS += -lelf
+ CFLAGS += -DHAVE_ELF
+ LDLIBS += -lelf
+endif
+
+ifeq ($(HAVE_MNL),y)
+ CFLAGS += -DHAVE_LIBMNL $(shell $(PKG_CONFIG) libmnl --cflags)
+ LDLIBS += $(shell $(PKG_CONFIG) libmnl --libs)
endif
all: Config
CFLAGS += -DHAVE_SETNS
endif
-ifeq ($(HAVE_MNL),y)
- CFLAGS += $(shell $(PKG_CONFIG) libmnl --cflags)
- LDLIBS += $(shell $(PKG_CONFIG) libmnl --libs)
-else
-@warn "libmnl required for error support"
-endif
-
CFLAGS += -fPIC
UTILOBJ = utils.o rt_names.o ll_types.o ll_proto.o ll_addr.o \
return errfn(errmsg, off, err_nlh);
}
#else
+#warning "libmnl required for error support"
+
/* No extended error ack without libmnl */
static int nl_dump_ext_err(const struct nlmsghdr *nlh, nl_ext_ack_fn_t errfn)
{
$(QUIET_LINK)$(CC) $^ $(LDFLAGS) $(LDLIBS) -o $@
nstat: nstat.c
- $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o nstat nstat.c $(LIBNETLINK) -lm
+ $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o nstat nstat.c $(LDLIBS) -lm
ifstat: ifstat.c
- $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o ifstat ifstat.c $(LIBNETLINK) -lm
+ $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o ifstat ifstat.c $(LDLIBS) -lm
rtacct: rtacct.c
- $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o rtacct rtacct.c $(LIBNETLINK) -lm
+ $(QUIET_CC)$(CC) $(CFLAGS) $(LDFLAGS) -o rtacct rtacct.c $(LDLIBS) -lm
arpd: arpd.c
- $(QUIET_CC)$(CC) $(CFLAGS) -I$(DBM_INCLUDE) $(LDFLAGS) -o arpd arpd.c $(LIBNETLINK) -ldb -lpthread
+ $(QUIET_CC)$(CC) $(CFLAGS) -I$(DBM_INCLUDE) $(LDFLAGS) -o arpd arpd.c $(LDLIBS) -ldb -lpthread
ssfilter.c: ssfilter.y
$(QUIET_YACC)bison ssfilter.y -o ssfilter.c