aboutsummaryrefslogtreecommitdiff
path: root/networking/libiproute/ipaddress.c
diff options
context:
space:
mode:
Diffstat (limited to 'networking/libiproute/ipaddress.c')
-rw-r--r--networking/libiproute/ipaddress.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/networking/libiproute/ipaddress.c b/networking/libiproute/ipaddress.c
index 8364f6a3e..7b7e0154b 100644
--- a/networking/libiproute/ipaddress.c
+++ b/networking/libiproute/ipaddress.c
@@ -23,6 +23,7 @@
23 23
24struct filter_t { 24struct filter_t {
25 char *label; 25 char *label;
26 /* Flush cmd buf. If !NULL, print_addrinfo() constructs flush commands in it */
26 char *flushb; 27 char *flushb;
27 struct rtnl_handle *rth; 28 struct rtnl_handle *rth;
28 int scope, scopemask; 29 int scope, scopemask;
@@ -34,6 +35,8 @@ struct filter_t {
34 smallint showqueue; 35 smallint showqueue;
35 smallint oneline; 36 smallint oneline;
36 smallint up; 37 smallint up;
38 /* Misnomer. Does not mean "flushed something" */
39 /* More like "flush commands were constructed by print_addrinfo()" */
37 smallint flushed; 40 smallint flushed;
38 inet_prefix pfx; 41 inet_prefix pfx;
39} FIX_ALIASING; 42} FIX_ALIASING;
@@ -201,7 +204,7 @@ static NOINLINE int print_linkinfo(const struct nlmsghdr *n)
201 204
202static int flush_update(void) 205static int flush_update(void)
203{ 206{
204 if (rtnl_send(G_filter.rth, G_filter.flushb, G_filter.flushp) < 0) { 207 if (rtnl_send_check(G_filter.rth, G_filter.flushb, G_filter.flushp) < 0) {
205 bb_perror_msg("can't send flush request"); 208 bb_perror_msg("can't send flush request");
206 return -1; 209 return -1;
207 } 210 }
@@ -510,7 +513,6 @@ int FAST_FUNC ipaddr_list_or_flush(char **argv, int flush)
510 xrtnl_dump_filter(&rth, store_nlmsg, &ainfo); 513 xrtnl_dump_filter(&rth, store_nlmsg, &ainfo);
511 } 514 }
512 515
513
514 if (G_filter.family && G_filter.family != AF_PACKET) { 516 if (G_filter.family && G_filter.family != AF_PACKET) {
515 struct nlmsg_list **lp; 517 struct nlmsg_list **lp;
516 lp = &linfo; 518 lp = &linfo;
@@ -571,8 +573,8 @@ int FAST_FUNC ipaddr_list_or_flush(char **argv, int flush)
571 573
572 for (l = linfo; l; l = l->next) { 574 for (l = linfo; l; l = l->next) {
573 if ((oneline && G_filter.family != AF_PACKET) 575 if ((oneline && G_filter.family != AF_PACKET)
574 || (print_linkinfo(&l->h) == 0)
575 /* ^^^^^^^^^ "ip -oneline a" does not print link info */ 576 /* ^^^^^^^^^ "ip -oneline a" does not print link info */
577 || (print_linkinfo(&l->h) == 0)
576 ) { 578 ) {
577 struct ifinfomsg *ifi = NLMSG_DATA(&l->h); 579 struct ifinfomsg *ifi = NLMSG_DATA(&l->h);
578 if (G_filter.family != AF_PACKET) 580 if (G_filter.family != AF_PACKET)