parent
60a383ae5f
commit
228569c3ff
|
|
@ -54,7 +54,7 @@ static int route_parse_opt(struct filter_util *qu, char *handle, int argc, char
|
|||
if (argc == 0)
|
||||
return 0;
|
||||
|
||||
tail = (struct rtattr*)(((void*)n)+NLMSG_ALIGN(n->nlmsg_len));
|
||||
tail = NLMSG_TAIL(n);
|
||||
addattr_l(n, 4096, TCA_OPTIONS, NULL, 0);
|
||||
|
||||
while (argc > 0) {
|
||||
|
|
@ -125,7 +125,7 @@ static int route_parse_opt(struct filter_util *qu, char *handle, int argc, char
|
|||
}
|
||||
argc--; argv++;
|
||||
}
|
||||
tail->rta_len = (((void*)n)+n->nlmsg_len) - (void*)tail;
|
||||
tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
|
||||
if (order) {
|
||||
fh &= ~0x7F00;
|
||||
fh |= (order<<8)&0x7F00;
|
||||
|
|
|
|||
|
|
@ -189,7 +189,7 @@ static int rsvp_parse_opt(struct filter_util *qu, char *handle, int argc, char *
|
|||
if (argc == 0)
|
||||
return 0;
|
||||
|
||||
tail = (struct rtattr*)(((void*)n)+NLMSG_ALIGN(n->nlmsg_len));
|
||||
tail = NLMSG_TAIL(n);
|
||||
addattr_l(n, 4096, TCA_OPTIONS, NULL, 0);
|
||||
|
||||
while (argc > 0) {
|
||||
|
|
@ -282,7 +282,7 @@ static int rsvp_parse_opt(struct filter_util *qu, char *handle, int argc, char *
|
|||
|
||||
if (pinfo_ok)
|
||||
addattr_l(n, 4096, TCA_RSVP_PINFO, &pinfo, sizeof(pinfo));
|
||||
tail->rta_len = (((void*)n)+n->nlmsg_len) - (void*)tail;
|
||||
tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -177,7 +177,7 @@ parse_gact(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, struc
|
|||
if (!ok)
|
||||
return -1;
|
||||
|
||||
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_GACT_PARMS, &p, sizeof (p));
|
||||
#ifdef CONFIG_GACT_PROB
|
||||
|
|
@ -185,8 +185,7 @@ parse_gact(struct action_util *a, int *argc_p, char ***argv_p, int tca_id, struc
|
|||
addattr_l(n, MAX_MSG, TCA_GACT_PROB, &pp, sizeof (pp));
|
||||
}
|
||||
#endif
|
||||
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;
|
||||
|
|
|
|||
|
|
@ -179,12 +179,12 @@ static int atm_parse_class_opt(struct qdisc_util *qu, int argc, char **argv,
|
|||
perror("ioctl ATMARP_MKIP");
|
||||
return -1;
|
||||
}
|
||||
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_ATM_FD,&s,sizeof(s));
|
||||
if (excess) addattr_l(n,1024,TCA_ATM_EXCESS,&excess,sizeof(excess));
|
||||
if (hdr_len != -1) addattr_l(n,1024,TCA_ATM_HDR,hdr,hdr_len);
|
||||
tail->rta_len = (((void *) n)+NLMSG_ALIGN(n->nlmsg_len))-(void *) tail;
|
||||
tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -71,7 +71,7 @@ static int dsmark_parse_opt(struct qdisc_util *qu, int argc, char **argv,
|
|||
explain();
|
||||
return -1;
|
||||
}
|
||||
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_DSMARK_INDICES,&ind,sizeof(ind));
|
||||
if (dflt != -1) {
|
||||
|
|
@ -80,7 +80,7 @@ static int dsmark_parse_opt(struct qdisc_util *qu, int argc, char **argv,
|
|||
addattr_l(n,1024,TCA_DSMARK_DEFAULT_INDEX,&tmp,sizeof(tmp));
|
||||
}
|
||||
if (set_tc_index) addattr_l(n,1024,TCA_DSMARK_SET_TC_INDEX,NULL,0);
|
||||
tail->rta_len = (((void *) n)+n->nlmsg_len)-(void *) tail;
|
||||
tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
@ -98,7 +98,7 @@ static int dsmark_parse_class_opt(struct qdisc_util *qu, int argc, char **argv,
|
|||
__u8 tmp;
|
||||
char *end;
|
||||
|
||||
tail = (struct rtattr *) (((void *) n)+NLMSG_ALIGN(n->nlmsg_len));
|
||||
tail = NLMSG_TAIL(n);
|
||||
addattr_l(n,1024,TCA_OPTIONS,NULL,0);
|
||||
while (argc > 0) {
|
||||
if (!strcmp(*argv,"mask")) {
|
||||
|
|
@ -126,7 +126,7 @@ static int dsmark_parse_class_opt(struct qdisc_util *qu, int argc, char **argv,
|
|||
argc--;
|
||||
argv++;
|
||||
}
|
||||
tail->rta_len = (((void *) n)+n->nlmsg_len)-(void *) tail;
|
||||
tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
10
tc/q_gred.c
10
tc/q_gred.c
|
|
@ -106,11 +106,10 @@ if ((!opt.DPs) || (!opt.def_DP))
|
|||
}
|
||||
DPRINTF("TC_GRED: sending DPs=%d default=%d\n",opt.DPs,opt.def_DP);
|
||||
n->nlmsg_flags|=NLM_F_CREATE;
|
||||
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_GRED_DPS, &opt, sizeof(struct tc_gred_sopt));
|
||||
tail->rta_len = (((void*)n)+NLMSG_ALIGN(n->nlmsg_len)) - (void*)tail;
|
||||
tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
|
||||
return 0;
|
||||
}
|
||||
/*
|
||||
|
|
@ -252,12 +251,11 @@ static int gred_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct n
|
|||
}
|
||||
opt.Scell_log = wlog;
|
||||
|
||||
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_GRED_PARMS, &opt, sizeof(opt));
|
||||
addattr_l(n, 1024, TCA_GRED_STAB, sbuf, 256);
|
||||
tail->rta_len = (((void*)n)+NLMSG_ALIGN(n->nlmsg_len)) - (void*)tail;
|
||||
tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -149,12 +149,11 @@ static int red_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl
|
|||
#endif
|
||||
}
|
||||
|
||||
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_RED_PARMS, &opt, sizeof(opt));
|
||||
addattr_l(n, 1024, TCA_RED_STAB, sbuf, 256);
|
||||
tail->rta_len = (((void*)n)+NLMSG_ALIGN(n->nlmsg_len)) - (void*)tail;
|
||||
tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
|
|
@ -187,13 +187,13 @@ static int tbf_parse_opt(struct qdisc_util *qu, int argc, char **argv, struct nl
|
|||
opt.peakrate.mpu = mpu;
|
||||
}
|
||||
|
||||
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, 2024, TCA_TBF_PARMS, &opt, sizeof(opt));
|
||||
addattr_l(n, 3024, TCA_TBF_RTAB, rtab, 1024);
|
||||
if (opt.peakrate.rate)
|
||||
addattr_l(n, 4096, TCA_TBF_PTAB, ptab, 1024);
|
||||
tail->rta_len = (((void*)n)+NLMSG_ALIGN(n->nlmsg_len)) - (void*)tail;
|
||||
tail->rta_len = (void *) NLMSG_TAIL(n) - (void *) tail;
|
||||
return 0;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Reference in New Issue