Revision 13b75bac

View differences:

nest/rt-table.c
168 168

  
169 169
  if (new)
170 170
    {
171
      char *drop_reason = NULL;
171 172
      if ((class & IADDR_SCOPE_MASK) < p->min_scope)
172
	{
173
	  rte_trace_out(D_FILTERS, p, new, "out of scope");
174
	  new = NULL;
175
	}
173
	drop_reason = "out of scope";
176 174
      else if ((ok = p->import_control ? p->import_control(p, &new, &tmpa, rte_update_pool) : 0) < 0)
177
	{
178
	  rte_trace_out(D_FILTERS, p, new, "rejected by protocol");
179
	  new = NULL;
180
	}
175
	drop_reason = "rejected by protocol";
181 176
      else if (ok)
182 177
	rte_trace_out(D_FILTERS, p, new, "forced accept by protocol");
183 178
      else if (p->out_filter == FILTER_REJECT ||
184 179
	       p->out_filter && f_run(p->out_filter, &new, &tmpa, rte_update_pool, FF_FORCE_TMPATTR) > F_ACCEPT)
180
	drop_reason = "filtered out";
181
      if (drop_reason)
185 182
	{
186
	  rte_trace_out(D_FILTERS, p, new, "filtered out");
183
	  rte_trace_out(D_FILTERS, p, new, drop_reason);
187 184
	  if (new != new0)
188 185
	    rte_free(new);
189 186
	  new = NULL;
......
198 195
	  ea_list *tmpb = p->make_tmp_attrs ? p->make_tmp_attrs(old, rte_update_pool) : NULL;
199 196
	  ok = p->import_control ? p->import_control(p, &old, &tmpb, rte_update_pool) : 0;
200 197
	  if (ok < 0 || (!ok && f_run(p->out_filter, &old, &tmpb, rte_update_pool, FF_FORCE_TMPATTR) > F_ACCEPT))
201
	    old = NULL;
198
	    {
199
	      if (old != old0)
200
		rte_free(old);
201
	      old = NULL;
202
	    }
202 203
	}
203 204
    }
204 205
  if (p->debug & D_ROUTES)

Also available in: Unified diff