Revision 094d2bdb proto/pipe/pipe.c

View differences:

proto/pipe/pipe.c
49 49
  struct pipe_proto *p = (struct pipe_proto *) P;
50 50
  struct announce_hook *ah = (src_table == P->table) ? p->peer_ahook : P->main_ahook;
51 51
  rtable *dst_table = ah->table;
52
  struct proto *src;
52
  struct rte_src *src;
53 53

  
54 54
  net *nn;
55 55
  rte *e;
......
72 72

  
73 73
      if (p->mode == PIPE_OPAQUE)
74 74
	{
75
	  a.proto = &p->p;
75
	  a.src = P->main_source;
76 76
	  a.source = RTS_PIPE;
77 77
	}
78 78

  
......
91 91
	  e->pflags = new->pflags;
92 92
	}
93 93

  
94
      src = new->attrs->proto;
94
      src = a.src;
95 95
    }
96 96
  else
97 97
    {
98 98
      e = NULL;
99
      src = old->attrs->proto;
99
      src = old->attrs->src;
100 100
    }
101 101

  
102 102
  src_table->pipe_busy = 1;
103
  rte_update2(ah, nn, e, (p->mode == PIPE_OPAQUE) ? &p->p : src);
103
  rte_update2(ah, nn, e, src);
104 104
  src_table->pipe_busy = 0;
105 105
}
106 106

  
......
173 173
  p->peer_ahook->in_limit = cf->c.out_limit;
174 174
  proto_reset_limit(p->peer_ahook->in_limit);
175 175

  
176
  if (p->mode == PIPE_OPAQUE)
177
    {
178
      P->main_source = rt_get_source(P, 0);
179
      rt_lock_source(P->main_source);
180
    }
181

  
176 182
  return PS_UP;
177 183
}
178 184

  
......
187 193
  P->main_ahook = NULL;
188 194
  p->peer_ahook = NULL;
189 195

  
196
  if (p->mode == PIPE_OPAQUE)
197
    rt_unlock_source(P->main_source);
198
  P->main_source = NULL;
199

  
190 200
  rt_unlock_table(P->table);
191 201
  rt_unlock_table(p->peer_table);
192 202
}

Also available in: Unified diff