Always send reorder message (for compatiablity)

and parse response correctly with netem.
This commit is contained in:
shemminger 2005-12-10 00:01:02 +00:00
parent a31a5d5904
commit e9bc3c40d0
2 changed files with 4 additions and 6 deletions

View File

@ -1,4 +1,4 @@
2005-12-02 Stephen Hemminger <shemminger@osdl.org>
2005-12-09 Stephen Hemminger <shemminger@osdl.org>
* Add corrupt feature to netem

View File

@ -273,10 +273,8 @@ static int netem_parse_opt(struct qdisc_util *qu, int argc, char **argv,
return -1;
}
if (reorder.probability) {
if (addattr_l(n, TCA_BUF_MAX, TCA_NETEM_REORDER, &reorder, sizeof(reorder)) < 0)
return -1;
}
if (corrupt.probability) {
if (addattr_l(n, TCA_BUF_MAX, TCA_NETEM_CORRUPT, &corrupt, sizeof(corrupt)) < 0)
@ -328,7 +326,7 @@ static int netem_print_opt(struct qdisc_util *qu, FILE *f, struct rtattr *opt)
if (tb[TCA_NETEM_CORRUPT]) {
if (RTA_PAYLOAD(tb[TCA_NETEM_CORRUPT]) < sizeof(*corrupt))
return -1;
corrupt = RTA_DATA(tb[TCA_NETEM_REORDER]);
corrupt = RTA_DATA(tb[TCA_NETEM_CORRUPT]);
}
}