summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2010-09-03 17:15:02 +0200
committerOndrej Zajicek <santiago@crfreenet.org>2010-09-03 17:15:02 +0200
commit948c865fac85f91dd7463195b190d8f133e0f741 (patch)
treee8a3a99efa99c04783405c046a07e4497cd14e46
parent3cb6c83f1a2eb563e459ce34d0f4850cc9dd4776 (diff)
downloadbird-948c865fac85f91dd7463195b190d8f133e0f741.tar
bird-948c865fac85f91dd7463195b190d8f133e0f741.zip
Fixes a crash in RIP during reconfigure.
-rw-r--r--proto/rip/rip.c18
1 files changed, 5 insertions, 13 deletions
diff --git a/proto/rip/rip.c b/proto/rip/rip.c
index 4b60d75..4b3de2e 100644
--- a/proto/rip/rip.c
+++ b/proto/rip/rip.c
@@ -27,7 +27,7 @@
* We maintain our own linked list of &rip_entry structures -- it serves
* as our small routing table. RIP never adds to this linked list upon
* packet reception; instead, it lets the core know about data from the packet
- * and waits for the core to call rip_rte_notify().
+ * and waits for the core to call rip_rt_notify().
*
* Within rip_tx(), the list is
* walked and a packet is generated using rip_tx_prepare(). This gets
@@ -868,24 +868,16 @@ rip_store_tmp_attrs(struct rte *rt, struct ea_list *attrs)
*/
static void
rip_rt_notify(struct proto *p, struct rtable *table UNUSED, struct network *net,
- struct rte *new, struct rte *old, struct ea_list *attrs)
+ struct rte *new, struct rte *old UNUSED, struct ea_list *attrs)
{
CHK_MAGIC;
+ struct rip_entry *e;
- if (old) {
- 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 );
+ e = fib_find( &P->rtable, &net->n.prefix, net->n.pxlen );
+ if (e)
fib_delete( &P->rtable, e );
- }
if (new) {
- struct rip_entry *e;
-#if 0
- /* This can happen since feeding of protocols is asynchronous */
- if (fib_find( &P->rtable, &net->n.prefix, net->n.pxlen ))
- log( L_BUG "%s: Inserting entry which is already there?", p->name );
-#endif
e = fib_get( &P->rtable, &net->n.prefix, net->n.pxlen );
e->nexthop = new->attrs->gw;