1
0
mirror of https://gitlab.labs.nic.cz/labs/bird.git synced 2024-05-11 16:54:54 +00:00

I rewrote the interface handling code, so that it supports multiple

addresses per interface (needed for example for IPv6 support).

Visible changes:

o  struct iface now contains a list of all interface addresses (represented
   by struct ifa), iface->addr points to the primary address (if any).
o  Interface has IF_UP set iff it's up and it has a primary address.
o  IF_UP is now independent on IF_IGNORED (i.e., you need to test IF_IGNORED
   in the protocols; I've added this, but please check).
o  The if_notify_change hook has been simplified (only one interface pointer
   etc.).
o  Introduced a ifa_notify_change hook. (For now, only the Direct protocol
   does use it -- it's wise to just listen to device routes in all other
   protocols.)
o  Removed IF_CHANGE_FLAGS notifier flag (it was meaningless anyway).
o  Updated all the code except netlink (I'll look at it tomorrow) to match
   the new semantics (please look at your code to ensure I did it right).

Things to fix:

o  Netlink.
o  Make krt-iface interpret "eth0:1"-type aliases as secondary addresses.
This commit is contained in:
Martin Mares
1999-05-06 21:38:11 +00:00
parent ec8b579e9c
commit 9a158361da
11 changed files with 368 additions and 168 deletions

View File

@@ -134,7 +134,7 @@ static_dump(struct proto *p)
}
static void
static_if_notify(struct proto *p, unsigned flags, struct iface *new, struct iface *old)
static_if_notify(struct proto *p, unsigned flags, struct iface *i)
{
struct static_route *r;
struct static_config *c = (void *) p->cf;
@@ -142,13 +142,13 @@ static_if_notify(struct proto *p, unsigned flags, struct iface *new, struct ifac
if (flags & IF_CHANGE_UP)
{
WALK_LIST(r, c->iface_routes)
if (!strcmp(r->if_name, new->name))
static_install(p, r, new);
if (!strcmp(r->if_name, i->name))
static_install(p, r, i);
}
else if (flags & IF_CHANGE_DOWN)
{
WALK_LIST(r, c->iface_routes)
if (!strcmp(r->if_name, old->name))
if (!strcmp(r->if_name, i->name))
static_remove(p, r);
}
}