Revision a2697f02 nest/iface.c

View differences:

nest/iface.c
361 361
	    DBG("Interface %s changed too much -- forcing down/up transition\n", i->name);
362 362
	    if_change_flags(i, i->flags | IF_TMP_DOWN);
363 363
	    rem_node(&i->n);
364
	    WALK_LIST_DELSAFE(a, b, i->addrs)
365
	      ifa_delete(a);
364
	    new->addr = i->addr;
365
	    memcpy(&new->addrs, &i->addrs, sizeof(i->addrs));
366
	    memcpy(i, new, sizeof(*i));
366 367
	    goto newif;
367 368
	  }
368 369
	else if (c)
......
374 375
	return i;
375 376
      }
376 377
  i = mb_alloc(if_pool, sizeof(struct iface));
377
newif:
378 378
  memcpy(i, new, sizeof(*i));
379 379
  init_list(&i->addrs);
380
newif:
380 381
  i->flags |= IF_UPDATED | IF_TMP_DOWN;		/* Tmp down as we don't have addresses yet */
381 382
  add_tail(&iface_list, &i->n);
382 383
  return i;
......
543 544
	    ifa_recalc_primary(i);
544 545
	  }
545 546
	mb_free(b);
547
	return;
546 548
      }
547 549
}
548 550

  

Also available in: Unified diff