diff options
author | Denys Vlasenko <vda.linux@googlemail.com> | 2023-04-23 12:37:46 +0200 |
---|---|---|
committer | Denys Vlasenko <vda.linux@googlemail.com> | 2023-04-23 12:37:46 +0200 |
commit | 7ddd233c807f71fc5a303e89ce166bc1cbccf89e (patch) | |
tree | 6a9657a856ccc97d0256280523783756034ef05e /networking/libiproute/ipaddress.c | |
parent | d2b81b3dc2b31d32e1060d3ea8bd998d30a37d8a (diff) | |
download | busybox-w32-7ddd233c807f71fc5a303e89ce166bc1cbccf89e.tar.gz busybox-w32-7ddd233c807f71fc5a303e89ce166bc1cbccf89e.tar.bz2 busybox-w32-7ddd233c807f71fc5a303e89ce166bc1cbccf89e.zip |
ip: code shrink
function old new delta
ipaddr_list_or_flush 1089 1079 -10
Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to '')
-rw-r--r-- | networking/libiproute/ipaddress.c | 10 |
1 files changed, 5 insertions, 5 deletions
diff --git a/networking/libiproute/ipaddress.c b/networking/libiproute/ipaddress.c index ecc3848ff..c8d77422c 100644 --- a/networking/libiproute/ipaddress.c +++ b/networking/libiproute/ipaddress.c | |||
@@ -44,7 +44,7 @@ struct filter_t { | |||
44 | int ifindex; | 44 | int ifindex; |
45 | family_t family; | 45 | family_t family; |
46 | smallint showqueue; | 46 | smallint showqueue; |
47 | smallint oneline; | 47 | /*smallint oneline; - redundant, global "oneline" flag is enough */ |
48 | smallint up; | 48 | smallint up; |
49 | /* Misnomer. Does not mean "flushed something" */ | 49 | /* Misnomer. Does not mean "flushed something" */ |
50 | /* More like "flush commands were constructed by print_addrinfo()" */ | 50 | /* More like "flush commands were constructed by print_addrinfo()" */ |
@@ -297,7 +297,7 @@ static int FAST_FUNC print_addrinfo(const struct sockaddr_nl *who UNUSED_PARAM, | |||
297 | if (n->nlmsg_type == RTM_DELADDR) | 297 | if (n->nlmsg_type == RTM_DELADDR) |
298 | printf("Deleted "); | 298 | printf("Deleted "); |
299 | 299 | ||
300 | if (G_filter.oneline) | 300 | if (/*G_filter.*/ oneline) |
301 | printf("%u: %s", ifa->ifa_index, ll_index_to_name(ifa->ifa_index)); | 301 | printf("%u: %s", ifa->ifa_index, ll_index_to_name(ifa->ifa_index)); |
302 | if (ifa->ifa_family == AF_INET) | 302 | if (ifa->ifa_family == AF_INET) |
303 | printf(" inet "); | 303 | printf(" inet "); |
@@ -427,10 +427,10 @@ static int FAST_FUNC store_nlmsg(const struct sockaddr_nl *who, struct nlmsghdr | |||
427 | return 0; | 427 | return 0; |
428 | } | 428 | } |
429 | 429 | ||
430 | static void ipaddr_reset_filter(int _oneline) | 430 | static void ipaddr_reset_filter(void /*int _oneline*/) |
431 | { | 431 | { |
432 | memset(&G_filter, 0, sizeof(G_filter)); | 432 | memset(&G_filter, 0, sizeof(G_filter)); |
433 | G_filter.oneline = _oneline; | 433 | /*G_filter.oneline = _oneline;*/ |
434 | } | 434 | } |
435 | 435 | ||
436 | /* Return value becomes exitcode. It's okay to not return at all */ | 436 | /* Return value becomes exitcode. It's okay to not return at all */ |
@@ -444,7 +444,7 @@ int FAST_FUNC ipaddr_list_or_flush(char **argv, int flush) | |||
444 | struct rtnl_handle rth; | 444 | struct rtnl_handle rth; |
445 | char *filter_dev = NULL; | 445 | char *filter_dev = NULL; |
446 | 446 | ||
447 | ipaddr_reset_filter(oneline); | 447 | ipaddr_reset_filter(/*oneline*/); |
448 | G_filter.showqueue = 1; | 448 | G_filter.showqueue = 1; |
449 | 449 | ||
450 | if (G_filter.family == AF_UNSPEC) | 450 | if (G_filter.family == AF_UNSPEC) |