summaryrefslogtreecommitdiffstats
path: root/examples/rtnl-link-dump.c
diff options
context:
space:
mode:
authorPablo Neira Ayuso <pablo@netfilter.org>2010-04-12 18:06:28 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2010-04-12 18:06:28 +0200
commit1f09fdccb75005a53ba2bb90fb61d4e6f45e8e14 (patch)
treeb24b4a6d6eb7da977d2c1a493d4f8cd3d4a2deba /examples/rtnl-link-dump.c
parent0f53ba01cd326130bdf68c2ed69e13007fe75fa3 (diff)
remove mnl_nlmsg_get_len() function
Remove mnl_nlmsg_get_len() since it returns a field of a structure that is public (struct nlmsghdr). We can directly access the header fields and they are not likely to change in the future (at least for this version of Netlink I think). Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'examples/rtnl-link-dump.c')
-rw-r--r--examples/rtnl-link-dump.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/rtnl-link-dump.c b/examples/rtnl-link-dump.c
index d888cbc..2b9f472 100644
--- a/examples/rtnl-link-dump.c
+++ b/examples/rtnl-link-dump.c
@@ -39,7 +39,7 @@ static int data_cb(const struct nlmsghdr *nlh, void *data)
{
struct nlattr *tb[IFLA_MAX+1] = {};
struct ifinfomsg *ifm = mnl_nlmsg_get_payload(nlh);
- int len = mnl_nlmsg_get_len(nlh);
+ int len = nlh->nlmsg_len;
struct nlattr *attr;
printf("index=%d type=%d flags=%d family=%d ",
@@ -90,7 +90,7 @@ int main()
}
portid = mnl_socket_get_portid(nl);
- if (mnl_socket_sendto(nl, nlh, mnl_nlmsg_get_len(nlh)) < 0) {
+ if (mnl_socket_sendto(nl, nlh, nlh->nlmsg_len) < 0) {
perror("mnl_socket_send");
exit(EXIT_FAILURE);
}