2005-09-29 Alain Ritoux <alain.ritoux@6wind.com>
* lib/filer.c: show protocol name in filter_show()
* lib/plist.c: show protocol name in vty_show_prefix_entry()
* routemap.c: show protocol name in vty_show_route_map_entry()
* lib/vty.c: in vty_command(), show protocol name if command unknown
* zebra/zserv.c: Always provide distance fo route add
* ripd/rip_snmp.c: rip2IfConfReceive() sends values in conformance
with RFC. Also PeerDomain is now set to a STRING type.
* ripd/ripd.h: rip_redistribute_add() API includes metric and distance
* ripd/ripd.c: rip_redistribute_add() API i.e. stores metric and distance
Now allows a RIP-route to overcome a redistributed route coming
from a protocol with worse (higher) administrative distance
Metrics from redistribution are shown in show ip rip
* ripd/rip_zebra.c: adapt to the rip_redistribute_add() API, i.e.
provide distance and metric
* ripd/rip_interface.c: adapt to the rip_redistribute_add() API
* ripd/rip_routemap.c: no RMAP_COMPILE_ERROR on (metric > 16) usage
rather a CMD_WARNING, because set metric ius shared with other
protocols using larger values (such as OSPF)
The match metric action takes first external metric if present
(from redistribution) then RIP metric.
diff --git a/ripd/rip_zebra.c b/ripd/rip_zebra.c
index 734555b..570b528 100644
--- a/ripd/rip_zebra.c
+++ b/ripd/rip_zebra.c
@@ -134,12 +134,17 @@
}
if (CHECK_FLAG (api.message, ZAPI_MESSAGE_DISTANCE))
api.distance = stream_getc (s);
+ else
+ api.distance = 255;
if (CHECK_FLAG (api.message, ZAPI_MESSAGE_METRIC))
api.metric = stream_getl (s);
+ else
+ api.metric = 0;
/* Then fetch IPv4 prefixes. */
if (command == ZEBRA_IPV4_ROUTE_ADD)
- rip_redistribute_add (api.type, RIP_ROUTE_REDISTRIBUTE, &p, ifindex, &nexthop);
+ rip_redistribute_add (api.type, RIP_ROUTE_REDISTRIBUTE, &p, ifindex,
+ &nexthop, api.metric, api.distance);
else
rip_redistribute_delete (api.type, RIP_ROUTE_REDISTRIBUTE, &p, ifindex);
@@ -597,7 +602,8 @@
rip->default_information = 1;
- rip_redistribute_add (ZEBRA_ROUTE_RIP, RIP_ROUTE_DEFAULT, &p, 0, NULL);
+ rip_redistribute_add (ZEBRA_ROUTE_RIP, RIP_ROUTE_DEFAULT, &p, 0,
+ NULL, 0, 0);
}
return CMD_SUCCESS;