Skip to content

Commit

Permalink
Use unsigned conversion specifier for nlmsg_pid
Browse files Browse the repository at this point in the history
nlmsg_pid is __u32, so let's use %u instead of %d.

Signed-off-by: Toshiaki Makita <[email protected]>
  • Loading branch information
Toshiaki Makita authored and drzaeus77 committed Aug 1, 2017
1 parent bb9b92a commit 890c76a
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cc/libbpf.c
Original file line number Diff line number Diff line change
Expand Up @@ -803,7 +803,7 @@ int bpf_attach_xdp(const char *dev_name, int progfd, uint32_t flags) {
for (nh = (struct nlmsghdr *)buf; NLMSG_OK(nh, len);
nh = NLMSG_NEXT(nh, len)) {
if (nh->nlmsg_pid != sa.nl_pid) {
fprintf(stderr, "bpf: Wrong pid %d, expected %d\n",
fprintf(stderr, "bpf: Wrong pid %u, expected %u\n",
nh->nlmsg_pid, sa.nl_pid);
errno = EBADMSG;
goto cleanup;
Expand Down

0 comments on commit 890c76a

Please sign in to comment.