]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - ip/xfrm_state.c
libnetlink: add size argument to rtnl_talk
[mirror_iproute2.git] / ip / xfrm_state.c
index 04af50b348e672213c5a9560afe8425ac997b3cc..d2831d007ced4a1d8e45051c99c7dbfb2ae99f3e 100644 (file)
@@ -688,7 +688,7 @@ static int xfrm_state_modify(int cmd, unsigned flags, int argc, char **argv)
        if (req.xsinfo.family == AF_UNSPEC)
                req.xsinfo.family = AF_INET;
 
-       if (rtnl_talk(&rth, &req.n, 0, 0, NULL) < 0)
+       if (rtnl_talk(&rth, &req.n, NULL, 0) < 0)
                exit(2);
 
        rtnl_close(&rth);
@@ -825,7 +825,7 @@ static int xfrm_state_allocspi(int argc, char **argv)
                req.xspi.info.family = AF_INET;
 
 
-       if (rtnl_talk(&rth, &req.n, 0, 0, res_n) < 0)
+       if (rtnl_talk(&rth, &req.n, res_n, sizeof(res_buf)) < 0)
                exit(2);
 
        if (xfrm_state_print(NULL, res_n, (void*)stdout) < 0) {
@@ -1015,7 +1015,7 @@ static int xfrm_state_get_or_delete(int argc, char **argv, int delete)
                req.xsid.family = AF_INET;
 
        if (delete) {
-               if (rtnl_talk(&rth, &req.n, 0, 0, NULL) < 0)
+               if (rtnl_talk(&rth, &req.n, NULL, 0) < 0)
                        exit(2);
        } else {
                char buf[NLMSG_BUF_SIZE];
@@ -1023,7 +1023,7 @@ static int xfrm_state_get_or_delete(int argc, char **argv, int delete)
 
                memset(buf, 0, sizeof(buf));
 
-               if (rtnl_talk(&rth, &req.n, 0, 0, res_n) < 0)
+               if (rtnl_talk(&rth, &req.n, res_n, sizeof(req)) < 0)
                        exit(2);
 
                if (xfrm_state_print(NULL, res_n, (void*)stdout) < 0) {
@@ -1297,7 +1297,7 @@ static int xfrm_sad_getinfo(int argc, char **argv)
        if (rtnl_open_byproto(&rth, 0, NETLINK_XFRM) < 0)
                exit(1);
 
-       if (rtnl_talk(&rth, &req.n, 0, 0, &req.n) < 0)
+       if (rtnl_talk(&rth, &req.n, &req.n, sizeof(req)) < 0)
                exit(2);
 
        print_sadinfo(&req.n, (void*)stdout);
@@ -1351,7 +1351,7 @@ static int xfrm_state_flush(int argc, char **argv)
                fprintf(stderr, "Flush state with XFRM-PROTO value \"%s\"\n",
                        strxf_xfrmproto(req.xsf.proto));
 
-       if (rtnl_talk(&rth, &req.n, 0, 0, NULL) < 0)
+       if (rtnl_talk(&rth, &req.n, NULL, 0) < 0)
                exit(2);
 
        rtnl_close(&rth);