From: Lu Feng Date: Fri, 11 Jul 2014 07:52:15 +0000 (+0000) Subject: zebra: fix rtnh_len in the rt_netlink messages for multipath case X-Git-Tag: frr-2.0-rc1~679 X-Git-Url: https://git.puffer.fish/?a=commitdiff_plain;h=64fdba2ace1ba6114854bb433904e4d27185935b;p=mirror%2Ffrr.git zebra: fix rtnh_len in the rt_netlink messages for multipath case 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. Signed-off-by: Feng Lu Reviewed-by: Alain Ritoux Signed-off-by: David Lamparter (cherry picked from commit 621e2aaf33d8ab73bf44b0eea3f3900135d34996) Conflicts: zebra/rt_netlink.c --- diff --git a/zebra/rt_netlink.c b/zebra/rt_netlink.c index 9c2942a5f5..868b408aca 100644 --- a/zebra/rt_netlink.c +++ b/zebra/rt_netlink.c @@ -1863,7 +1863,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->rmap_src.ipv4.s_addr) *src = &nexthop->rmap_src;