mirror of
https://git.kernel.org/pub/scm/network/iproute2/iproute2.git
synced 2024-11-27 11:54:53 +08:00
dcb: Do not leave ACKs in socket receive buffer
Originally, the dcb utility only stopped receiving messages from a
socket when it found the attribute it was looking for. Cited commit
changed that, so that the utility will also stop when seeing an ACK
(NLMSG_ERROR message), by setting the NLM_F_ACK flag on requests.
This is problematic because it means a successful request will leave an
ACK in the socket receive buffer, causing the next request to bail
before reading its response.
Fix that by not stopping when finding the required attribute in a
response. Instead, stop on the subsequent ACK.
Fixes: 84c0369726
("dcb: unblock mnl_socket_recvfrom if not message received")
Signed-off-by: Ido Schimmel <idosch@nvidia.com>
Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
This commit is contained in:
parent
22c877d93e
commit
d0e02f35af
@ -72,7 +72,7 @@ static int dcb_get_attribute_attr_ieee_cb(const struct nlattr *attr, void *data)
|
||||
|
||||
ga->payload = mnl_attr_get_payload(attr);
|
||||
ga->payload_len = mnl_attr_get_payload_len(attr);
|
||||
return MNL_CB_STOP;
|
||||
return MNL_CB_OK;
|
||||
}
|
||||
|
||||
static int dcb_get_attribute_attr_cb(const struct nlattr *attr, void *data)
|
||||
@ -126,7 +126,7 @@ static int dcb_set_attribute_attr_cb(const struct nlattr *attr, void *data)
|
||||
return MNL_CB_ERROR;
|
||||
}
|
||||
|
||||
return MNL_CB_STOP;
|
||||
return MNL_CB_OK;
|
||||
}
|
||||
|
||||
static int dcb_set_attribute_cb(const struct nlmsghdr *nlh, void *data)
|
||||
|
Loading…
Reference in New Issue
Block a user