[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20080522111835.GQ20815@postel.suug.ch>
Date: Thu, 22 May 2008 13:18:35 +0200
From: Thomas Graf <tgraf@...g.ch>
To: Rick Jones <rick.jones2@...com>
Cc: Stephen Hemminger <shemminger@...tta.com>,
Dave Jones <davej@...emonkey.org.uk>, netdev@...r.kernel.org
Subject: Re: Fwd: [Bug 447812] New: Netlink messages from "tc" to sch_netem module are not interpreted correctly
* Rick Jones <rick.jones2@...com> 2008-05-21 17:57
>
> >Could you try this patch?
>
> I'm not sure what it does to the tc case, unless I botched applying the
> patch, my rtnetlink case doesn't seem to change:
>
> izzy:~/netperf2_trunk# ./testfoo 16.89.133.212
> destination address is 16.89.133.212
> egress interface 0x6000000000004010 eth6
> izzy:~/netperf2_trunk# ./testfoo 16.89.133.212 10.208.0.17
> netlink: 8 bytes leftover after parsing attributes.
> destination address is 16.89.133.212
> egress interface 0x6000000000004010 eth6
> izzy:~/netperf2_trunk# uname -a
> Linux izzy 2.6.26-rc1-netlink #1 SMP Wed May 21 17:36:53 PDT 2008 ia64
> GNU/Linux
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.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists