Merge branch 'main' into next

Signed-off-by: David Ahern <dsahern@kernel.org>
This commit is contained in:
David Ahern 2021-03-15 15:08:01 +00:00
commit 27ca8989c1
3 changed files with 9 additions and 7 deletions

View File

@ -65,8 +65,7 @@ static void dcb_app_table_fini(struct dcb_app_table *tab)
static int dcb_app_table_push(struct dcb_app_table *tab, struct dcb_app *app)
{
struct dcb_app *apps = reallocarray(tab->apps, tab->n_apps + 1,
sizeof(*tab->apps));
struct dcb_app *apps = realloc(tab->apps, (tab->n_apps + 1) * sizeof(*tab->apps));
if (apps == NULL) {
perror("Cannot allocate APP table");

View File

@ -796,9 +796,10 @@ int print_route(struct nlmsghdr *n, void *arg)
"%s/%u", rt_addr_n2a_rta(family, tb[RTA_DST]),
r->rtm_dst_len);
} else {
format_host_rta_r(family, tb[RTA_DST],
const char *hostname = format_host_rta_r(family, tb[RTA_DST],
b1, sizeof(b1));
if (hostname)
strncpy(b1, hostname, sizeof(b1) - 1);
}
} else if (r->rtm_dst_len) {
snprintf(b1, sizeof(b1), "0/%d ", r->rtm_dst_len);
@ -818,8 +819,10 @@ int print_route(struct nlmsghdr *n, void *arg)
rt_addr_n2a_rta(family, tb[RTA_SRC]),
r->rtm_src_len);
} else {
format_host_rta_r(family, tb[RTA_SRC],
const char *hostname = format_host_rta_r(family, tb[RTA_SRC],
b1, sizeof(b1));
if (hostname)
strncpy(b1, hostname, sizeof(b1) - 1);
}
print_color_string(PRINT_ANY, color,
"from", "from %s ", b1);

View File

@ -675,7 +675,7 @@ static int cake_print_xstats(struct qdisc_util *qu, FILE *f,
/* class stats */
if (st[TCA_CAKE_STATS_DEFICIT])
print_int(PRINT_ANY, "deficit", " deficit %u",
print_int(PRINT_ANY, "deficit", " deficit %d",
GET_STAT_S32(DEFICIT));
if (st[TCA_CAKE_STATS_COBALT_COUNT])
print_uint(PRINT_ANY, "count", " count %u",
@ -688,7 +688,7 @@ static int cake_print_xstats(struct qdisc_util *qu, FILE *f,
if (drop_next < 0) {
print_string(PRINT_FP, NULL, " drop_next -%s",
sprint_time(drop_next, b1));
sprint_time(-drop_next, b1));
} else {
print_uint(PRINT_JSON, "drop_next", NULL,
drop_next);