]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Kill duplicity between rif and rif_patt.
authorPavel Machek <pavel@ucw.cz>
Mon, 31 May 1999 19:43:08 +0000 (19:43 +0000)
committerPavel Machek <pavel@ucw.cz>
Mon, 31 May 1999 19:43:08 +0000 (19:43 +0000)
proto/rip/config.Y
proto/rip/rip.c
proto/rip/rip.h

index a3e877dac6955e8ba106d08eb2312b7c018ca2d5..c00ecc5603eb47a4b5035517ffb26cf43c1b2323 100644 (file)
@@ -93,8 +93,8 @@ CF_CODE
 void
 rip_dev_add_iface(char *n)
 {
-  struct rip_patt *k = cfg_alloc(sizeof(struct rip_patt));
-
+  struct rip_patt *k = cfg_allocz(sizeof(struct rip_patt));
+  k->metric = 1;
   k->i.pattern = cfg_strdup(n);
   add_tail(&RIP_CFG->iface_list, &k->i.n);
 }
index 144bc7cbe602293b6485ccb60dcf83286a04cb51..430dbfd6d43021eb1295b09bb22c8afcd1afb1d4 100644 (file)
@@ -218,7 +218,7 @@ advertise_entry( struct proto *p, struct rip_block *b, ip_addr whotoldme )
   }
   n = net_get( p->table, b->network, ipa_mklen( b->netmask ));
   r = rte_get_temp(a);
-  r->u.rip.metric = ntohl(b->metric) + rif->metric;
+  r->u.rip.metric = ntohl(b->metric) + rif->patt->metric;
   if (r->u.rip.metric > P_CF->infinity) r->u.rip.metric = P_CF->infinity;
   r->u.rip.tag = ntohl(b->tag);
   r->net = n;
index 874c5652dd034ebdfc18657dfd7d644ee4e9c958..cee1b90512b24c0242f38f625cb8fa526e94d18b 100644 (file)
@@ -87,14 +87,6 @@ struct rip_interface {
   sock *sock;
   struct rip_connection *busy;
   struct rip_patt *patt;  
-
-  int metric;          /* User configurable data */
-  int mode;
-#define IM_MULTICAST 1
-#define IM_BROADCAST 2
-#define IM_QUIET 4
-#define IM_NOLISTEN 8
-#define IM_VERSION1 16
 };
 
 struct rip_patt {
@@ -102,6 +94,11 @@ struct rip_patt {
 
   int metric;
   int mode;
+#define IM_MULTICAST 1
+#define IM_BROADCAST 2
+#define IM_QUIET 4
+#define IM_NOLISTEN 8
+#define IM_VERSION1 16
 };
 
 struct rip_proto_config {