mirror of
https://git.proxmox.com/git/mirror_iproute2
synced 2026-01-05 23:51:29 +00:00
Use NLMSG_TAIL
(Logical change 1.127)
This commit is contained in:
parent
1a1d22a722
commit
fc78a8e98d
@ -547,7 +547,7 @@ static int parse_ipt(struct action_util *a,int *argc_p,
|
||||
}
|
||||
}
|
||||
|
||||
tail = (struct rtattr *) (((void *) n) + NLMSG_ALIGN(n->nlmsg_len));
|
||||
tail = NLMSG_TAIL(n);
|
||||
addattr_l(n, MAX_MSG, tca_id, NULL, 0);
|
||||
fprintf(stdout, "tablename: %s hook: %s\n ", tname, ipthooks[hook]);
|
||||
fprintf(stdout, "\ttarget: ");
|
||||
@ -569,8 +569,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 *) n) + NLMSG_ALIGN(n->nlmsg_len)) - (void *) tail;
|
||||
tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
|
||||
|
||||
argc -= optind;
|
||||
argv += optind;
|
||||
|
||||
@ -534,11 +534,10 @@ parse_pedit(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, stru
|
||||
}
|
||||
}
|
||||
|
||||
tail = (struct rtattr *) (((void *) n) + NLMSG_ALIGN(n->nlmsg_len));
|
||||
tail = NLMSG_TAIL(n);
|
||||
addattr_l(n, MAX_MSG, tca_id, NULL, 0);
|
||||
addattr_l(n, MAX_MSG, TCA_PEDIT_PARMS,&sel, sizeof(sel.sel)+sel.sel.nkeys*sizeof(struct tc_pedit_key));
|
||||
tail->rta_len =
|
||||
(((void *) n) + NLMSG_ALIGN(n->nlmsg_len)) - (void *) tail;
|
||||
tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
|
||||
|
||||
*argc_p = argc;
|
||||
*argv_p = argv;
|
||||
|
||||
Loading…
Reference in New Issue
Block a user