[packages] quagga: Fix installing of OLSR host routes
authoracinonyx <acinonyx@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Fri, 5 Aug 2011 15:32:18 +0000 (15:32 +0000)
committeracinonyx <acinonyx@3c298f89-4303-0410-b956-a3cf2f4a3e73>
Fri, 5 Aug 2011 15:32:18 +0000 (15:32 +0000)
git-svn-id: svn+ssh://svn.openwrt.org/openwrt@27913 3c298f89-4303-0410-b956-a3cf2f4a3e73

patches/120-quagga_manet.patch

index c32af31f33a56a343e79f73ddfa327ffa58f9a78..b9980acbed05df6609b4328fa6ef08997f0be986 100644 (file)
  };
  \f
  /* 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,
    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);