summaryrefslogtreecommitdiff
path: root/proto/pipe
diff options
context:
space:
mode:
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 6099d284..5bae8614 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);
}