提交 46f5f9c1 编写于 作者: G Guillaume Nault 提交者: Dmitry Kozlov

iputils: remove unnecessary NLM_F_ACK

Using NLM_F_ACK in these functions is confusing because they don't
parse any netlink response.

In fact, NLM_F_ACK is only required internally by rtnl_talk(), which
already adds it when its 'answer' parameter is NULL. Therefore it's
useless to manually set it in functions that don't set 'answer'.
Signed-off-by: NGuillaume Nault <g.nault@alphalink.fr>
上级 412e908e
......@@ -169,7 +169,7 @@ int __export iplink_set_mtu(int ifindex, int mtu)
memset(&req, 0, sizeof(req) - 1024);
req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg));
req.n.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
req.n.nlmsg_flags = NLM_F_REQUEST;
req.n.nlmsg_type = RTM_SETLINK;
req.i.ifi_family = AF_UNSPEC;
req.i.ifi_index = ifindex;
......@@ -200,7 +200,7 @@ int __export iplink_vlan_add(const char *ifname, int ifindex, int vid)
memset(&req, 0, sizeof(req) - 4096);
req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg));
req.n.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK | NLM_F_CREATE | NLM_F_EXCL;
req.n.nlmsg_flags = NLM_F_REQUEST | NLM_F_CREATE | NLM_F_EXCL;
req.n.nlmsg_type = RTM_NEWLINK;
req.i.ifi_family = AF_UNSPEC;
......@@ -243,7 +243,7 @@ int __export iplink_vlan_del(int ifindex)
memset(&req, 0, sizeof(req) - 4096);
req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct ifinfomsg));
req.n.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
req.n.nlmsg_flags = NLM_F_REQUEST;
req.n.nlmsg_type = RTM_DELLINK;
req.i.ifi_family = AF_UNSPEC;
req.i.ifi_index = ifindex;
......@@ -516,7 +516,7 @@ int __export iproute_del(int ifindex, in_addr_t src, in_addr_t dst, in_addr_t gw
memset(&req, 0, sizeof(req) - 4096);
req.n.nlmsg_len = NLMSG_LENGTH(sizeof(struct rtmsg));
req.n.nlmsg_flags = NLM_F_REQUEST | NLM_F_ACK;
req.n.nlmsg_flags = NLM_F_REQUEST;
req.n.nlmsg_type = RTM_DELROUTE;
req.i.rtm_family = AF_INET;
req.i.rtm_table = RT_TABLE_MAIN;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册