summaryrefslogtreecommitdiffhomepage
path: root/networking/libiproute/ipaddress.c
diff options
context:
space:
mode:
authorDenys Vlasenko <vda.linux@googlemail.com>2019-05-22 13:54:46 +0200
committerDenys Vlasenko <vda.linux@googlemail.com>2019-05-22 13:54:46 +0200
commit028c5aa18b5273c029f0278232d922ee1a164de6 (patch)
treef57dbcb9445ce4878f74789872ed123491f705c2 /networking/libiproute/ipaddress.c
parent84fc645605827d53aa3e749dfff309978b1bc73d (diff)
ip: use rtnl_send_check() on flush commands, closes 6962
function old new delta rtnl_send_check - 160 +160 xrtnl_wilddump_request 64 66 +2 ipneigh_list_or_flush 714 706 -8 rtnl_send 69 - -69 ------------------------------------------------------------------------------ (add/remove: 1/1 grow/shrink: 1/1 up/down: 162/-77) Total: 85 bytes Signed-off-by: Denys Vlasenko <vda.linux@googlemail.com>
Diffstat (limited to 'networking/libiproute/ipaddress.c')
-rw-r--r--networking/libiproute/ipaddress.c6
1 files changed, 4 insertions, 2 deletions
diff --git a/networking/libiproute/ipaddress.c b/networking/libiproute/ipaddress.c
index fc6a4fb77..7b7e0154b 100644
--- a/networking/libiproute/ipaddress.c
+++ b/networking/libiproute/ipaddress.c
@@ -23,6 +23,7 @@
struct filter_t {
char *label;
+ /* Flush cmd buf. If !NULL, print_addrinfo() constructs flush commands in it */
char *flushb;
struct rtnl_handle *rth;
int scope, scopemask;
@@ -34,6 +35,8 @@ struct filter_t {
smallint showqueue;
smallint oneline;
smallint up;
+ /* Misnomer. Does not mean "flushed something" */
+ /* More like "flush commands were constructed by print_addrinfo()" */
smallint flushed;
inet_prefix pfx;
} FIX_ALIASING;
@@ -201,7 +204,7 @@ static NOINLINE int print_linkinfo(const struct nlmsghdr *n)
static int flush_update(void)
{
- if (rtnl_send(G_filter.rth, G_filter.flushb, G_filter.flushp) < 0) {
+ if (rtnl_send_check(G_filter.rth, G_filter.flushb, G_filter.flushp) < 0) {
bb_perror_msg("can't send flush request");
return -1;
}
@@ -510,7 +513,6 @@ int FAST_FUNC ipaddr_list_or_flush(char **argv, int flush)
xrtnl_dump_filter(&rth, store_nlmsg, &ainfo);
}
-
if (G_filter.family && G_filter.family != AF_PACKET) {
struct nlmsg_list **lp;
lp = &linfo;