aboutgitcodebugslistschat
path: root/netlink.c
diff options
context:
space:
mode:
authorDavid Gibson <david@gibson.dropbear.id.au>2022-09-28 14:33:19 +1000
committerStefano Brivio <sbrivio@redhat.com>2022-09-29 12:22:01 +0200
commiteb5e1230386ce2eafa2ef1770bb5ffd3e918fdc6 (patch)
treea128ae0781a1f43d38396285fa080cdbd3d02ff7 /netlink.c
parent68ef4931cb8bcbc53c0d2b6078946d836da7b5d9 (diff)
downloadpasst-eb5e1230386ce2eafa2ef1770bb5ffd3e918fdc6.tar
passt-eb5e1230386ce2eafa2ef1770bb5ffd3e918fdc6.tar.gz
passt-eb5e1230386ce2eafa2ef1770bb5ffd3e918fdc6.tar.bz2
passt-eb5e1230386ce2eafa2ef1770bb5ffd3e918fdc6.tar.lz
passt-eb5e1230386ce2eafa2ef1770bb5ffd3e918fdc6.tar.xz
passt-eb5e1230386ce2eafa2ef1770bb5ffd3e918fdc6.tar.zst
passt-eb5e1230386ce2eafa2ef1770bb5ffd3e918fdc6.zip
cppcheck: Reduce scope of some variables
Minor style improvement suggested by cppcheck. Signed-off-by: David Gibson <david@gibson.dropbear.id.au> Signed-off-by: Stefano Brivio <sbrivio@redhat.com>
Diffstat (limited to 'netlink.c')
-rw-r--r--netlink.c3
1 files changed, 1 insertions, 2 deletions
diff --git a/netlink.c b/netlink.c
index 8ad6a0c..6f7ada8 100644
--- a/netlink.c
+++ b/netlink.c
@@ -147,7 +147,6 @@ unsigned int nl_get_ext_if(sa_family_t af)
};
struct nlmsghdr *nh;
struct rtattr *rta;
- struct rtmsg *rtm;
char buf[BUFSIZ];
ssize_t n;
size_t na;
@@ -158,7 +157,7 @@ unsigned int nl_get_ext_if(sa_family_t af)
nh = (struct nlmsghdr *)buf;
for ( ; NLMSG_OK(nh, n); nh = NLMSG_NEXT(nh, n)) {
- rtm = (struct rtmsg *)NLMSG_DATA(nh);
+ struct rtmsg *rtm = (struct rtmsg *)NLMSG_DATA(nh);
if (rtm->rtm_dst_len || rtm->rtm_family != af)
continue;