summaryrefslogtreecommitdiff
path: root/sys/netinet/ip_mroute.c
AgeCommit message (Collapse)Author
2017-09-01Change sosetopt() to no longer free the mbuf it receives and changeMartin Pieuchot
all the callers to call m_freem(9). Support from deraadt@ and tedu@, ok visa@, bluhm@
2017-06-26Assert that the corresponding socket is locked when manipulating socketMartin Pieuchot
buffers. This is one step towards unlocking TCP input path. Note that all the functions asserting for the socket lock are not necessarilly MP-safe. All the fields of 'struct socket' aren't protected. Introduce a new kernel-only kqueue hint, NOTE_SUBMIT, to be able to tell when a filter needs to lock the underlying data structures. Logic and name taken from NetBSD. Tested by Hrvoje Popovski. ok claudio@, bluhm@, mikeb@
2017-06-19The IP multicast forward functions return an errno, call the variableAlexander Bluhm
error. Make the ip_mforward() return value consistent. Simplify the caller logic in ipv6_input() like in IPv4. OK mpi@
2017-05-16Sync three changes that were caught by IPv6 multicast routing review:Rafael Zalamena
* use a variable to allow disabling debugs on run-time * fix a potential memory leak on copyout() failure * don't just blindly use the first address provided by ifalist ok bluhm@
2017-05-16Make return values more meaningful by using errno instead of -1 or 1.Rafael Zalamena
ok bluhm@
2017-05-16Replace remaining splsoftassert(IPL_SOFTNET) by NET_ASSERT_LOCKED().Martin Pieuchot
ok visa@
2017-05-16Let malloc() block when the caller of the add route function isRafael Zalamena
setsockopt(), otherwise use non-blocking malloc() for network stack calls. ok bluhm@
2017-05-16Call rtfree() after each use of routes and make sure the route is validRafael Zalamena
when finding one. Since rtfree() is being called and rt_llinfo being removed, add checks everywhere to make sure we are using a route that is not being removed. ok bluhm@
2017-04-06Convert bcopy to memcpy where the memory does not overlap, otherwise,David Hill
use memmove. While here, change some previous conversions to a simple assignment. ok deraadt@
2017-03-17Be more strict on all route iterations, lets always make sure that weRafael Zalamena
are not going to get a unicast route by accident. ok mpi@
2017-03-14Make mfc_find() more strict when looking for routes, fixes a problemRafael Zalamena
causing ip_mforward() not to send packets to the userland multicast routing daemon. Reported and tested by Paul de Weerd. ok bluhm@, claudio@
2017-02-09Unbreak 'netstat -g' and make multicast route stats sysctl more robust.Rafael Zalamena
ok mpi@
2017-02-08Test for NULL before dereferencing a pointer not after.Jonathan Gray
ok krw@
2017-02-01In sogetopt, preallocate an mbuf to avoid using sleeping mallocs withDavid Hill
the netlock held. This also changes the prototypes of the *ctloutput functions to take an mbuf instead of an mbuf pointer. help, guidance from bluhm@ and mpi@ ok bluhm@
2017-01-12Clean up multicast files from unused definitions and comments.Rafael Zalamena
ok mpi@
2017-01-11Remove mfc hash tables and use the OpenBSD routing table for multicastRafael Zalamena
routes. Beside the code simplification and removal, we also get to see the multicast routes now in the route(8) utility. ok mpi@
2017-01-06Remove the global viftable vector that holds the virtual interfacesRafael Zalamena
configuration and instead use ifnet to store the configuration and counters. With this we can safely use multicast routing daemons on multiple domains without vif id colisions. ok mpi@
2017-01-06Simplify code by removing some old pullup macro, killing some variablesRafael Zalamena
and using m_dup_pkt() instead of m_copym() with max_linkhdr space adjust on packet sending to avoid more mbuf allocations. with input from millert@ and mikeb@, ok mikeb@
2017-01-06Kill various splsoftnet().Martin Pieuchot
ok rzalamena@, visa@
2017-01-05Remove some unnecessary code abstractions and while here remove aRafael Zalamena
splsoftnet. ok mikeb@
2016-12-22Remove PIM support from the multicast stack.Rafael Zalamena
ok mpi@
2016-12-21Fix build without PIM defined.Martin Pieuchot
2016-12-21Fix PIM compilation even though it is disabled.Rafael Zalamena
ok bluhm@
2016-12-20Call the multicast timer callback per domain instead of for all domainsRafael Zalamena
this way we save doing big tables walk and iterating tables that we don't need to. ok mpi@
2016-12-20Remove unused timeout that was never being set.Rafael Zalamena
ok reyk@
2016-12-19Kill unused function.Rafael Zalamena
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-13Propagate the routing table id in ip_mrouter_set() so the MRT_ADD_VIFRafael Zalamena
calls won't fail anymore when doing from a different rdomain. ok mpi@
2016-11-29Kill unused 'struct route'.Martin Pieuchot
2016-11-29m_free() and m_freem() test for NULL. Simplify callers which had their ownJonathan Gray
NULL tests. ok mpi@
2016-09-24use hashfree. from Mathieu -Ted Unangst
ok guenther
2016-03-07Sync no-argument function declaration and definition by adding (void).Christian Weisgerber
ok mpi@ millert@
2015-11-14Remove mrtdebug and reduce differences with the v6 version.Martin Pieuchot
Debug informations can already be accessed via mrtstat and pimstat.
2015-11-13Do not cast malloc(9) results.Martin Pieuchot
2015-11-13Kill another tunnel leftover and keep PIM stuff inside #ifdef PIM.Martin Pieuchot
2015-11-12Kill another leftover from the tunnel support removal and add more PIM.Martin Pieuchot
2015-11-12Sync headers and get rid of #ifdef MROUTING.Martin Pieuchot
2015-11-12Remove VIFF_TUNNEL leftovers, tunnels aren't supported since 2006.Martin Pieuchot
Even pimd(8) no longer support them.
2015-11-12Fix PIM build.Martin Pieuchot
2015-09-12Introduce if_input_local() a function to feed local traffic back toMartin Pieuchot
the protocol queues. It basically does what looutput() was doing but having a generic function will allow us to get rid of the loopback hack overwwritting the rt_ifp field of RTF_LOCAL routes. ok mikeb@, dlg@, claudio@
2015-09-01Replace sockaddr casts with the proper satosin(), ... calls.Alexander Bluhm
From David Hill; OK mpi@; tested kspillner@; tweaks bluhm@
2015-08-24In kernel initialize struct sockaddr_in and sockaddr_in6 to zeroAlexander Bluhm
everywhere to avoid passing around pointers to uninitialized stack memory. While there, fix the call to in6_recoverscope() in fill_drlist(). OK deraadt@ mpi@
2015-07-15rename mbuf ** parameter from m to mp, to match other similar codeTheo de Raadt
2015-06-30Get rid of the undocumented & temporary* m_copy() macro added forMartin Pieuchot
compatibility with 4.3BSD in September 1989. *Pick your own definition for "temporary". ok bluhm@, claudio@, dlg@
2015-02-09Implement 2 sysctl to retrieve the multicast forwarding cache (mfc) and theClaudio Jeker
virtual interface table (vif). Will be used by netstat soon. Looked over by guenther@
2015-02-08De-static to make ddb hangman harder. OK phessler, henningClaudio Jeker
2015-02-07mechanical conversion of this code to using siphash instead of some xors.David Gwynne
ok tedu@ claudio@
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-12-05Explicitly include <net/if_var.h> instead of pulling it in <net/if.h>.Martin Pieuchot
ok mikeb@, krw@, bluhm@, tedu@