diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2014-12-17 09:46:00 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2014-12-17 09:46:00 +0000 |
commit | 4a1d9e6f74632234e5154114e6e0d008d93caddb (patch) | |
tree | 962a40055a2cde38667f5b933d60edcc1161c612 /sys/netinet/ip_var.h | |
parent | a45b759c4782fe513ec89d5d4bb06bf38784f061 (diff) |
Use an interface index instead of a pointer for multicast options.
Output interface (port) selection for multicast traffic is not done via
route lookups. Instead the output ifp is registred when setsockopt(2)
is called with the IP{V6,}_MULTICAST_IF option. But since there is no
mechanism to invalidate such pointer stored in a pcb when an interface
is destroyed/removed, it might lead your kernel to fault.
Prevent a fault upon resume reported by frantisek holop, thanks!
ok mikeb@, claudio@
Diffstat (limited to 'sys/netinet/ip_var.h')
-rw-r--r-- | sys/netinet/ip_var.h | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/sys/netinet/ip_var.h b/sys/netinet/ip_var.h index c4abff43a44..c2dca5d0db3 100644 --- a/sys/netinet/ip_var.h +++ b/sys/netinet/ip_var.h @@ -1,4 +1,4 @@ -/* $OpenBSD: ip_var.h,v 1.57 2014/11/05 14:03:02 mpi Exp $ */ +/* $OpenBSD: ip_var.h,v 1.58 2014/12/17 09:45:59 mpi Exp $ */ /* $NetBSD: ip_var.h,v 1.16 1996/02/13 23:43:20 christos Exp $ */ /* @@ -101,12 +101,12 @@ struct ipoption { * passed to ip_output when IP multicast options are in use. */ struct ip_moptions { - struct ifnet *imo_multicast_ifp; /* ifp for outgoing multicasts */ + struct in_multi **imo_membership; /* group memberships */ + unsigned short imo_ifidx; /* ifp index for outgoing multicasts */ u_int8_t imo_multicast_ttl; /* TTL for outgoing multicasts */ u_int8_t imo_multicast_loop; /* 1 => hear sends if a member */ u_int16_t imo_num_memberships; /* no. memberships this socket */ u_int16_t imo_max_memberships; /* max memberships this socket */ - struct in_multi **imo_membership; /* group memberships */ }; #include <sys/queue.h> |