All of lore.kernel.org
 help / color / mirror / Atom feed
From: Eric Dumazet <eric.dumazet@gmail.com>
To: Stephen Hemminger <shemminger@vyatta.com>
Cc: "David S. Miller" <davem@davemloft.net>,
	Linux Netdev List <netdev@vger.kernel.org>
Subject: [PATCH iproute2] libnetlink: fix rtnl_send_check()
Date: Sun, 08 Nov 2009 07:18:50 +0100	[thread overview]
Message-ID: <4AF662CA.3010208@gmail.com> (raw)

We currently cannot flush more than ~64 addresses on a device, with
strange status.

# ip -stats addr flush dev eth3
Failed to send flush request: Success
Flush terminated

Problem is in rtnl_send_check(), where a return -1; is misplaced.

After patch, we can flush 64000 addresses without any problem.

# ip -stats addr flush dev eth3

*** Round 1, deleting 32338 addresses ***

*** Round 2, deleting 16168 addresses ***

*** Round 3, deleting 8082 addresses ***

*** Round 4, deleting 4058 addresses ***

*** Round 5, deleting 2028 addresses ***

*** Round 6, deleting 918 addresses ***

*** Round 7, deleting 278 addresses ***

*** Round 8, deleting 130 addresses ***
*** Flush is complete after 8 rounds ***


Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
---
diff --git a/lib/libnetlink.c b/lib/libnetlink.c
index b68e2fd..100dd40 100644
--- a/lib/libnetlink.c
+++ b/lib/libnetlink.c
@@ -137,8 +137,8 @@ int rtnl_send_check(struct rtnl_handle *rth, const char *buf, int len)
 				fprintf(stderr, "ERROR truncated\n");
 			else 
 				errno = -err->error;
+			return -1;
 		}
-		return -1;
 	}
 
 	return 0;

                 reply	other threads:[~2009-11-08  6:18 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=4AF662CA.3010208@gmail.com \
    --to=eric.dumazet@gmail.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    --cc=shemminger@vyatta.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.