]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - ip/iproute.c
ipnetns: parse nsid as a signed integer
[mirror_iproute2.git] / ip / iproute.c
index 699635923764c0ac7a38b9b3c49b49694e20d15e..b039f35b0ccdfcef5007fb2210ee09995a023851 100644 (file)
@@ -708,7 +708,7 @@ static void print_rta_multipath(FILE *fp, const struct rtmsg *r,
        }
 }
 
-int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
+int print_route(struct nlmsghdr *n, void *arg)
 {
        FILE *fp = (FILE *)arg;
        struct rtmsg *r = NLMSG_DATA(n);
@@ -923,15 +923,15 @@ int print_route(const struct sockaddr_nl *who, struct nlmsghdr *n, void *arg)
                print_rt_pref(fp, rta_getattr_u8(tb[RTA_PREF]));
 
        if (tb[RTA_TTL_PROPAGATE]) {
-               bool propogate = rta_getattr_u8(tb[RTA_TTL_PROPAGATE]);
+               bool propagate = rta_getattr_u8(tb[RTA_TTL_PROPAGATE]);
 
                if (is_json_context())
                        print_bool(PRINT_JSON, "ttl-propogate", NULL,
-                                  propogate);
+                                  propagate);
                else
                        print_string(PRINT_FP, NULL,
                                     "ttl-propogate %s",
-                                    propogate ? "enabled" : "disabled");
+                                    propagate ? "enabled" : "disabled");
        }
 
        print_string(PRINT_FP, NULL, "\n", NULL);
@@ -1580,8 +1580,7 @@ static int iproute_flush_cache(void)
 
 static __u32 route_dump_magic = 0x45311224;
 
-static int save_route(const struct sockaddr_nl *who, struct nlmsghdr *n,
-                     void *arg)
+static int save_route(struct nlmsghdr *n, void *arg)
 {
        int ret;
        int len = n->nlmsg_len;
@@ -2082,7 +2081,7 @@ static int iproute_get(int argc, char **argv)
                int len = answer->nlmsg_len;
                struct rtattr *tb[RTA_MAX+1];
 
-               if (print_route(NULL, answer, (void *)stdout) < 0) {
+               if (print_route(answer, (void *)stdout) < 0) {
                        fprintf(stderr, "An error :-)\n");
                        free(answer);
                        return -1;
@@ -2126,7 +2125,7 @@ static int iproute_get(int argc, char **argv)
                        return -2;
        }
 
-       if (print_route(NULL, answer, (void *)stdout) < 0) {
+       if (print_route(answer, (void *)stdout) < 0) {
                fprintf(stderr, "An error :-)\n");
                free(answer);
                return -1;
@@ -2144,8 +2143,7 @@ static int rtattr_cmp(const struct rtattr *rta1, const struct rtattr *rta2)
        return memcmp(RTA_DATA(rta1), RTA_DATA(rta2), RTA_PAYLOAD(rta1));
 }
 
-static int restore_handler(const struct sockaddr_nl *nl,
-                          struct rtnl_ctrl_data *ctrl,
+static int restore_handler(struct rtnl_ctrl_data *ctrl,
                           struct nlmsghdr *n, void *arg)
 {
        struct rtmsg *r = NLMSG_DATA(n);
@@ -2231,11 +2229,10 @@ static int iproute_restore(void)
        return 0;
 }
 
-static int show_handler(const struct sockaddr_nl *nl,
-                       struct rtnl_ctrl_data *ctrl,
+static int show_handler(struct rtnl_ctrl_data *ctrl,
                        struct nlmsghdr *n, void *arg)
 {
-       print_route(nl, n, stdout);
+       print_route(n, stdout);
        return 0;
 }