[prev in list] [next in list] [prev in thread] [next in thread]
List: quagga-dev
Subject: [quagga-dev 11499] Re: [PATCH v2] zebra: fix rtnh_len in the rt_netlink messages for multipath case
From: David Lamparter <equinox () opensourcerouting ! org>
Date: 2014-09-15 16:48:26
Message-ID: 20140915164826.GM930748 () jupiter ! n2 ! diac24 ! net
[Download RAW message or body]
On Fri, Jul 11, 2014 at 04:52:15PM +0800, Feng Lu wrote:
> In _netlink_route_build_multipath():
> - Each time when appending a IPv4 gateway in the message, rtnh_len
> is increased by sizeof (struct rtattr) + 4, where we should use
> "bytelen" instead of the hard coding "4".
> - As what done for IPv4, we should increase rtnh_len accordingly
> along with adding a IPv6 gateway, or else the IPv6 gateways will
> be lost.
Even though I'm reasonably sure IPv6 ECMP has breakage both before and
after this patch, the patch seems correct to me.
=> Applied, Thanks!
> Signed-off-by: Feng Lu <lu.feng@6wind.com>
> Reviewed-by: Alain Ritoux <alain.ritoux@6wind.com>
> ---
> zebra/rt_netlink.c | 3 ++-
> 1 files changed, 2 insertions(+), 1 deletions(-)
>
> diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c
> index 452ea64..ff7d696 100644
> --- a/zebra/rt_netlink.c
> +++ b/zebra/rt_netlink.c
> @@ -1545,7 +1545,7 @@ _netlink_route_build_multipath(
> {
> rta_addattr_l (rta, NL_PKT_BUF_SIZE, RTA_GATEWAY,
> &nexthop->gate.ipv4, bytelen);
> - rtnh->rtnh_len += sizeof (struct rtattr) + 4;
> + rtnh->rtnh_len += sizeof (struct rtattr) + bytelen;
>
> if (nexthop->src.ipv4.s_addr)
> *src = &nexthop->src;
> @@ -1564,6 +1564,7 @@ _netlink_route_build_multipath(
> {
> rta_addattr_l (rta, NL_PKT_BUF_SIZE, RTA_GATEWAY,
> &nexthop->gate.ipv6, bytelen);
> + rtnh->rtnh_len += sizeof (struct rtattr) + bytelen;
>
> if (IS_ZEBRA_DEBUG_KERNEL)
> zlog_debug("netlink_route_multipath() (%s): "
> --
> 1.7.4.4
>
>
> _______________________________________________
> Quagga-dev mailing list
> Quagga-dev@lists.quagga.net
> https://lists.quagga.net/mailman/listinfo/quagga-dev
_______________________________________________
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
https://lists.quagga.net/mailman/listinfo/quagga-dev
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic