diff options
author | David Ahern <dsahern@kernel.org> | 2023-02-18 10:03:08 -0700 |
---|---|---|
committer | David Ahern <dsahern@kernel.org> | 2023-02-18 10:03:08 -0700 |
commit | 0b257557d8662e5ce2e65ec80343b771be2c56dd (patch) | |
tree | 01ea4b9ce4323fc89ae24b66261e81acf4a55176 | |
parent | b96b06830fe1f51a13f1e09c7a155bc5561db14a (diff) | |
parent | c0a06885b944e1f14440f601a0b5266233814d54 (diff) | |
download | iproute2-0b257557d8662e5ce2e65ec80343b771be2c56dd.tar.gz |
Merge remote-tracking branch 'main/main' into next
Signed-off-by: David Ahern <dsahern@kernel.org>
-rw-r--r-- | bridge/mdb.c | 2 | ||||
-rw-r--r-- | include/uapi/linux/ip.h | 1 | ||||
-rw-r--r-- | ip/iproute.c | 5 | ||||
-rw-r--r-- | lib/libnetlink.c | 2 | ||||
-rw-r--r-- | man/man8/ip-link.8.in | 6 | ||||
-rw-r--r-- | testsuite/tools/Makefile | 6 |
6 files changed, 15 insertions, 7 deletions
diff --git a/bridge/mdb.c b/bridge/mdb.c index f323cd091..9b5503657 100644 --- a/bridge/mdb.c +++ b/bridge/mdb.c @@ -221,7 +221,7 @@ static void print_mdb_entry(FILE *f, int ifindex, const struct br_mdb_entry *e, __u8 rtprot = rta_getattr_u8(tb[MDBA_MDB_EATTR_RTPROT]); SPRINT_BUF(rtb); - print_string(PRINT_ANY, "protocol", " proto %s ", + print_string(PRINT_ANY, "protocol", " proto %s", rtnl_rtprot_n2a(rtprot, rtb, sizeof(rtb))); } } diff --git a/include/uapi/linux/ip.h b/include/uapi/linux/ip.h index 8cd20fb0c..9b4dd89eb 100644 --- a/include/uapi/linux/ip.h +++ b/include/uapi/linux/ip.h @@ -18,6 +18,7 @@ #ifndef _LINUX_IP_H #define _LINUX_IP_H #include <linux/types.h> +#include <linux/stddef.h> #include <asm/byteorder.h> #define IPTOS_TOS_MASK 0x1E diff --git a/ip/iproute.c b/ip/iproute.c index 0bab0fdfa..a7cd9543a 100644 --- a/ip/iproute.c +++ b/ip/iproute.c @@ -748,6 +748,7 @@ int print_route(struct nlmsghdr *n, void *arg) int ret; SPRINT_BUF(b1); + SPRINT_BUF(b2); if (n->nlmsg_type != RTM_NEWROUTE && n->nlmsg_type != RTM_DELROUTE) { fprintf(stderr, "Not a route: %08x %08x %08x\n", @@ -809,7 +810,7 @@ int print_route(struct nlmsghdr *n, void *arg) r->rtm_dst_len); } else { const char *hostname = format_host_rta_r(family, tb[RTA_DST], - b1, sizeof(b1)); + b2, sizeof(b2)); if (hostname) strncpy(b1, hostname, sizeof(b1) - 1); } @@ -832,7 +833,7 @@ int print_route(struct nlmsghdr *n, void *arg) r->rtm_src_len); } else { const char *hostname = format_host_rta_r(family, tb[RTA_SRC], - b1, sizeof(b1)); + b2, sizeof(b2)); if (hostname) strncpy(b1, hostname, sizeof(b1) - 1); } diff --git a/lib/libnetlink.c b/lib/libnetlink.c index c89760436..68360b0f4 100644 --- a/lib/libnetlink.c +++ b/lib/libnetlink.c @@ -1099,6 +1099,8 @@ next: if (answer) *answer = (struct nlmsghdr *)buf; + else + free(buf); return 0; } diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in index ac33b4385..eeddf4932 100644 --- a/man/man8/ip-link.8.in +++ b/man/man8/ip-link.8.in @@ -88,11 +88,11 @@ ip-link \- network device configuration .RB "[ " txqueuelen .IR PACKETS " ]" .br -.RB "[ " max_gso_size +.RB "[ " gso_max_size .IR BYTES " ]" -.RB "[ " max_gso_segs +.RB "[ " gso_max_segs .IR SEGMENTS " ]" -.RB "[ " max_gro_size +.RB "[ " gro_max_size .IR BYTES " ]" .br .RB "[ " name diff --git a/testsuite/tools/Makefile b/testsuite/tools/Makefile index e0162ccc2..0356ddaea 100644 --- a/testsuite/tools/Makefile +++ b/testsuite/tools/Makefile @@ -1,9 +1,13 @@ # SPDX-License-Identifier: GPL-2.0 CFLAGS= +LDLIBS= include ../../config.mk +ifeq ($(HAVE_CAP),y) +LDLIBS+= -lcap +endif generate_nlmsg: generate_nlmsg.c ../../lib/libnetlink.a ../../lib/libutil.a - $(QUIET_CC)$(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -I../../include -I../../include/uapi -include../../include/uapi/linux/netlink.h -o $@ $^ -lmnl -lcap + $(QUIET_CC)$(CC) $(CPPFLAGS) $(CFLAGS) $(EXTRA_CFLAGS) -I../../include -I../../include/uapi -include../../include/uapi/linux/netlink.h -o $@ $^ -lmnl $(LDLIBS) clean: rm -f generate_nlmsg |