libnetlink: reduce size of message sent to kernel
Fixes commit 246f57c4086d99fa ("ip link: Add support for kernel
side filtering").
This patch reduce the size of message sent to kernel space. Before this
patch, for command: 'ip link show', we will sent 1056 bytes. With this
patch, we only need to send 40 bytes.
Signed-off-by: Zhang Shengju <zhangshengju@cmss.chinamobile.com>
This commit is contained in:
parent
2d98dd4821
commit
1b109a30bf
|
|
@ -149,7 +149,7 @@ int rtnl_wilddump_req_filter_fn(struct rtnl_handle *rth, int family, int type,
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
return send(rth->fd, (void*)&req, sizeof(req), 0);
|
return send(rth->fd, &req, req.nlh.nlmsg_len, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
int rtnl_wilddump_stats_req_filter(struct rtnl_handle *rth, int fam, int type,
|
int rtnl_wilddump_stats_req_filter(struct rtnl_handle *rth, int fam, int type,
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue