From 7dc4827c968053e45bcb7f145e9986eeb20c993b Mon Sep 17 00:00:00 2001 From: Martin Mares Date: Fri, 26 Mar 1999 21:50:43 +0000 Subject: Added everything protocols need to know about multiple routing tables, i.e. struct proto now contains field 'table' pointing to routing table the protocol is attached to. Use this instead of &master_table. Modified all protocols except the kernel syncer to use this field. --- proto/rip/rip.c | 2 +- proto/static/static.c | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) (limited to 'proto') diff --git a/proto/rip/rip.c b/proto/rip/rip.c index 249026d..060446f 100644 --- a/proto/rip/rip.c +++ b/proto/rip/rip.c @@ -226,7 +226,7 @@ advertise_entry( struct proto *p, struct rip_block *b, ip_addr whotoldme ) log( L_ERR "%I asked me to route %I/%I, but that is not valid netmask.", A.from, b->network, b->netmask ); return; } - n = net_get( &master_table, 0, b->network, ipa_mklen( b->netmask )); + n = net_get( p->table, 0, b->network, ipa_mklen( b->netmask )); r = rte_get_temp(a); r->u.rip.metric = ntohl(b->metric) + rif->metric; if (r->u.rip.metric > P_CF->infinity) r->u.rip.metric = P_CF->infinity; diff --git a/proto/static/static.c b/proto/static/static.c index 873abe3..3a485bf 100644 --- a/proto/static/static.c +++ b/proto/static/static.c @@ -37,7 +37,7 @@ static_install(struct proto *p, struct static_route *r, struct iface *ifa) a.iface = ifa; aa = rta_lookup(&a); - n = net_get(&master_table, a.tos, r->net, r->masklen); + n = net_get(p->table, a.tos, r->net, r->masklen); e = rte_get_temp(aa); e->net = n; e->pflags = 0; @@ -50,7 +50,7 @@ static_remove(struct proto *p, struct static_route *r) net *n; DBG("Removing static route %I/%d\n", r->net, r->masklen); - n = net_find(&master_table, 0, r->net, r->masklen); + n = net_find(p->table, 0, r->net, r->masklen); if (n) rte_update(n, p, NULL); } -- cgit v1.2.3