diff options
author | Martin Mares <mj@ucw.cz> | 1999-05-07 15:46:16 +0200 |
---|---|---|
committer | Martin Mares <mj@ucw.cz> | 1999-05-07 15:46:16 +0200 |
commit | a2697f02ac5109e749bff4d07bee6cedd0ab650b (patch) | |
tree | 234f142162a8c4a79906513a492dc19dc4ccdbcf /nest/iface.c | |
parent | 9a158361da249e0eab1e0f7bd2c7dbe9f32eddfa (diff) | |
download | bird-a2697f02ac5109e749bff4d07bee6cedd0ab650b.tar bird-a2697f02ac5109e749bff4d07bee6cedd0ab650b.zip |
Netlink support for secondary interface addresses.
Diffstat (limited to 'nest/iface.c')
-rw-r--r-- | nest/iface.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/nest/iface.c b/nest/iface.c index 069b740..19ed7fb 100644 --- a/nest/iface.c +++ b/nest/iface.c @@ -361,8 +361,9 @@ if_update(struct iface *new) DBG("Interface %s changed too much -- forcing down/up transition\n", i->name); if_change_flags(i, i->flags | IF_TMP_DOWN); rem_node(&i->n); - WALK_LIST_DELSAFE(a, b, i->addrs) - ifa_delete(a); + new->addr = i->addr; + memcpy(&new->addrs, &i->addrs, sizeof(i->addrs)); + memcpy(i, new, sizeof(*i)); goto newif; } else if (c) @@ -374,9 +375,9 @@ if_update(struct iface *new) return i; } i = mb_alloc(if_pool, sizeof(struct iface)); -newif: memcpy(i, new, sizeof(*i)); init_list(&i->addrs); +newif: i->flags |= IF_UPDATED | IF_TMP_DOWN; /* Tmp down as we don't have addresses yet */ add_tail(&iface_list, &i->n); return i; @@ -543,6 +544,7 @@ ifa_delete(struct ifa *a) ifa_recalc_primary(i); } mb_free(b); + return; } } |