summaryrefslogtreecommitdiff
path: root/dcb
diff options
context:
space:
mode:
authorJunxin Chen <chenjunxin1@huawei.com>2022-10-19 09:20:08 +0800
committerStephen Hemminger <stephen@networkplumber.org>2022-10-20 15:55:44 -0700
commit84c036972659ae9a98aac3cef983cc7dd8e14c53 (patch)
treee84cd7f893dc1560f4c156fa8c564598a3945e33 /dcb
parent3ab6d5d02f34c75c2547f470c8fe83a59cc9fdeb (diff)
downloadiproute2-84c036972659ae9a98aac3cef983cc7dd8e14c53.tar.gz
dcb: unblock mnl_socket_recvfrom if not message received
Currently, the dcb command sinks to the kernel through the netlink to obtain information. However, if the kernel fails to obtain infor- mation or is not processed, the dcb command is suspended. For example, if we don't implement dcbnl_ops->ieee_getpfc in the kernel, the command "dcb pfc show dev eth1" will be stuck and subsequent commands cannot be executed. This patch adds the NLM_F_ACK flag to the netlink in mnlu_msg_prepare to ensure that the kernel responds to user requests. After the problem is solved, the execution result is as follows: $ dcb pfc show dev eth1 Attribute not found: Success Fixes: 67033d1c1c8a ("Add skeleton of a new tool, dcb") Signed-off-by: Junxin Chen <chenjunxin1@huawei.com> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
Diffstat (limited to 'dcb')
-rw-r--r--dcb/dcb.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/dcb/dcb.c b/dcb/dcb.c
index 8d75ab0a..391fd954 100644
--- a/dcb/dcb.c
+++ b/dcb/dcb.c
@@ -156,7 +156,8 @@ static struct nlmsghdr *dcb_prepare(struct dcb *dcb, const char *dev,
};
struct nlmsghdr *nlh;
- nlh = mnlu_msg_prepare(dcb->buf, nlmsg_type, NLM_F_REQUEST, &dcbm, sizeof(dcbm));
+ nlh = mnlu_msg_prepare(dcb->buf, nlmsg_type, NLM_F_REQUEST | NLM_F_ACK,
+ &dcbm, sizeof(dcbm));
mnl_attr_put_strz(nlh, DCB_ATTR_IFNAME, dev);
return nlh;
}