]> granicus.if.org Git - libnl/commitdiff
genl: Wait for ACK after successful ctrl reply
authorThomas Graf <tgraf@redhat.com>
Wed, 13 Jun 2012 11:04:03 +0000 (13:04 +0200)
committerThomas Graf <tgraf@redhat.com>
Wed, 13 Jun 2012 11:19:06 +0000 (13:19 +0200)
Signed-off-by: Thomas Graf <tgraf@suug.ch>
lib/genl/ctrl.c

index 3902f09b731f9f6ef02f7e86f9e21241a5bdead9..e11c5c6d678dc9d2b0bc8d0d8106340a1ebc8c40 100644 (file)
@@ -267,7 +267,14 @@ static struct genl_family *genl_ctrl_probe_by_name(struct nl_sock *sk, const cha
 
        nl_cb_set(cb, NL_CB_VALID, NL_CB_CUSTOM, probe_response, (void *)ret);
 
-       nl_recvmsgs(sk, cb);
+       rc = nl_recvmsgs(sk, cb);
+       if (rc < 0)
+               goto out_cb_free;
+
+       /* If search was successful, request may be ACKed after data */
+       rc = wait_for_ack(sk);
+       if (rc < 0)
+               goto out_cb_free;
 
        if (genl_family_get_id(ret) != 0) {
                nlmsg_free(msg);