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.
This commit is contained in:
parent
67bd56f214
commit
5151cbc2f6
1 changed files with 4 additions and 0 deletions
|
@ -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;
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue