diff --git a/devlink/Makefile b/devlink/Makefile index d540feb3..d37a4b4d 100644 --- a/devlink/Makefile +++ b/devlink/Makefile @@ -7,6 +7,7 @@ ifeq ($(HAVE_MNL),y) DEVLINKOBJ = devlink.o mnlg.o TARGETS += devlink +LDLIBS += -lm endif diff --git a/devlink/devlink.c b/devlink/devlink.c index e5294d53..b294fcd8 100644 --- a/devlink/devlink.c +++ b/devlink/devlink.c @@ -3743,7 +3743,7 @@ static int cmd_dev_flash_status_cb(const struct nlmsghdr *nlh, void *data) } } if (total) { - pr_out_tty(" %3lu%%", (done * 100) / total); + pr_out_tty(" %3"PRIu64"%%", (done * 100) / total); ctx->last_pc = 1; } else { ctx->last_pc = 0; @@ -3798,7 +3798,7 @@ static void cmd_dev_flash_time_elapsed(struct cmd_dev_flash_status_ctx *ctx) */ if (!ctx->status_msg_timeout) { len = snprintf(msg, sizeof(msg), - " ( %lum %lus )", elapsed_m, elapsed_s); + " ( %"PRIu64"m %"PRIu64"s )", elapsed_m, elapsed_s); } else if (res.tv_sec <= ctx->status_msg_timeout) { uint64_t timeout_m, timeout_s; @@ -3806,11 +3806,11 @@ static void cmd_dev_flash_time_elapsed(struct cmd_dev_flash_status_ctx *ctx) timeout_s = ctx->status_msg_timeout % 60; len = snprintf(msg, sizeof(msg), - " ( %lum %lus : %lum %lus )", + " ( %"PRIu64"m %"PRIu64"s : %"PRIu64"m %"PRIu64"s )", elapsed_m, elapsed_s, timeout_m, timeout_s); } else { len = snprintf(msg, sizeof(msg), - " ( %lum %lus : timeout reached )", elapsed_m, elapsed_s); + " ( %"PRIu64"m %"PRIu64"s : timeout reached )", elapsed_m, elapsed_s); } ctx->elapsed_time_msg_len = len; diff --git a/include/utils.h b/include/utils.h index 5f5d8fa0..28eaad8e 100644 --- a/include/utils.h +++ b/include/utils.h @@ -8,6 +8,7 @@ #include #include #include +#include #ifdef HAVE_LIBBSD #include @@ -267,7 +268,7 @@ void print_nlmsg_timestamp(FILE *fp, const struct nlmsghdr *n); unsigned int print_name_and_link(const char *fmt, const char *name, struct rtattr *tb[]); -#define BIT(nr) (1UL << (nr)) +#define BIT(nr) (UINT64_C(1) << (nr)) #define ARRAY_SIZE(x) (sizeof(x) / sizeof((x)[0])) diff --git a/include/version.h b/include/version.h index b5113411..bbf1d1cc 100644 --- a/include/version.h +++ b/include/version.h @@ -1 +1 @@ -static const char version[] = "5.12.0"; +static const char version[] = "5.13.0"; diff --git a/lib/fs.c b/lib/fs.c index 05697a7e..f6f5f8a0 100644 --- a/lib/fs.c +++ b/lib/fs.c @@ -364,4 +364,3 @@ char *get_task_name(pid_t pid) return comm; } - diff --git a/lib/libgenl.c b/lib/libgenl.c index 4c51d47a..fca07f9f 100644 --- a/lib/libgenl.c +++ b/lib/libgenl.c @@ -3,6 +3,7 @@ * libgenl.c GENL library */ +#include #include #include #include @@ -84,6 +85,7 @@ static int genl_parse_grps(struct rtattr *attr, const char *name, unsigned int * } } + errno = ENOENT; return -1; } @@ -108,17 +110,22 @@ int genl_add_mcast_grp(struct rtnl_handle *grth, __u16 fnum, const char *group) ghdr = NLMSG_DATA(answer); len = answer->nlmsg_len; - if (answer->nlmsg_type != GENL_ID_CTRL) + if (answer->nlmsg_type != GENL_ID_CTRL) { + errno = EINVAL; goto err_free; + } len -= NLMSG_LENGTH(GENL_HDRLEN); - if (len < 0) + if (len < 0) { + errno = EINVAL; goto err_free; + } attrs = (struct rtattr *) ((char *) ghdr + GENL_HDRLEN); parse_rtattr(tb, CTRL_ATTR_MAX, attrs, len); if (tb[CTRL_ATTR_MCAST_GROUPS] == NULL) { + errno = ENOENT; fprintf(stderr, "Missing mcast groups TLV\n"); goto err_free; } diff --git a/man/man8/ip-link.8.in b/man/man8/ip-link.8.in index b257f573..572bed87 100644 --- a/man/man8/ip-link.8.in +++ b/man/man8/ip-link.8.in @@ -251,12 +251,12 @@ ip-link \- network device configuration .in -8 .ti -8 -.BI "ip link property add" +.BI "ip link property add dev " DEVICE .RB "[ " altname .IR NAME " .. ]" .ti -8 -.BI "ip link property del" +.BI "ip link property del dev " DEVICE .RB "[ " altname .IR NAME " .. ]" diff --git a/man/man8/ss.8 b/man/man8/ss.8 index 42aac6de..d399381d 100644 --- a/man/man8/ss.8 +++ b/man/man8/ss.8 @@ -343,7 +343,7 @@ and is therefore a useful reference. Switch to the specified network namespace name. .TP .B \-b, \-\-bpf -Show socket BPF filters (only administrators are allowed to get these +Show socket classic BPF filters (only administrators are allowed to get these information). .TP .B \-4, \-\-ipv4