]> git.puffer.fish Git - mirror/frr.git/commitdiff
2003-06-19 Vladimir Ivaschenko <hazard@francoudi.com>
authorpaul <paul>
Thu, 19 Jun 2003 01:41:37 +0000 (01:41 +0000)
committerpaul <paul>
Thu, 19 Jun 2003 01:41:37 +0000 (01:41 +0000)
* zebra/rt_netlink.c: Debug statements added to
          netlink_route_multipath()
* zebra/zebra_rib.c: If route has a gateway, delete only existing
          route with that specified gateway.

zebra/rt_netlink.c
zebra/zebra_rib.c

index 6a3df192a71b01941b8806947acefdc76a027763..b38df20b625bd6778acae3efefe235b2df0d0396 100644 (file)
@@ -1323,13 +1323,24 @@ netlink_route_multipath (int cmd, struct prefix *p, struct rib *rib,
     {
       for (nexthop = rib->nexthop; nexthop; nexthop = nexthop->next)
        {
+
          if ((cmd == RTM_NEWROUTE 
               && CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_ACTIVE))
              || (cmd == RTM_DELROUTE
                  && CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_FIB)))
            {
+
              if (CHECK_FLAG (nexthop->flags, NEXTHOP_FLAG_RECURSIVE))
                {
+                 if (IS_ZEBRA_DEBUG_KERNEL) {
+                       zlog_info ("netlink_route_multipath(): %s %s/%d via %s if %u",
+                         lookup (nlmsg_str, cmd),
+                         inet_ntoa (p->u.prefix4),
+                         p->prefixlen, 
+                         inet_ntoa (nexthop->rgate.ipv4),
+                         nexthop->rifindex);
+                 }
+
                  if (nexthop->rtype == NEXTHOP_TYPE_IPV4 
                      || nexthop->rtype == NEXTHOP_TYPE_IPV4_IFINDEX)
                    addattr_l (&req.n, sizeof req, RTA_GATEWAY,
@@ -1351,6 +1362,15 @@ netlink_route_multipath (int cmd, struct prefix *p, struct rib *rib,
                }
              else
                {
+                 if (IS_ZEBRA_DEBUG_KERNEL) {
+            zlog_info ("netlink_route_multipath(): %s %s/%d via %s if %u",
+                               lookup (nlmsg_str, cmd),
+                               inet_ntoa (p->u.prefix4),
+                               p->prefixlen,
+                               inet_ntoa (nexthop->gate.ipv4), 
+                               nexthop->ifindex);
+                 }
+
                  if (nexthop->type == NEXTHOP_TYPE_IPV4 
                      || nexthop->type == NEXTHOP_TYPE_IPV4_IFINDEX)
                    addattr_l (&req.n, sizeof req, RTA_GATEWAY,
index 2209364cdb8b7daa6e75d733aa2f062447973ab3..09d2da5bd2b20a1b588d707715f58932e8838544 100644 (file)
@@ -1146,6 +1146,13 @@ rib_delete_ipv4 (int type, int flags, struct prefix_ipv4 *p,
   /* Apply mask. */
   apply_mask_ipv4 (p);
 
+  if (IS_ZEBRA_DEBUG_KERNEL && gate)
+    zlog_info ("rib_delete_ipv4(): route delete %s/%d via %s ifindex %d",
+                      inet_ntop (AF_INET, &p->prefix, buf1, BUFSIZ),
+                      p->prefixlen, 
+                      inet_ntoa (*gate), 
+                      ifindex);
+
   /* Lookup route node. */
   rn = route_node_lookup (table, (struct prefix *) p);
   if (! rn)
@@ -1192,6 +1199,20 @@ rib_delete_ipv4 (int type, int flags, struct prefix_ipv4 *p,
              break;
            }
        }
+      else if (gate) 
+        {
+          nexthop = rib->nexthop;
+
+         /* Make sure that the route found has the same gateway. */
+         if (rib->type == type
+             && nexthop &&
+                 (IPV4_ADDR_SAME (&nexthop->gate.ipv4, gate) || 
+                   IPV4_ADDR_SAME (&nexthop->rgate.ipv4, gate)) )
+           {
+             same = rib;
+             break;
+           }
+       }
       else
        {
          if (rib->type == type)