Merge branch 'main' into next
Signed-off-by: David Ahern <dsahern@kernel.org>
This commit is contained in:
commit
27ca8989c1
|
|
@ -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)
|
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,
|
struct dcb_app *apps = realloc(tab->apps, (tab->n_apps + 1) * sizeof(*tab->apps));
|
||||||
sizeof(*tab->apps));
|
|
||||||
|
|
||||||
if (apps == NULL) {
|
if (apps == NULL) {
|
||||||
perror("Cannot allocate APP table");
|
perror("Cannot allocate APP table");
|
||||||
|
|
|
||||||
|
|
@ -796,9 +796,10 @@ int print_route(struct nlmsghdr *n, void *arg)
|
||||||
"%s/%u", rt_addr_n2a_rta(family, tb[RTA_DST]),
|
"%s/%u", rt_addr_n2a_rta(family, tb[RTA_DST]),
|
||||||
r->rtm_dst_len);
|
r->rtm_dst_len);
|
||||||
} else {
|
} else {
|
||||||
format_host_rta_r(family, tb[RTA_DST],
|
const char *hostname = format_host_rta_r(family, tb[RTA_DST],
|
||||||
b1, sizeof(b1));
|
b1, sizeof(b1));
|
||||||
|
if (hostname)
|
||||||
|
strncpy(b1, hostname, sizeof(b1) - 1);
|
||||||
}
|
}
|
||||||
} else if (r->rtm_dst_len) {
|
} else if (r->rtm_dst_len) {
|
||||||
snprintf(b1, sizeof(b1), "0/%d ", 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]),
|
rt_addr_n2a_rta(family, tb[RTA_SRC]),
|
||||||
r->rtm_src_len);
|
r->rtm_src_len);
|
||||||
} else {
|
} else {
|
||||||
format_host_rta_r(family, tb[RTA_SRC],
|
const char *hostname = format_host_rta_r(family, tb[RTA_SRC],
|
||||||
b1, sizeof(b1));
|
b1, sizeof(b1));
|
||||||
|
if (hostname)
|
||||||
|
strncpy(b1, hostname, sizeof(b1) - 1);
|
||||||
}
|
}
|
||||||
print_color_string(PRINT_ANY, color,
|
print_color_string(PRINT_ANY, color,
|
||||||
"from", "from %s ", b1);
|
"from", "from %s ", b1);
|
||||||
|
|
|
||||||
|
|
@ -675,7 +675,7 @@ static int cake_print_xstats(struct qdisc_util *qu, FILE *f,
|
||||||
|
|
||||||
/* class stats */
|
/* class stats */
|
||||||
if (st[TCA_CAKE_STATS_DEFICIT])
|
if (st[TCA_CAKE_STATS_DEFICIT])
|
||||||
print_int(PRINT_ANY, "deficit", " deficit %u",
|
print_int(PRINT_ANY, "deficit", " deficit %d",
|
||||||
GET_STAT_S32(DEFICIT));
|
GET_STAT_S32(DEFICIT));
|
||||||
if (st[TCA_CAKE_STATS_COBALT_COUNT])
|
if (st[TCA_CAKE_STATS_COBALT_COUNT])
|
||||||
print_uint(PRINT_ANY, "count", " count %u",
|
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) {
|
if (drop_next < 0) {
|
||||||
print_string(PRINT_FP, NULL, " drop_next -%s",
|
print_string(PRINT_FP, NULL, " drop_next -%s",
|
||||||
sprint_time(drop_next, b1));
|
sprint_time(-drop_next, b1));
|
||||||
} else {
|
} else {
|
||||||
print_uint(PRINT_JSON, "drop_next", NULL,
|
print_uint(PRINT_JSON, "drop_next", NULL,
|
||||||
drop_next);
|
drop_next);
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue