]> git.ipfire.org Git - thirdparty/bird.git/commitdiff
Kill remaining master_table relics in KRT code.
authorMartin Mares <mj@ucw.cz>
Mon, 17 May 1999 20:16:53 +0000 (20:16 +0000)
committerMartin Mares <mj@ucw.cz>
Mon, 17 May 1999 20:16:53 +0000 (20:16 +0000)
Make all protocols pass routing table to rte_update and rte_discard.

nest/rt-dev.c
proto/rip/rip.c
proto/static/static.c
sysdep/linux/krt-scan.c
sysdep/linux/netlink/netlink.c
sysdep/unix/krt.c

index 1225f1d7203c1d5d4cd9eeb18107c38f3ba9f109..63548fc723500f5bdbe7677c05c9ed4e3ca048cf 100644 (file)
@@ -36,7 +36,7 @@ dev_ifa_notify(struct proto *p, unsigned c, struct ifa *ad)
          debug("dev_if_notify: device shutdown: prefix not found\n");
          return;
        }
-      rte_update(n, p, NULL);
+      rte_update(p->table, n, p, NULL);
     }
   else if (c & IF_CHANGE_UP)
     {
@@ -61,7 +61,7 @@ dev_ifa_notify(struct proto *p, unsigned c, struct ifa *ad)
       e = rte_get_temp(a);
       e->net = n;
       e->pflags = 0;
-      rte_update(n, p, e);
+      rte_update(p->table, n, p, e);
     }
 }
 
index 4a3e10ad5659974dcb6adba36950d1256ba26005..16c63aec834610a7572bb863a9bc20e9b3ded064 100644 (file)
@@ -223,7 +223,7 @@ advertise_entry( struct proto *p, struct rip_block *b, ip_addr whotoldme )
   r->u.rip.tag = ntohl(b->tag);
   r->net = n;
   r->pflags = 0; /* Here go my flags */
-  rte_update( n, p, r );
+  rte_update( p->table, n, p, r );
   DBG( "done\n" );
 }
 
@@ -356,7 +356,7 @@ rip_timer(timer *t)
 
     if (now - rte->lastmod > P_CF->garbage_time) {
       debug( "RIP: entry is too old: " ); rte_dump( rte );
-      rte_discard(rte);
+      rte_discard(p->table, rte);
     }
   }
 
index b136b3143d8f6ab6ed4df4d89dec5f843e6edb8b..d245be2f57da0f7b105acd505e484ef6cb578f6f 100644 (file)
@@ -40,7 +40,7 @@ static_install(struct proto *p, struct static_route *r, struct iface *ifa)
   e = rte_get_temp(aa);
   e->net = n;
   e->pflags = 0;
-  rte_update(n, p, e);
+  rte_update(p->table, n, p, e);
 }
 
 static void
@@ -51,7 +51,7 @@ static_remove(struct proto *p, struct static_route *r)
   DBG("Removing static route %I/%d\n", r->net, r->masklen);
   n = net_find(p->table, r->net, r->masklen);
   if (n)
-    rte_update(n, p, NULL);
+    rte_update(p->table, n, p, NULL);
 }
 
 static int
index 7ee80f27972a90cf6c9c6d1471a2ecf54c342684..05a623302ae74e8860fa3e83ea26485b3701af35 100644 (file)
@@ -86,7 +86,7 @@ krt_parse_entry(byte *ent, struct krt_proto *p)
       return;
     }
 
-  net = net_get(&master_table, dest, masklen);
+  net = net_get(p->p.table, dest, masklen);
 
   a.proto = &p->p;
   a.source = RTS_INHERIT;
index 10eb27a9a57f7874cd95e6dd548c2b86a5c1a3ad..3daa6f8fca71271f9b1e3bd777ed6c57587ee659 100644 (file)
@@ -594,7 +594,7 @@ nl_parse_route(struct krt_proto *p, struct nlmsghdr *h, int scan)
       src = KRT_SRC_ALIEN;
     }
 
-  net = net_get(&master_table, dst, i->rtm_dst_len);
+  net = net_get(p->p.table, dst, i->rtm_dst_len);
   ra.proto = &p->p;
   ra.source = RTS_INHERIT;
   ra.scope = SCOPE_UNIVERSE;
index 69d535bccc392f929027e9102370ce706beb3cfc..364147da14d1d6693451e2641abfffcfea9010dd 100644 (file)
@@ -132,7 +132,7 @@ krt_learn_announce_update(struct krt_proto *p, rte *e)
   ee->net = nn;
   ee->pflags = 0;
   ee->u.krt = e->u.krt;
-  rte_update(nn, &p->p, ee);
+  rte_update(p->p.table, nn, &p->p, ee);
 }
 
 static void
@@ -140,7 +140,7 @@ krt_learn_announce_delete(struct krt_proto *p, net *n)
 {
   n = net_find(p->p.table, n->n.prefix, n->n.pxlen);
   if (n)
-    rte_update(n, &p->p, NULL);
+    rte_update(p->p.table, n, &p->p, NULL);
 }
 
 static void
@@ -356,7 +356,7 @@ krt_dump_attrs(rte *e)
 static void
 krt_flush_routes(struct krt_proto *p)
 {
-  struct rtable *t = &master_table;
+  struct rtable *t = p->p.table;
 
   DBG("Flushing kernel routes...\n");
   FIB_WALK(&t->fib, f)
@@ -466,7 +466,7 @@ static void
 krt_prune(struct krt_proto *p)
 {
   struct proto *pp = &p->p;
-  struct rtable *t = &master_table;
+  struct rtable *t = p->p.table;
   struct fib_node *f;
 
   DBG("Pruning routes...\n");
@@ -547,7 +547,7 @@ krt_got_route_async(struct krt_proto *p, rte *e, int new)
       /* Fall-thru */
     default:
       DBG("Discarding\n");
-      rte_update(net, &p->p, NULL);
+      rte_update(p->p.table, net, &p->p, NULL);
     }
   rte_free(e);
 }