summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorThomas Graf <tgraf@redhat.com>2011-09-14 11:43:10 +0200
committerThomas Graf <tgraf@redhat.com>2011-09-14 11:43:10 +0200
commit5151cbc2f6e5ca81cfc66eeb1d4a5c6c4e886108 (patch)
tree75fb83222665496c75a4b7865c15490e84852dd1
parent67bd56f21463bc93c81b4a7a0bf3d51d56120b58 (diff)
downloadlibnl-5151cbc2f6e5ca81cfc66eeb1d4a5c6c4e886108.tar.gz
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.
-rw-r--r--lib/route/link.c4
1 files changed, 4 insertions, 0 deletions
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;
}