Revision 26c09e1d filter/filter.c

View differences:

filter/filter.c
200 200
static int f_flags;
201 201
static rta *f_rta_copy;
202 202

  
203
void
204
rta_cow(void)
205
{
206
  if (!f_rta_copy) {
207
    f_rta_copy = lp_alloc(f_pool, sizeof(rta));
208
    memcpy(f_rta_copy, (*f_rte)->attrs, sizeof(rta));
209
    f_rta_copy->aflags = 0;
210
    *f_rte = rte_cow(*f_rte);
211
    (*f_rte)->attrs = f_rta_copy;
212
  }
213
}
214

  
203 215
#define runtime(x) do { \
204 216
    log( L_ERR "filters, line %d: %s", what->lineno, x); \
205 217
    res.type = T_RETURN; \
......
477 489
      }
478 490

  
479 491
      if (!(what->aux & EAF_TEMP) && (!(f_flags & FF_FORCE_TMPATTR))) {
480
	if (!f_rta_copy) {
481
	  f_rta_copy = lp_alloc(f_pool, sizeof(rta));
482
	  memcpy(f_rta_copy, (*f_rte)->attrs, sizeof(rta));
483
	  f_rta_copy->aflags = 0;
484
	  *f_rte = rte_cow(*f_rte);
485
	  (*f_rte)->attrs = f_rta_copy;
486
	}
492
	rta_cow();
487 493
	l->next = f_rta_copy->eattrs;
488 494
	f_rta_copy->eattrs = l;
489 495
      } else {

Also available in: Unified diff