mirror of
https://github.com/troglobit/finit.git
synced 2026-11-07 16:01:08 +00:00
plugins: netlink: minor refactor, collapse for-loop
Signed-off-by: Joachim Wiberg <troglobit@gmail.com>
This commit is contained in:
1 parent
70a1acc210
commit
1abd43384b
1 file changed
+4
-5
+4
-5
@@ -131,8 +131,10 @@ static void nl_link(struct nlmsghdr *nlmsg, ssize_t len)
|
|||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
while (RTA_OK(a, la)) {
|
for (; RTA_OK(a, la); a = RTA_NEXT(a, la)) {
|
||||||
if (a->rta_type == IFLA_IFNAME) {
|
if (a->rta_type != IFLA_IFNAME)
|
||||||
|
continue;
|
||||||
|
|
||||||
strlcpy(ifname, RTA_DATA(a), sizeof(ifname));
|
strlcpy(ifname, RTA_DATA(a), sizeof(ifname));
|
||||||
switch (nlmsg->nlmsg_type) {
|
switch (nlmsg->nlmsg_type) {
|
||||||
case RTM_NEWLINK:
|
case RTM_NEWLINK:
|
||||||
@@ -167,9 +169,6 @@ static void nl_link(struct nlmsghdr *nlmsg, ssize_t len)
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
a = RTA_NEXT(a, la);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
static void nl_callback(void *arg, int sd, int events)
|
static void nl_callback(void *arg, int sd, int events)
|
||||||
|
|||||||
Reference in new issue
Block a user