single nexthop flags bug
Justin Mayfield
jmayfield at cradlepoint.com
Thu Aug 16 21:03:48 EDT 2012
Well that's embarrassing. Here is just the libnl change.
On 08/16/2012 06:47 PM, Justin Mayfield wrote:
> Hi Everyone,
>
> I ran into a bug today related to how Linux handles a route's nexthop
> flags when there is just one nexthop. Namely Linux expects the flags
> to be OR'd into the rtm_flags field when there is only one nexthop and
> so rtnl_route_build_msg needs to check the number of nexthops and
> store the nexthops flags into this field prior to calling
> nlmsg_append(...&rtmsg).
>
> Conversely the rtnl_route_parse function needs to pull these lower
> 0xff bits when a single nexthop is detected.
>
> Attached is my patch. I don't like the slight duplication of doing
> the rtnl_route_get_nnexthops check twice but it seemed to be the least
> turmoil of any solution I thought of.
>
> Cheers!
> Justin Mayfield
> !SIG:502d94f9190323796110542!
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.infradead.org/pipermail/libnl/attachments/20120816/e86824b8/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: libnl_single_nexthop_flags_fix_2.patch
Type: text/x-patch
Size: 911 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/libnl/attachments/20120816/e86824b8/attachment.bin>
More information about the libnl
mailing list