summaryrefslogtreecommitdiff
path: root/sys/netinet/igmp.c
AgeCommit message (Collapse)Author
2017-05-04If m is not a continuous mbuf cluster, m_pullup() in pr_input mayAlexander Bluhm
change the pointer. Then *mp keeps the invalid pointer and it might be used. Fix the potential use after free and also reset *mp in other places to have less dangling pointers to freed mbufs. OK mpi@ mikeb@
2017-04-14Pass down the address family through the pr_input calls. ThisAlexander Bluhm
allows to simplify code used for both IPv4 and IPv6. OK mikeb@ deraadt@
2017-04-05When building counter memory in preparation to copy to userland, alwaysTheo de Raadt
zero the buffers first. All the current objects appear to be safe, however future changes might introduce structure pads. Discussed with guenther, ok bluhm
2017-02-05Always allocate counters memory using type M_COUNTERS.Jeremie Courreges-Anglas
This makes the API simpler, and is probably more useful than spreading counters memory other several types, making it harder to track. Prodded by mpi, ok mpi@ stsp@
2017-01-31Use CTASSERT instead of KASSERT for a few sysctl that use the counters APIJeremie Courreges-Anglas
ok dlg@ mpi@
2017-01-29Change the IPv4 pr_input function to the way IPv6 is implemented,Alexander Bluhm
to get rid of struct ip6protosw and some wrapper functions. It is more consistent to have less different structures. The divert_input functions cannot be called anyway, so remove them. OK visa@ mpi@
2017-01-25Since raw_input() and route_input() are gone from pr_input, we canAlexander Bluhm
make the variable parameters of the protocol input functions fixed. Also add the proto to make it similar to IPv6. OK mpi@ guenther@ millert@
2017-01-04convert igmp_stat into per-cpu countersDavid Gwynne
it follows the same pattern used in previous conversions. from Dimitris Papastamos (thank you). ok mpi@
2016-12-19Extend the multicast sockets and multicast hash table support to multipleRafael Zalamena
domains. This is one step towards supporting to run more than one multicast socket in different domains at the same time. ok mpi@
2016-12-16Move the if_get/if_put to the caller of igmp_sendpkt so we avoid havingRafael Zalamena
to do this lookup twice. Suggested by and ok mpi@
2016-12-14Set the rtableid for new mbufs when sending packets in igmp_sendpkt().Rafael Zalamena
ok mikeb@, phessler@
2016-12-05Remove recursive splsoftnet()s in ioctl(2) path.Martin Pieuchot
2016-11-28Assert that every slow/fast timeout routine is called at IPL_SOFTNET.Martin Pieuchot
This removes multipe recursive splsoftnet()/splx() dances.
2015-11-11Store an interface index instead of a pointer that's never dereferenced.Martin Pieuchot
Get rid of an if_ref()/if_put() dance. ok dlg@
2015-09-13if_put() after if_get().Martin Pieuchot
ok dlg@
2015-09-11if_put after if_get in igmp_joingroupDavid Gwynne
ok mpi@ claudio@
2015-09-10move the guts of igmp_input into a igmp_input_if function and callDavid Gwynne
it with the reference from if_get held so we can if_put it easly after the guts have run. ok claudio@
2015-08-28fairly simple sizes for free(); ok teduTheo de Raadt
2015-06-16Store a unique ID, an interface index, rather than a pointer to theMartin Pieuchot
receiving interface in the packet header of every mbuf. The interface pointer should now be retrieved when necessary with if_get(). If a NULL pointer is returned by if_get(), the interface has probably been destroy/removed and the mbuf should be freed. Such mechanism will simplify garbage collection of mbufs and limit problems with dangling ifp pointers. Tested by jmatthew@ and krw@, discussed with many. ok mikeb@, bluhm@, dlg@
2014-12-17Remove the "multicast_" prefix from the fields a multicast-only struct.Martin Pieuchot
Prodded by claudio@ and mikeb@
2014-12-17Use an interface index instead of a pointer for multicast options.Martin Pieuchot
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@
2014-11-18move arc4random prototype to systm.h. more appropriate for most codeTed Unangst
to include that than rdnvar.h. ok deraadt dlg
2014-09-14remove uneeded proc.h includesJonathan Gray
ok mpi@ kspillner@
2014-09-08remove uneeded route.h includesJonathan Gray
ok miod@ mpi@
2014-07-22Fewer <netinet/in_systm.h> !Martin Pieuchot
2014-07-12add a size argument to free. will be used soon, but for now default to 0.Ted Unangst
after discussions with beck deraadt kettenis.
2014-07-08decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.hTheo de Raadt
don't need to be married. ok guenther miod beck jsing kettenis
2014-05-12Includes a router altert option (RAO) in IGMP packets. Without thisMartin Pieuchot
option, required by the RFC2236, some L3 switches do not examine the packets. Based on FreeBSD's r14622 via Florian Riehm on tech@. ok bluhm@, jca@
2014-04-21ip_output() using varargs always struck me as bizarre, esp since it's onlyHenning Brauer
ever used to pass on uint32 (for ipsec). stop that madness and just pass the uint32, 0 in all cases but the two that pass the ipsec flowinfo. ok deraadt reyk guenther
2014-04-21we'll do fine without casting NULL to struct foo * / void *Henning Brauer
ok gcc & md5 (alas, no binary change)
2014-01-21Do not clean the multicast records of an interface when it is destroyedMartin Pieuchot
(unplugged). Even if it makes no sense to keep them around if the interface is no more, we cannot safely remove them since pcb multicast options might keep a pointer to them. Fixes a user after free introduced by the multicast address linking rewrite and reported by Alexey Suslikov, thanks! ok claudio@
2013-11-28Change the way protocol multicast addresses are linked to an interface.Martin Pieuchot
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@
2013-10-18Abstract the fact that IPv4 muticast records are linked to theMartin Pieuchot
interface descriptor throught the first configured address in the global list, this will help reducing the size of future diffs. No object change. ok sthen@
2013-10-14Change the macros used to iterate over the multicast records of anMartin Pieuchot
interface to not depend on the global list of addresses. For IPv4 the IP_TO_IA() macro still depends on the global list of addresses because we want to be sure to grab the first configured address of an interface, where the records are linked. Tested by sthen@, ok henning@
2013-05-02tedu broken Resource Reservation Protocol code that was ifdef RSVP_ISI.Martin Pieuchot
ok deraadt@, tedu@ (implicit)
2013-04-10Remove various external variable declaration from sources files andMartin Pieuchot
move them to the corresponding header with an appropriate comment if necessary. ok guenther@
2010-04-20remove proc.h include from uvm_map.h. This has far reaching effects, asTed Unangst
sysctl.h was reliant on this particular include, and many drivers included sysctl.h unnecessarily. remove sysctl.h or add proc.h as needed. ok deraadt
2010-01-13let's admit it's not 1992 any more. CIDR is around for a long time, evenHenning Brauer
that router vendor doesn't default to classful routing any more, and there really is no point in having a classful netmask and a subnetmask to split it. we still do classful guesses on the netmask if it isn't supplied by userland, but that's about it. i decided to keep ia_netmask and kill ia_subnetmask which makes this diff bigish, the classful ia_netmask wasn't really used all that much. the real changes are in in.c, the rest is mostly s/ia_subnetmask/ia_netmask. ok claudio dlg ryan
2009-12-15Ensure that the interface is valid before trying to access its flags.Joel Sing
ok claudio@
2009-12-15Ansify function declarations.Joel Sing
ok claudio@
2009-12-15Ensure that the interface is not null before trying to access its flags.Joel Sing
Fixes PR6274. ok claudio@
2007-12-14add sysctl entry points into various network layers, in particular toTheo de Raadt
provide netstat(1) with data it needs; ok claudio reyk
2007-12-13Add missing license. This file is 4.4BSD-derived with WIDE changes.Todd C. Miller
OK deraadt@
2007-07-20Remove inm_ifp from struct in_multi -- caching struct ifnet is dangerousClaudio Jeker
because interfaces may disappear without notice causing use after free bugs. Instead use the inm_ia->ia_ifp as a hint, struct in_ifaddr correctly tracks removals of interfaces and invalidates ia_ifp in such cases. looks good henning@ markus@
2007-05-27-staticDavid Gwynne
2005-09-19A few 'demon' -> 'daemon'.Kenneth R Westerback
ok deraadt@
2004-05-23missing splx; andrushock@korovino.netTheo de Raadt
2004-01-03put an mi wrapper around stdarg.h/varargs.h. gcc3 moved stdarg/varargs macrosMarc Espie
to built-ins, so eventually we will have one version of these files. Special adjustments for the kernel to cope: machine/stdarg.h -> sys/stdarg.h and machine/ansi.h needs to have a _BSD_VA_LIST_ for syslog* prototypes. okay millert@, drahn@, miod@.
2003-12-10de-register. deraadt okJun-ichiro itojun Hagino
2003-07-09do not flip ip_len/ip_off in netinet stack. deraadt ok.Jun-ichiro itojun Hagino
(please test, especially PF portion)