From: acinonyx Date: Fri, 5 Aug 2011 15:32:18 +0000 (+0000) Subject: [packages] quagga: Fix installing of OLSR host routes X-Git-Url: http://git.openwrt.org/?p=feed%2Frouting.git;a=commitdiff_plain;h=466ba0d2d1b25d2565e2fa7b495df0b513d3736c [packages] quagga: Fix installing of OLSR host routes git-svn-id: svn+ssh://svn.openwrt.org/openwrt@27913 3c298f89-4303-0410-b956-a3cf2f4a3e73 --- diff --git a/patches/120-quagga_manet.patch b/patches/120-quagga_manet.patch index c32af31..b9980ac 100644 --- a/patches/120-quagga_manet.patch +++ b/patches/120-quagga_manet.patch @@ -637,7 +637,45 @@ }; /* Vector for routing table. */ -@@ -1229,6 +1232,8 @@ static const u_char meta_queue_map[ZEBRA +@@ -374,6 +377,18 @@ nexthop_active_ipv4 (struct rib *rib, st + + return 1; + } ++ else if (match->type == ZEBRA_ROUTE_OLSR) ++ { ++ for (newhop = match->nexthop; newhop; newhop = newhop->next) ++ if (CHECK_FLAG (newhop->flags, NEXTHOP_FLAG_FIB) ++ && newhop->type == NEXTHOP_TYPE_IFINDEX) ++ { ++ if (nexthop->type == NEXTHOP_TYPE_IPV4) ++ nexthop->ifindex = newhop->ifindex; ++ return 1; ++ } ++ return 0; ++ } + else if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_INTERNAL)) + { + for (newhop = match->nexthop; newhop; newhop = newhop->next) +@@ -476,6 +491,18 @@ nexthop_active_ipv6 (struct rib *rib, st + + return 1; + } ++ else if (match->type == ZEBRA_ROUTE_OLSR) ++ { ++ for (newhop = match->nexthop; newhop; newhop = newhop->next) ++ if (CHECK_FLAG (newhop->flags, NEXTHOP_FLAG_FIB) ++ && newhop->type == NEXTHOP_TYPE_IFINDEX) ++ { ++ if (nexthop->type == NEXTHOP_TYPE_IPV6) ++ nexthop->ifindex = newhop->ifindex; ++ return 1; ++ } ++ return 0; ++ } + else if (CHECK_FLAG (rib->flags, ZEBRA_FLAG_INTERNAL)) + { + for (newhop = match->nexthop; newhop; newhop = newhop->next) +@@ -1229,6 +1256,8 @@ static const u_char meta_queue_map[ZEBRA [ZEBRA_ROUTE_ISIS] = 2, [ZEBRA_ROUTE_BGP] = 3, [ZEBRA_ROUTE_HSLS] = 4, @@ -843,3 +881,15 @@ else { vty_out (vty, "Unknown route type%s", VTY_NEWLINE); +--- a/zebra/rt_netlink.c ++++ b/zebra/rt_netlink.c +@@ -1488,6 +1488,9 @@ netlink_route_multipath (int cmd, struct + addattr_l (&req.n, sizeof req, RTA_PREFSRC, + &nexthop->src.ipv4, bytelen); + ++ if (rib->type == ZEBRA_ROUTE_OLSR) ++ req.r.rtm_scope = RT_SCOPE_LINK; ++ + if (IS_ZEBRA_DEBUG_KERNEL) + zlog_debug("netlink_route_multipath() (single hop): " + "nexthop via if %u", nexthop->ifindex);