]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - tc/m_xt_old.c
lib: introduce print_nl
[mirror_iproute2.git] / tc / m_xt_old.c
index e9cc624ecd934951041816f36659401e681aa012..313bea61cc7e05bb8ed24168b48dd320c63a31bb 100644 (file)
@@ -13,7 +13,6 @@
 /*XXX: in the future (xtables 1.4.3?) get rid of everything tagged
  * as TC_CONFIG_XT_H */
 
-#include <syslog.h>
 #include <sys/socket.h>
 #include <netinet/in.h>
 #include <arpa/inet.h>
@@ -214,7 +213,7 @@ static int parse_ipt(struct action_util *a, int *argc_p,
        int rargc = *argc_p;
        char **argv = *argv_p;
        int argc = 0, iargc = 0;
-       char k[16];
+       char k[FILTER_NAMESZ];
        int size = 0;
        int iok = 0, ok = 0;
        __u32 hook = 0, index = 0;
@@ -309,8 +308,7 @@ static int parse_ipt(struct action_util *a, int *argc_p,
                }
        }
 
-       tail = NLMSG_TAIL(n);
-       addattr_l(n, MAX_MSG, tca_id, NULL, 0);
+       tail = addattr_nest(n, MAX_MSG, tca_id);
        fprintf(stdout, "tablename: %s hook: %s\n ", tname, ipthooks[hook]);
        fprintf(stdout, "\ttarget: ");
 
@@ -331,7 +329,7 @@ static int parse_ipt(struct action_util *a, int *argc_p,
        addattr_l(n, MAX_MSG, TCA_IPT_INDEX, &index, 4);
        if (m)
                addattr_l(n, MAX_MSG, TCA_IPT_TARG, m->t, m->t->u.target_size);
-       tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
+       addattr_nest_end(n, tail);
 
        argc -= optind;
        argv += optind;