Commit aa38c3ee authored by Masatake YAMATO's avatar Masatake YAMATO Committed by Stephen Hemminger

using NLM_F_DUMP flag constant in libnetlink.c

This is trivial patch for libnetlink.c in iproute2.

In iproute2/include/linux/netlink.h NLM_F_DUMP is defines as:

   #define NLM_F_DUMP	(NLM_F_ROOT|NLM_F_MATCH)

It is not used in libnetlink.c. If used, the code becomes a bit easier
to read.
Signed-off-by: default avatarMasatake YAMATO <yamato@redhat.com>
parent 1c4cbdbc
...@@ -99,7 +99,7 @@ int rtnl_wilddump_request(struct rtnl_handle *rth, int family, int type) ...@@ -99,7 +99,7 @@ int rtnl_wilddump_request(struct rtnl_handle *rth, int family, int type)
memset(&req, 0, sizeof(req)); memset(&req, 0, sizeof(req));
req.nlh.nlmsg_len = sizeof(req); req.nlh.nlmsg_len = sizeof(req);
req.nlh.nlmsg_type = type; req.nlh.nlmsg_type = type;
req.nlh.nlmsg_flags = NLM_F_ROOT|NLM_F_MATCH|NLM_F_REQUEST; req.nlh.nlmsg_flags = NLM_F_DUMP|NLM_F_REQUEST;
req.nlh.nlmsg_pid = 0; req.nlh.nlmsg_pid = 0;
req.nlh.nlmsg_seq = rth->dump = ++rth->seq; req.nlh.nlmsg_seq = rth->dump = ++rth->seq;
req.g.rtgen_family = family; req.g.rtgen_family = family;
...@@ -162,7 +162,7 @@ int rtnl_dump_request(struct rtnl_handle *rth, int type, void *req, int len) ...@@ -162,7 +162,7 @@ int rtnl_dump_request(struct rtnl_handle *rth, int type, void *req, int len)
nlh.nlmsg_len = NLMSG_LENGTH(len); nlh.nlmsg_len = NLMSG_LENGTH(len);
nlh.nlmsg_type = type; nlh.nlmsg_type = type;
nlh.nlmsg_flags = NLM_F_ROOT|NLM_F_MATCH|NLM_F_REQUEST; nlh.nlmsg_flags = NLM_F_DUMP|NLM_F_REQUEST;
nlh.nlmsg_pid = 0; nlh.nlmsg_pid = 0;
nlh.nlmsg_seq = rth->dump = ++rth->seq; nlh.nlmsg_seq = rth->dump = ++rth->seq;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment