From 5151cbc2f6e5ca81cfc66eeb1d4a5c6c4e886108 Mon Sep 17 00:00:00 2001 From: Thomas Graf Date: Wed, 14 Sep 2011 11:43:10 +0200 Subject: [PATCH] link: Eat ACK followed by RTM_NEWLINK when requesting single link When requesting a single link with RTM_GETLINK (no dump) the RTM_NEWLINK carrying the answer will be followed by an ACK we have to wait for. --- lib/route/link.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/route/link.c b/lib/route/link.c index 3e070e5..00beb08 100644 --- a/lib/route/link.c +++ b/lib/route/link.c @@ -996,6 +996,10 @@ int rtnl_link_get_kernel(struct nl_sock *sk, int ifindex, const char *name, /* We have used link_msg_parser(), object is definitely a link */ *result = (struct rtnl_link *) obj; + /* If an object has been returned, we also need to wait for the ACK */ + if (err == 0 && obj) + nl_wait_for_ack(sk); + return 0; } -- 2.40.0