summaryrefslogtreecommitdiff
path: root/usr.sbin/dvmrpd/rde_srt.c
diff options
context:
space:
mode:
authorMichele Marchetto <michele@cvs.openbsd.org>2008-12-02 13:42:45 +0000
committerMichele Marchetto <michele@cvs.openbsd.org>2008-12-02 13:42:45 +0000
commiteb623989fbafae8f3d155313d2eeb80dacc8341b (patch)
tree355f00c02f98436a935d418b15a0832d7415ed16 /usr.sbin/dvmrpd/rde_srt.c
parent4914f64e7a7e2b8113b5852684c7213e356cef80 (diff)
Initial support for neighbor expiry.
When a nbr goes down delete it from the lists of downstream dependent neighbors. OK norby@
Diffstat (limited to 'usr.sbin/dvmrpd/rde_srt.c')
-rw-r--r--usr.sbin/dvmrpd/rde_srt.c20
1 files changed, 19 insertions, 1 deletions
diff --git a/usr.sbin/dvmrpd/rde_srt.c b/usr.sbin/dvmrpd/rde_srt.c
index 9ccf3d81517..73ec6483ff1 100644
--- a/usr.sbin/dvmrpd/rde_srt.c
+++ b/usr.sbin/dvmrpd/rde_srt.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: rde_srt.c,v 1.10 2008/11/24 21:55:52 michele Exp $ */
+/* $OpenBSD: rde_srt.c,v 1.11 2008/12/02 13:42:44 michele Exp $ */
/*
* Copyright (c) 2005, 2006 Esben Norby <norby@openbsd.org>
@@ -606,6 +606,24 @@ srt_delete_src(struct src_node *src_node)
}
void
+srt_expire_nbr(struct in_addr addr, struct iface *iface)
+{
+ struct src_node *src_node;
+ struct ds *ds;
+ struct rt_node *rn;
+
+ RB_FOREACH(src_node, src_head, &rdeconf->src_list) {
+ rn = rt_find(src_node->origin.s_addr,
+ mask2prefixlen(src_node->mask.s_addr));
+ if (rn == NULL)
+ fatalx("srt_expires_nbr: route not found");
+ ds = srt_find_ds(src_node, addr.s_addr);
+ if (ds)
+ srt_delete_ds(src_node, rn, ds, iface);
+ }
+}
+
+void
flash_update(struct rt_node *rn) {
struct route_report rr;