RIP route withdraw / triggered updates
Florian Lohoff
flo at rfc822.org
Tue Aug 1 11:14:06 CEST 2006
Hi,
i am trying to be able to withdraw a route advertised via rip with a
triggered update .. Currently disappearing routes only seem to be
deleted by not advertised anymore.
This is my rough solution although it has some problems i do see.
- A triggered update for every withdraw route
- Update contains all routes.
Currently i fail to understand the triggered update infrastructure
in place already - When reading this code snippet:
159 FIB_ITERATE_START(&P->rtable, &c->iter, z) {
160 struct rip_entry *e = (struct rip_entry *) z;
161
162 if (!rif->triggered || (!(e->updated < now-5))) {
163 nullupdate = 0;
164 i = rip_tx_prepare( p, packet->block + i, e, rif, i );
165 if (i >= maxi) {
166 FIB_ITERATE_PUT(&c->iter, z);
167 goto break_loop;
168 }
169 }
170 } FIB_ITERATE_END(z);
171 c->done = 1;
Where "rif->triggered = (P->tx_count % 6);" so basically
i am sending every 5th update and ignore the others !?!
I dont get it why a packet is constructed and finally not send.
I'd rather do some dampening and would schedule a triggered update on
the first withdrawn route in lets say 1-2 seconds.
Flo
diff -Nur bird-1.0.11/proto/rip/rip.c bird-1.0.11.flo/proto/rip/rip.c
--- bird-1.0.11/proto/rip/rip.c 2004-07-15 17:28:13.000000000 +0000
+++ bird-1.0.11.flo/proto/rip/rip.c 2006-08-01 07:46:07.000000000 +0000
@@ -501,6 +501,26 @@
debug( "\n" );
}
+
+static void
+rip_broadcast(struct proto *p)
+{
+ struct rip_interface *rif;
+ DBG( "RIP: Broadcasting routing tables\n" );
+ WALK_LIST( rif, P->interfaces ) {
+ struct iface *iface = rif->iface;
+
+ if (!iface) continue;
+ if (rif->mode & IM_QUIET) continue;
+ if (!(iface->flags & IF_UP)) continue;
+
+ rif->triggered = (P->tx_count % 6);
+ rip_sendto( p, IPA_NONE, 0, rif );
+ }
+ P->tx_count ++;
+}
+
+
/**
* rip_timer
* @t: timer
@@ -546,21 +566,7 @@
}
}
- DBG( "RIP: Broadcasting routing tables\n" );
- {
- struct rip_interface *rif;
- WALK_LIST( rif, P->interfaces ) {
- struct iface *iface = rif->iface;
-
- if (!iface) continue;
- if (rif->mode & IM_QUIET) continue;
- if (!(iface->flags & IF_UP)) continue;
-
- rif->triggered = (P->tx_count % 6);
- rip_sendto( p, IPA_NONE, 0, rif );
- }
- P->tx_count ++;
- }
+ rip_broadcast(p);
DBG( "RIP: tick tock done\n" );
}
@@ -854,7 +860,16 @@
struct rip_entry *e = fib_find( &P->rtable, &net->n.prefix, net->n.pxlen );
if (!e)
log( L_BUG "%s: Deleting nonexistent entry?!", p->name );
- fib_delete( &P->rtable, e );
+
+ if (new) {
+ fib_delete( &P->rtable, e );
+ } else {
+ /* Set metric to infinity */
+ e->metric=16;
+ e->updated = e->changed = now;
+
+ rip_broadcast(p);
+ }
}
if (new) {
Flo
--
Florian Lohoff flo at rfc822.org +49-171-2280134
Heisenberg may have been here.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 189 bytes
Desc: Digital signature
URL: <http://trubka.network.cz/pipermail/bird-users/attachments/20060801/01a33633/attachment.asc>
More information about the Bird-users
mailing list