diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2013-11-28 10:16:45 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2013-11-28 10:16:45 +0000 |
commit | dd2b8403a85186728d2280050afeae817692a102 (patch) | |
tree | 2be6ccc8bb7e213382b01dd964b542fc91a7a1e9 /sys/net/if.c | |
parent | cba989db5ef2c262d2eeb2ee6f56d8c75d717d38 (diff) |
Change the way protocol multicast addresses are linked to an interface.
Instead of linking multicast records to the first configured address of
the corresponding protocol, making this address and its position in the
global list special, add them to a new list directly linked to the
interface descriptor.
This new multicast address list is similar to the address list, all its
elements contain a protocol agnostic part. This design allows us to
be able to join a multicast group without necessarily having a configured
address. That means IPv6 multicast kludges are no longer needed.
Another benefit is to be able to add and remove an IP address from an
interface without worrying about multicast records. That means that the
global IPv4 list is no longer needed since the first configured address
of an interface is no longer special.
This new list might also be extended in the future to contain the
link-layer addresses used to configure hardware filters.
Tested by sthen@ and weerd@, ok mikeb@
Diffstat (limited to 'sys/net/if.c')
-rw-r--r-- | sys/net/if.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/net/if.c b/sys/net/if.c index 8926e751a3d..4000f40dd35 100644 --- a/sys/net/if.c +++ b/sys/net/if.c @@ -1,4 +1,4 @@ -/* $OpenBSD: if.c,v 1.278 2013/11/27 08:34:40 mpi Exp $ */ +/* $OpenBSD: if.c,v 1.279 2013/11/28 10:16:44 mpi Exp $ */ /* $NetBSD: if.c,v 1.35 1996/05/07 05:26:04 thorpej Exp $ */ /* @@ -437,8 +437,9 @@ if_attach(struct ifnet *ifp) void if_attach_common(struct ifnet *ifp) { - TAILQ_INIT(&ifp->if_addrlist); + TAILQ_INIT(&ifp->if_maddrlist); + ifp->if_addrhooks = malloc(sizeof(*ifp->if_addrhooks), M_TEMP, M_WAITOK); TAILQ_INIT(ifp->if_addrhooks); |