]> git.ipfire.org Git - thirdparty/iproute2.git/commit
dcb: Do not leave ACKs in socket receive buffer
authorIdo Schimmel <idosch@nvidia.com>
Tue, 27 Dec 2022 11:03:18 +0000 (13:03 +0200)
committerStephen Hemminger <stephen@networkplumber.org>
Thu, 29 Dec 2022 16:44:23 +0000 (08:44 -0800)
commitd0e02f35af33b8957cc9f52af07b0b81d557ad3b
tree0102ad9107ec58db84d5efb142d323d934794e82
parent22c877d93eedccebcf0260ce8c37b9b1f908a76f
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: 84c036972659 ("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>
dcb/dcb.c