diff options
Diffstat (limited to 'examples/rtnl-link-set.c')
-rw-r--r-- | examples/rtnl-link-set.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/examples/rtnl-link-set.c b/examples/rtnl-link-set.c index 36bf355..d7327dd 100644 --- a/examples/rtnl-link-set.c +++ b/examples/rtnl-link-set.c @@ -14,7 +14,7 @@ int main(int argc, char *argv[]) struct nlmsghdr *nlh; struct ifinfomsg *ifm; int ret; - unsigned int seq, oper; + unsigned int seq, portid, oper; if (argc != 3) { printf("Usage: %s [ifname] [up|down]\n", argv[0]); @@ -50,6 +50,7 @@ int main(int argc, char *argv[]) perror("mnl_socket_bind"); exit(EXIT_FAILURE); } + portid = mnl_socket_get_portid(nl); mnl_nlmsg_print(nlh); @@ -64,7 +65,7 @@ int main(int argc, char *argv[]) exit(EXIT_FAILURE); } - ret = mnl_cb_run(buf, ret, seq, NULL, NULL); + ret = mnl_cb_run(buf, ret, seq, portid, NULL, NULL); if (ret == -1){ perror("callback"); exit(EXIT_FAILURE); |