summaryrefslogtreecommitdiff
path: root/proto/rip/rip.c
diff options
context:
space:
mode:
authorOndrej Zajicek (work) <santiago@crfreenet.org>2020-05-12 03:46:47 +0200
committerOndrej Zajicek (work) <santiago@crfreenet.org>2020-05-12 03:46:47 +0200
commit5fc8407177fd34f2d57441a8ff9a068f4162fbfb (patch)
tree1df937ea066eccb582ad17b28a597517378ee18e /proto/rip/rip.c
parentb8bbbbaf569799ab8faff0ee185528b6a2129154 (diff)
RIP: Fix handling of passive mode for demand circuit interfaces
Diffstat (limited to 'proto/rip/rip.c')
-rw-r--r--proto/rip/rip.c16
1 files changed, 15 insertions, 1 deletions
diff --git a/proto/rip/rip.c b/proto/rip/rip.c
index ae8007d9..d18ff5ad 100644
--- a/proto/rip/rip.c
+++ b/proto/rip/rip.c
@@ -532,6 +532,9 @@ rip_iface_start(struct rip_iface *ifa)
ifa->up = 1;
+ if (ifa->cf->passive)
+ return;
+
rip_send_request(p, ifa);
rip_send_table(p, ifa, ifa->addr, 0);
}
@@ -556,7 +559,7 @@ rip_iface_stop(struct rip_iface *ifa)
ifa->tx_pending = 0;
ifa->req_pending = 0;
- if (ifa->cf->demand_circuit)
+ if (ifa->cf->demand_circuit && !ifa->cf->passive)
rip_send_flush(p, ifa);
WALK_LIST_FIRST(n, ifa->neigh_list)
@@ -730,6 +733,17 @@ rip_reconfigure_iface(struct rip_proto *p, struct rip_iface *ifa, struct rip_ifa
(ifa->next_regular > (current_time() + new->update_time)))
ifa->next_regular = current_time() + (random() % new->update_time) + 100 MS;
+ if (ifa->up && new->demand_circuit && (new->passive != old->passive))
+ {
+ if (new->passive)
+ rip_send_flush(p, ifa);
+ else
+ {
+ rip_send_request(p, ifa);
+ rip_send_table(p, ifa, ifa->addr, 0);
+ }
+ }
+
if (new->check_link != old->check_link)
rip_iface_update_state(ifa);