parent
034102f258
commit
1b52a7622e
|
|
@ -282,7 +282,7 @@ int act_parse_police(struct action_util *a,int *argc_p, char ***argv_p, int tca_
|
||||||
p.peakrate.mpu = mpu;
|
p.peakrate.mpu = mpu;
|
||||||
}
|
}
|
||||||
|
|
||||||
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_id, NULL, 0);
|
||||||
addattr_l(n, MAX_MSG, TCA_POLICE_TBF, &p, sizeof(p));
|
addattr_l(n, MAX_MSG, TCA_POLICE_TBF, &p, sizeof(p));
|
||||||
if (p.rate.rate)
|
if (p.rate.rate)
|
||||||
|
|
@ -294,7 +294,7 @@ int act_parse_police(struct action_util *a,int *argc_p, char ***argv_p, int tca_
|
||||||
if (presult)
|
if (presult)
|
||||||
addattr32(n, MAX_MSG, TCA_POLICE_RESULT, presult);
|
addattr32(n, MAX_MSG, TCA_POLICE_RESULT, presult);
|
||||||
|
|
||||||
tail->rta_len = (((void*)n)+NLMSG_ALIGN(n->nlmsg_len)) - (void*)tail;
|
tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
|
||||||
res = 0;
|
res = 0;
|
||||||
|
|
||||||
*argc_p = argc;
|
*argc_p = argc;
|
||||||
|
|
|
||||||
|
|
@ -93,10 +93,10 @@ static int htb_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl
|
||||||
}
|
}
|
||||||
argc--; argv++;
|
argc--; argv++;
|
||||||
}
|
}
|
||||||
tail = (struct rtattr*)(((void*)n)+NLMSG_ALIGN(n->nlmsg_len));
|
tail = NLMSG_TAIL(n);
|
||||||
addattr_l(n, 1024, TCA_OPTIONS, NULL, 0);
|
addattr_l(n, 1024, TCA_OPTIONS, NULL, 0);
|
||||||
addattr_l(n, 2024, TCA_HTB_INIT, &opt, NLMSG_ALIGN(sizeof(opt)));
|
addattr_l(n, 2024, TCA_HTB_INIT, &opt, NLMSG_ALIGN(sizeof(opt)));
|
||||||
tail->rta_len = (((void*)n)+NLMSG_ALIGN(n->nlmsg_len)) - (void*)tail;
|
tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
@ -224,12 +224,12 @@ static int htb_parse_class_opt(struct qdisc_util *qu, int argc, char **argv, str
|
||||||
opt.cbuffer = tc_calc_xmittime(opt.ceil.rate, cbuffer);
|
opt.cbuffer = tc_calc_xmittime(opt.ceil.rate, cbuffer);
|
||||||
opt.ceil.cell_log = ccell_log;
|
opt.ceil.cell_log = ccell_log;
|
||||||
|
|
||||||
tail = (struct rtattr*)(((void*)n)+NLMSG_ALIGN(n->nlmsg_len));
|
tail = NLMSG_TAIL(n);
|
||||||
addattr_l(n, 1024, TCA_OPTIONS, NULL, 0);
|
addattr_l(n, 1024, TCA_OPTIONS, NULL, 0);
|
||||||
addattr_l(n, 2024, TCA_HTB_PARMS, &opt, sizeof(opt));
|
addattr_l(n, 2024, TCA_HTB_PARMS, &opt, sizeof(opt));
|
||||||
addattr_l(n, 3024, TCA_HTB_RTAB, rtab, 1024);
|
addattr_l(n, 3024, TCA_HTB_RTAB, rtab, 1024);
|
||||||
addattr_l(n, 4024, TCA_HTB_CTAB, ctab, 1024);
|
addattr_l(n, 4024, TCA_HTB_CTAB, ctab, 1024);
|
||||||
tail->rta_len = (((void*)n)+NLMSG_ALIGN(n->nlmsg_len)) - (void*)tail;
|
tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue