summaryrefslogtreecommitdiffstats
path: root/examples/rtnl-route-dump.c
diff options
context:
space:
mode:
Diffstat (limited to 'examples/rtnl-route-dump.c')
-rw-r--r--examples/rtnl-route-dump.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/examples/rtnl-route-dump.c b/examples/rtnl-route-dump.c
index ddfbaa9..4241cf8 100644
--- a/examples/rtnl-route-dump.c
+++ b/examples/rtnl-route-dump.c
@@ -101,7 +101,7 @@ static int data_cb(const struct nlmsghdr *nlh, void *data)
{
struct nlattr *tb[RTA_MAX+1] = {};
struct rtmsg *rm = mnl_nlmsg_get_payload(nlh);
- int len = mnl_nlmsg_get_len(nlh);
+ int len = nlh->nlmsg_len;
struct nlattr *attr;
/* protocol family = AF_INET | AF_INET6 */
@@ -219,7 +219,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);
}