summaryrefslogtreecommitdiff
path: root/proto/rip
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2018-05-24 14:51:05 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2018-05-24 14:51:05 +0200
commitfeae132e0f9bdc62d2b90bf676d12241af8e794c (patch)
tree2767cf9b23d85fdd7f029e27afe855f758430a60 /proto/rip
parentb24b781117179f301116837f0a39468343e4805b (diff)
Do not initialize route metrics in import_control hook
During route export, the receiving protocol often initialized route metrics to default value in its import_control hook before export filter was executed. This is inconsistent with the expectation that an export filter would process the same route as one in the routing table and it breaks setting these metrics before (e.g. for static routes directly in static protocol). The patch removes the initialization of route metrics in import_control hook, the default values are already handled in rt_notify hook called after export filters. The patch also changed the behavior of OSPF to keep metrics when a route is reannounced between OSPF instances (to be consistent with other protocols) and the behavior when both ospf_metric1 and ospf_metric2 are specified (to have more expected behavior).
Diffstat (limited to 'proto/rip')
-rw-r--r--proto/rip/rip.c12
1 files changed, 1 insertions, 11 deletions
diff --git a/proto/rip/rip.c b/proto/rip/rip.c
index 85e37cea..baf98737 100644
--- a/proto/rip/rip.c
+++ b/proto/rip/rip.c
@@ -1020,16 +1020,6 @@ rip_prepare_attrs(struct linpool *pool, ea_list *next, u8 metric, u16 tag)
return l;
}
-static int
-rip_import_control(struct proto *P UNUSED, struct rte **rt, struct ea_list **attrs, struct linpool *pool)
-{
- /* Prepare attributes with initial values */
- if ((*rt)->attrs->source != RTS_RIP)
- *attrs = rip_prepare_attrs(pool, *attrs, 1, 0);
-
- return 0;
-}
-
static void
rip_reload_routes(struct channel *C)
{
@@ -1091,7 +1081,7 @@ rip_init(struct proto_config *CF)
P->if_notify = rip_if_notify;
P->rt_notify = rip_rt_notify;
P->neigh_notify = rip_neigh_notify;
- P->import_control = rip_import_control;
+ // P->import_control = rip_import_control;
P->reload_routes = rip_reload_routes;
P->make_tmp_attrs = rip_make_tmp_attrs;
P->store_tmp_attrs = rip_store_tmp_attrs;