summaryrefslogtreecommitdiffstats
path: root/sys/netinet/igmp.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Partial revert of previous. Only the queue(3) stuff should have gone in.cheloha2018-10-181-38/+7
|
* igmp, struct router_info: use queue(3)cheloha2018-10-181-24/+50
| | | | | | | | | | In particular, use LIST_* to preserve O(n) removal in rti_delete(). While here, clean up two malloc(9) calls. Suggested by mpi@. ok visa@
* Sprinkle some NET_ASSERT_LOCKED(), const and co to prepare runningmpi2017-11-201-1/+4
| | | | | | pr_input handlers without KERNEL_LOCK(). ok visa@
* Move NET_{,UN}LOCK into individual slowtimo functions.florian2017-10-291-4/+9
| | | | | | Direction suggested by mpi OK mpi, visa
* Reduces the scope of the NET_LOCK() in sysctl(2) path.mpi2017-10-091-4/+10
| | | | | | Exposes per-CPU counters to real parrallelism. ok visa@, bluhm@, jca@
* When dealing with mbuf pointers passed down as function parameters,bluhm2017-06-191-2/+2
| | | | | | | bugs could easily result in use-after-free or double free. Introduce m_freemp() which automatically resets the pointer before freeing it. So we have less dangling pointers in the kernel. OK krw@ mpi@ claudio@
* Replace remaining splsoftassert(IPL_SOFTNET) by NET_ASSERT_LOCKED().mpi2017-05-161-4/+4
| | | | ok visa@
* If m is not a continuous mbuf cluster, m_pullup() in pr_input maybluhm2017-05-041-2/+2
| | | | | | | 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@
* Pass down the address family through the pr_input calls. Thisbluhm2017-04-141-6/+6
| | | | | allows to simplify code used for both IPv4 and IPv6. OK mikeb@ deraadt@
* When building counter memory in preparation to copy to userland, alwaysderaadt2017-04-051-2/+2
| | | | | | zero the buffers first. All the current objects appear to be safe, however future changes might introduce structure pads. Discussed with guenther, ok bluhm
* Always allocate counters memory using type M_COUNTERS.jca2017-02-051-2/+2
| | | | | | | 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@
* Use CTASSERT instead of KASSERT for a few sysctl that use the counters APIjca2017-01-311-2/+2
| | | | ok dlg@ mpi@
* Change the IPv4 pr_input function to the way IPv6 is implemented,bluhm2017-01-291-19/+22
| | | | | | | 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@
* Since raw_input() and route_input() are gone from pr_input, we canbluhm2017-01-251-12/+6
| | | | | | make the variable parameters of the protocol input functions fixed. Also add the proto to make it similar to IPv6. OK mpi@ guenther@ millert@
* convert igmp_stat into per-cpu countersdlg2017-01-041-18/+38
| | | | | | | | it follows the same pattern used in previous conversions. from Dimitris Papastamos (thank you). ok mpi@
* Extend the multicast sockets and multicast hash table support to multiplerzalamena2016-12-191-2/+2
| | | | | | | domains. This is one step towards supporting to run more than one multicast socket in different domains at the same time. ok mpi@
* Move the if_get/if_put to the caller of igmp_sendpkt so we avoid havingrzalamena2016-12-161-15/+10
| | | | | | to do this lookup twice. Suggested by and ok mpi@
* Set the rtableid for new mbufs when sending packets in igmp_sendpkt().rzalamena2016-12-141-2/+11
| | | | ok mikeb@, phessler@
* Remove recursive splsoftnet()s in ioctl(2) path.mpi2016-12-051-7/+2
|
* Assert that every slow/fast timeout routine is called at IPL_SOFTNET.mpi2016-11-281-7/+5
| | | | This removes multipe recursive splsoftnet()/splx() dances.
* Store an interface index instead of a pointer that's never dereferenced.mpi2015-11-111-9/+8
| | | | | | Get rid of an if_ref()/if_put() dance. ok dlg@
* if_put() after if_get().mpi2015-09-131-1/+2
| | | | ok dlg@
* if_put after if_get in igmp_joingroupdlg2015-09-111-5/+7
| | | | ok mpi@ claudio@
* move the guts of igmp_input into a igmp_input_if function and calldlg2015-09-101-13/+23
| | | | | | | it with the reference from if_get held so we can if_put it easly after the guts have run. ok claudio@
* fairly simple sizes for free(); ok teduderaadt2015-08-281-2/+2
|
* Store a unique ID, an interface index, rather than a pointer to thempi2015-06-161-2/+8
| | | | | | | | | | | | | | | 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@
* Remove the "multicast_" prefix from the fields a multicast-only struct.mpi2014-12-171-4/+4
| | | | Prodded by claudio@ and mikeb@
* Use an interface index instead of a pointer for multicast options.mpi2014-12-171-2/+2
| | | | | | | | | | | | 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@
* move arc4random prototype to systm.h. more appropriate for most codetedu2014-11-181-2/+1
| | | | to include that than rdnvar.h. ok deraadt dlg
* remove uneeded proc.h includesjsg2014-09-141-2/+1
| | | | ok mpi@ kspillner@
* remove uneeded route.h includesjsg2014-09-081-2/+1
| | | | ok miod@ mpi@
* Fewer <netinet/in_systm.h> !mpi2014-07-221-2/+1
|
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-2/+2
| | | | after discussions with beck deraadt kettenis.
* decouple struct uvmexp into a new file, so that uvm_extern.h and sysctl.hderaadt2014-07-081-1/+2
| | | | | don't need to be married. ok guenther miod beck jsing kettenis
* Includes a router altert option (RAO) in IGMP packets. Without thismpi2014-05-121-5/+28
| | | | | | | 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@
* ip_output() using varargs always struck me as bizarre, esp since it's onlyhenning2014-04-211-2/+2
| | | | | | 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
* we'll do fine without casting NULL to struct foo * / void *henning2014-04-211-3/+2
| | | | ok gcc & md5 (alas, no binary change)
* Do not clean the multicast records of an interface when it is destroyedmpi2014-01-211-10/+15
| | | | | | | | | | | (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@
* Change the way protocol multicast addresses are linked to an interface.mpi2013-11-281-5/+19
| | | | | | | | | | | | | | | | | | | | | | 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@
* Abstract the fact that IPv4 muticast records are linked to thempi2013-10-181-8/+8
| | | | | | | | | 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@
* Change the macros used to iterate over the multicast records of anmpi2013-10-141-18/+22
| | | | | | | | | | 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@
* tedu broken Resource Reservation Protocol code that was ifdef RSVP_ISI.mpi2013-05-021-4/+2
| | | | ok deraadt@, tedu@ (implicit)
* Remove various external variable declaration from sources files andmpi2013-04-101-4/+1
| | | | | | | move them to the corresponding header with an appropriate comment if necessary. ok guenther@
* remove proc.h include from uvm_map.h. This has far reaching effects, astedu2010-04-201-1/+2
| | | | | | 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
* let's admit it's not 1992 any more. CIDR is around for a long time, evenhenning2010-01-131-3/+3
| | | | | | | | | | | 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
* Ensure that the interface is valid before trying to access its flags.jsing2009-12-151-1/+2
| | | | ok claudio@
* Ansify function declarations.jsing2009-12-151-18/+10
| | | | ok claudio@
* Ensure that the interface is not null before trying to access its flags.jsing2009-12-151-1/+2
| | | | | | Fixes PR6274. ok claudio@
* add sysctl entry points into various network layers, in particular toderaadt2007-12-141-1/+30
| | | | provide netstat(1) with data it needs; ok claudio reyk
* Add missing license. This file is 4.4BSD-derived with WIDE changes.millert2007-12-131-1/+65
| | | | OK deraadt@