]> git.proxmox.com Git - mirror_iproute2.git/blobdiff - tc/m_xt_old.c
treewide: Use addattr_nest()/addattr_nest_end() to handle nested attributes
[mirror_iproute2.git] / tc / m_xt_old.c
index 21d90877357c595eaa07048d486923bb5febf385..313bea61cc7e05bb8ed24168b48dd320c63a31bb 100644 (file)
@@ -308,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: ");
 
@@ -330,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;