summaryrefslogtreecommitdiff
path: root/proto/pipe
diff options
context:
space:
mode:
authorOndrej Zajicek <santiago@crfreenet.org>2013-12-10 22:30:46 +0100
committerOndrej Zajicek <santiago@crfreenet.org>2013-12-10 22:30:46 +0100
commit6601a14831cdd32fc671ebc9dc299d2be427e489 (patch)
tree00b89854e36fbecd17443d09587c7cd80352893f /proto/pipe
parent2d0b7e24a52d51904faa8a8e96d68863491c110a (diff)
parent283c7dfada53a6dee6a8a17ecab492ffafd44b66 (diff)
Merge branch 'add-path'
Diffstat (limited to 'proto/pipe')
-rw-r--r--proto/pipe/pipe.c20
1 files changed, 15 insertions, 5 deletions
diff --git a/proto/pipe/pipe.c b/proto/pipe/pipe.c
index 51be3c7d..2e206038 100644
--- a/proto/pipe/pipe.c
+++ b/proto/pipe/pipe.c
@@ -49,7 +49,7 @@ pipe_rt_notify(struct proto *P, rtable *src_table, net *n, rte *new, rte *old, e
struct pipe_proto *p = (struct pipe_proto *) P;
struct announce_hook *ah = (src_table == P->table) ? p->peer_ahook : P->main_ahook;
rtable *dst_table = ah->table;
- struct proto *src;
+ struct rte_src *src;
net *nn;
rte *e;
@@ -72,7 +72,7 @@ pipe_rt_notify(struct proto *P, rtable *src_table, net *n, rte *new, rte *old, e
if (p->mode == PIPE_OPAQUE)
{
- a.proto = &p->p;
+ a.src = P->main_source;
a.source = RTS_PIPE;
}
@@ -91,16 +91,16 @@ pipe_rt_notify(struct proto *P, rtable *src_table, net *n, rte *new, rte *old, e
e->pflags = new->pflags;
}
- src = new->attrs->proto;
+ src = a.src;
}
else
{
e = NULL;
- src = old->attrs->proto;
+ src = old->attrs->src;
}
src_table->pipe_busy = 1;
- rte_update2(ah, nn, e, (p->mode == PIPE_OPAQUE) ? &p->p : src);
+ rte_update2(ah, nn, e, src);
src_table->pipe_busy = 0;
}
@@ -173,6 +173,12 @@ pipe_start(struct proto *P)
p->peer_ahook->in_limit = cf->c.out_limit;
proto_reset_limit(p->peer_ahook->in_limit);
+ if (p->mode == PIPE_OPAQUE)
+ {
+ P->main_source = rt_get_source(P, 0);
+ rt_lock_source(P->main_source);
+ }
+
return PS_UP;
}
@@ -187,6 +193,10 @@ pipe_cleanup(struct proto *P)
P->main_ahook = NULL;
p->peer_ahook = NULL;
+ if (p->mode == PIPE_OPAQUE)
+ rt_unlock_source(P->main_source);
+ P->main_source = NULL;
+
rt_unlock_table(P->table);
rt_unlock_table(p->peer_table);
}