Revision 74a7da48 filter/filter.c

View differences:

filter/filter.c
153 153
static struct linpool *f_pool;
154 154
static struct ea_list **f_tmp_attrs;
155 155
static int f_flags;
156
static rta *f_rta_copy;
156 157

  
157 158
#define runtime(x) do { \
158 159
    log( L_ERR x ); \
......
404 405
      }
405 406

  
406 407
      if (!(what->aux & EAF_TEMP) && (!(f_flags & FF_FORCE_TMPATTR))) {
407
	*f_rte = rte_cow(*f_rte);
408
	l->next = (*f_rte)->attrs->eattrs;
409
	(*f_rte)->attrs->eattrs = l;
408
	if (!f_rta_copy) {
409
	  f_rta_copy = lp_alloc(f_pool, sizeof(rta));
410
	  memcpy(f_rta_copy, (*f_rte)->attrs, sizeof(rta));
411
	  f_rta_copy->aflags = 0;
412
	  *f_rte = rte_cow(*f_rte);
413
	  (*f_rte)->attrs = f_rta_copy;
414
	}
415
	l->next = f_rta_copy->eattrs;
416
	f_rta_copy->eattrs = l;
410 417
      } else {
411 418
	l->next = (*f_tmp_attrs);
412 419
	(*f_tmp_attrs) = l;
......
607 614
  f_tmp_attrs = tmp_attrs;
608 615
  f_rte = rte;
609 616
  f_rte_old = *rte;
617
  f_rta_copy = NULL;
610 618
  f_pool = tmp_pool;
611 619
  inst = filter->root;
612 620
  res = interpret(inst);

Also available in: Unified diff