[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <20241206023046.2539-1-liujing@cmss.chinamobile.com>
Date: Fri, 6 Dec 2024 10:30:46 +0800
From: liujing <liujing@...s.chinamobile.com>
To: ast@...nel.org,
daniel@...earbox.net,
davem@...emloft.net,
kuba@...nel.org,
hawk@...nel.org,
john.fastabend@...il.com,
andrii@...nel.org,
martin.lau@...ux.dev,
eddyz87@...il.com,
song@...nel.org,
yonghong.song@...ux.dev,
kpsingh@...nel.org,
sdf@...ichev.me,
haoluo@...gle.com,
jolsa@...nel.org
Cc: netdev@...r.kernel.org,
bpf@...r.kernel.org,
linux-kernel@...r.kernel.org,
liujing <liujing@...s.chinamobile.com>
Subject: [PATCH] samples/bpf: Modify the incorrect format specifier
Replace %d with %u in snprintf() because it is "unsigned int".
Signed-off-by: liujing <liujing@...s.chinamobile.com>
diff --git a/samples/bpf/xdp_router_ipv4_user.c b/samples/bpf/xdp_router_ipv4_user.c
index 266fdd0b025d..3fc1d37fee7c 100644
--- a/samples/bpf/xdp_router_ipv4_user.c
+++ b/samples/bpf/xdp_router_ipv4_user.c
@@ -134,11 +134,11 @@ static void read_route(struct nlmsghdr *nh, int nll)
*((__be32 *)RTA_DATA(rt_attr)));
break;
case RTA_OIF:
- sprintf(ifs, "%u",
+ sprintf(ifs, "%d",
*((int *)RTA_DATA(rt_attr)));
break;
case RTA_METRICS:
- sprintf(metrics, "%u",
+ sprintf(metrics, "%d",
*((int *)RTA_DATA(rt_attr)));
default:
break;
--
2.27.0
Powered by blists - more mailing lists