summaryrefslogtreecommitdiff
path: root/filter/f-inst.c
diff options
context:
space:
mode:
authorMaria Matejka <mq@jmq.cz>2020-01-28 11:42:46 +0100
committerMaria Matejka <mq@ucw.cz>2021-11-09 19:20:41 +0100
commit69d1ffde4c724882398b3b630ea1199f12c0c288 (patch)
treea7567e07bcd0aa3f9365da83ed2ac23a10e869b6 /filter/f-inst.c
parent60880b539b8886f76961125d89a265c6e1112b7a (diff)
Split route data structure to storage (ro) / manipulation (rw) structures.
Routes are now allocated only when they are just to be inserted to the table. Updating a route needs a locally allocated route structure. Ownership of the attributes is also now not transfered from protocols to tables and vice versa but just borrowed which should be easier to handle in a multithreaded environment.
Diffstat (limited to 'filter/f-inst.c')
-rw-r--r--filter/f-inst.c12
1 files changed, 6 insertions, 6 deletions
diff --git a/filter/f-inst.c b/filter/f-inst.c
index 93886494..00e22383 100644
--- a/filter/f-inst.c
+++ b/filter/f-inst.c
@@ -519,14 +519,14 @@
{
STATIC_ATTR;
ACCESS_RTE;
- struct rta *rta = (*fs->rte)->attrs;
+ struct rta *rta = fs->rte->attrs;
switch (sa.sa_code)
{
case SA_FROM: RESULT(sa.f_type, ip, rta->from); break;
case SA_GW: RESULT(sa.f_type, ip, rta->nh.gw); break;
- case SA_NET: RESULT(sa.f_type, net, (*fs->rte)->net->n.addr); break;
- case SA_PROTO: RESULT(sa.f_type, s, (*fs->rte)->src->proto->name); break;
+ case SA_NET: RESULT(sa.f_type, net, fs->rte->net); break;
+ case SA_PROTO: RESULT(sa.f_type, s, fs->rte->src->proto->name); break;
case SA_SOURCE: RESULT(sa.f_type, i, rta->source); break;
case SA_SCOPE: RESULT(sa.f_type, i, rta->scope); break;
case SA_DEST: RESULT(sa.f_type, i, rta->dest); break;
@@ -550,7 +550,7 @@
f_rta_cow(fs);
{
- struct rta *rta = (*fs->rte)->attrs;
+ struct rta *rta = fs->rte->attrs;
switch (sa.sa_code)
{
@@ -562,7 +562,7 @@
{
ip_addr ip = v1.val.ip;
struct iface *ifa = ipa_is_link_local(ip) ? rta->nh.iface : NULL;
- neighbor *n = neigh_find((*fs->rte)->src->proto, ip, ifa, 0);
+ neighbor *n = neigh_find(fs->rte->src->proto, ip, ifa, 0);
if (!n || (n->scope == SCOPE_HOST))
runtime( "Invalid gw address" );
@@ -1214,7 +1214,7 @@
struct rtable *table = rtc->table;
ACCESS_RTE;
ACCESS_EATTRS;
- const net_addr *net = (*fs->rte)->net->n.addr;
+ const net_addr *net = fs->rte->net;
/* We ignore temporary attributes, probably not a problem here */
/* 0x02 is a value of BA_AS_PATH, we don't want to include BGP headers */