Merge remote-tracking branch 'main/main' into next

Signed-off-by: David Ahern <dsahern@kernel.org>
This commit is contained in:
David Ahern 2023-02-18 10:03:08 -07:00
commit 0b257557d8
6 changed files with 15 additions and 7 deletions

View File

@ -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)));
}
}

View File

@ -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

View File

@ -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);
}

View File

@ -1099,6 +1099,8 @@ next:
if (answer)
*answer = (struct nlmsghdr *)buf;
else
free(buf);
return 0;
}

View File

@ -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

View File

@ -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