]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Fix timing and fix endianity in metrics.
authorPavel Machek <pavel@ucw.cz>
Wed, 8 Dec 1999 12:51:45 +0000 (12:51 +0000)
committerPavel Machek <pavel@ucw.cz>
Wed, 8 Dec 1999 12:51:45 +0000 (12:51 +0000)
proto/rip/rip.c
proto/rip/rip.h

index 50db48e4070e55cb87f9fca74b9036a834a92d33..b6e6a05231e51f19bc0b6147e7ec69a5b380e789 100644 (file)
@@ -20,6 +20,9 @@
        after that), says RFC. We do something else: once in 5 second
        we look for any changed routes and broadcast them.
 
+       FIXME: (nonurgent) allow bigger frequencies than 1 regular update in 6 seconds (?)
+       FIXME: propagation of metric=infinity into main routing table may or may not be good idea.
+
  */
 
 #define LOCAL_DEBUG
@@ -102,7 +105,7 @@ rip_tx_prepare(struct proto *p, ip_addr daddr, struct rip_block *b, struct rip_e
   b->metric  = htonl( e->metric );
   if (ipa_equal(e->whotoldme, daddr)) {        /* FIXME: ouch, daddr is some kind of broadcast address. How am I expected to do split horizont?!?!? */
     DBG( "(split horizont)" );
-    b->metric = P_CF->infinity;
+    b->metric = htonl( P_CF->infinity );
   }
   ipa_hton( b->network );
 }
@@ -471,7 +474,7 @@ rip_start(struct proto *p)
   P->timer = tm_new( p->pool );
   P->timer->data = p;
   P->timer->randomize = 5;
-  P->timer->recurrent = P_CF->period
+  P->timer->recurrent = (P_CF->period / 6)+1
   P->timer->hook = rip_timer;
   tm_start( P->timer, 5 );
   rif = new_iface(p, NULL, 0, NULL);   /* Initialize dummy interface */
@@ -712,7 +715,7 @@ rip_rte_better(struct rte *new, struct rte *old)
   if (old->u.rip.metric > new->u.rip.metric)
     return 1;
 
-  if ((old->u.rip.metric != 16) && (new->u.rip.metric == 16)) {
+  if ((old->u.rip.metric != 16) && (new->u.rip.metric == 16)) {        /* FIXME: check wrt. strange infinity values */
     struct proto *p = new->attrs->proto;
     new->u.rip.lastmodX = now - P_CF->timeout_time;    /* Check this: if new metric is 16, act as it was timed out */
   }
index 8e759c45226b614261f89f3916aa0dd78dae8da6..7d9cadfa7bdb8a70de718c638db9e9252ed4a0fc 100644 (file)
@@ -109,7 +109,6 @@ struct rip_patt {
 
   int metric;
   int mode;
-#define IM_MULTICAST 1
 #define IM_BROADCAST 2
 #define IM_QUIET 4
 #define IM_NOLISTEN 8