[prev in list] [next in list] [prev in thread] [next in thread] 

List:       quagga-dev
Subject:    [quagga-dev 4671] Re: [PATCH] [RESEND] add route-map support to Zebra
From:       Piotr Chytla <pch () packetconsulting ! pl>
Date:       2007-04-09 22:30:18
Message-ID: 20070409223018.GA10466 () packetconsulting ! pl
[Download RAW message or body]

On Mon, Apr 09, 2007 at 12:49:29AM +0100, Paul Jakma wrote:
> On Wed, 4 Apr 2007, David Stevens wrote:
> 
> >       I looked at this a little more. The route-map's are taking effect
> >when I change them via vtysh. If you were testing with static routes,
> >that may be the problem, since the route-maps are applied when the
> >route is installed. It doesn't change any of the existing routes.
>
> You could walk the RIB and push routes through the route-map, in theory, 
> as part of applying route-map changes - or with an explicit command to 
> re-apply route-map to RIB.
>

Correct me If I wrong but I think this problem can be solved by adding 
rib_update() after adding route-map name string to proto_rm array.
Rib_update will walk the RIB and reapply route-map to installed routes,
becouse they would all pass through nexthop_active_check() where protocol
route-map lives. 

r1|vtysh# sh ip route 0.0.0.0
Routing entry for 0.0.0.0/0
  Known via "ospf", distance 110, metric 1, best
  Last update 00:00:05 ago
  * 10.10.0.254, via eth0

r1|vtysh# sh route-map 
ZEBRA:
route-map no-ospf-default, permit, sequence 10
  Match clauses:
    ip address prefix-list deny-default
  Set clauses:
  Call clause:
  Action:
    Exit routemap

r1|vtysh(config)# ip protocol ospf route-map no-ospf-default

r1|vtysh# sh ip route 0.0.0.0
Routing entry for 0.0.0.0/0
  Known via "ospf", distance 110, metric 1
  Last update 00:00:41 ago
    10.10.0.254, via eth0 inactive
                          ^^^^^^^^
I've done some testing and everything looks fine, but I'm unsure if
this want create some additional mess.

/pch

---
diff --git a/zebra/zebra_vty.c b/zebra/zebra_vty.c
index 6c220e5..42c1457 100644
--- a/zebra/zebra_vty.c
+++ b/zebra/zebra_vty.c
@@ -672,6 +672,7 @@ DEFUN (ip_protocol,
   if (proto_rm[AFI_IP][i])
     XFREE (MTYPE_ROUTE_MAP_NAME, proto_rm[AFI_IP][i]);
   proto_rm[AFI_IP][i] = XSTRDUP (MTYPE_ROUTE_MAP_NAME, argv[1]);
+  rib_update();
   return CMD_SUCCESS;
 }
 
@@ -694,6 +695,7 @@ DEFUN (no_ip_protocol,
   if (proto_rm[AFI_IP][i])
     XFREE (MTYPE_ROUTE_MAP_NAME, proto_rm[AFI_IP][i]);
   proto_rm[AFI_IP][i] = NULL;
+  rib_update();
   return CMD_SUCCESS;
 }
 
-- 
Dyslexia bug unpatched since 1977 ...
exploit has been leaked to the underground.
_______________________________________________
Quagga-dev mailing list
Quagga-dev@lists.quagga.net
http://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