Subject: Re: Fwd: [Bug 447812] New: Netlink messages from "tc" to sch_netem module are not interpreted correctly

From: Rick Jones <[email-masked]>
Date: Thu, 22 May 2008 09:32:14 -0700

> I looked at netrt_rtnetlink.c, the problem is unrelated. Look at
> the code when adding the source attribtue:
> 
>   struct rtattr *rtap;
> 
>   if (source) {
>     rtap +=  rtap->rta_len;
> 
> You want to increment rtap by rta_len bytes, not rta_len*sizeof(*rtap)
> bytes.
> 
> Also, the code uses RTA_LENGTH() to calculate attributes sizes which
> is wrong, it must use RTA_SPACE() as RTA_LENGTH() does not align the
> actual data part and thus the next attribute is unaligned if the data
> of the previous attribute is not aligned to 4 bytes.

I'll make the fixes in the netperf code - thanks, hope the bugs there 
weren't too big a distraction.

rick jones