summaryrefslogtreecommitdiff
path: root/sys/netinet
AgeCommit message (Collapse)Author
2015-02-05Convert various rtrequest1(RTM_DELETE,...) calls to rtdeletemsg(9).Martin Pieuchot
This unify some code and notify userland for free. blambert@ agrees, ok bluhm@
2015-01-28Revert rtdeletemsg conversion. It was not ok'd, I misunderstood bluhm@'sMartin Pieuchot
email.
2015-01-26Call rtdeletemsg(9) instead of rerolling its code. As a bonus you'llMartin Pieuchot
get userland notification for free. ok blambert@, bluhm@
2015-01-26Do not always try to rtfree(9) route entries inside rtdeletemsg(9).Martin Pieuchot
Instead check the error code returned by this function and let the caller free the route entry when appropriate. ok bluhm@
2015-01-24Userland (base & ports) was adapted to always include <netinet/in.h>Theo de Raadt
before <net/pfvar.h> or <net/if_pflog.h>. The kernel files can be cleaned up next. Some sockaddr_union steps make it into here as well. ok naddy
2015-01-21To satisfy kernel grovellers and bad (but document) sysctlTheo de Raadt
practice, be pragmatic and #include <sys/timeout.h> for struct tcpb (glorious namespace violation) ok kettenis millert sthen
2015-01-21Remove the code to automagically find a "carpdev".Martin Pieuchot
The half-backed logic to find a parent interface before configuring an address on a carp(4) interface is responsible for too many layers of complexity resulting in various breakages everytime something change in the stack. So make carp(4) a bit less special. It now requires a parent interface like all the other pseudo-devices. ok mikeb@, dlg@, florian@, henning@
2015-01-19mikeb points out that 'struct ipsec_policy' can also be hidden by _KERNELTheo de Raadt
2015-01-19First step of hiding many kernel-only parts of <netinet/ip_ipsp.h>Theo de Raadt
under _KERNEL, and adjust the one consumer (netstat) so that it requests the exposure. Will take a few more rounds to get this right. ok mikeb
2015-01-13Only notify userland about resolved ARP entries if the Ethernet addressMartin Pieuchot
changed or if we asked for it. Should reduce the RTM_RESOLVE storm seeing by claudio@ With inputs from and ok mikeb@
2015-01-12Kill the global list of IPv4 addresses.Martin Pieuchot
ok claudio@, mikeb@, bluhm@
2015-01-08Factorize various duplicated chunks of (old and horrible) code, checkingMartin Pieuchot
for the validity of a given outgoing route entry into a single function. This change is inspired from FreeBSD r111767. The function introduced here, rt_checkgate(), should hopefully die in a near future. Why should it die? Well, it is way too late to do such validity checks: if your kernel can ends up in ether_output() with an invalid route, please do not let it try to find a new one that might do the job. Go read this function if you're wondering why you're getting messages like: "arpresolve: X.X.X.X: route without link local address" Since this horrible logic has survived 20 years of copy & past and small modifications for workarounds without a single clear commit message, let's assume it is full of dragons and try to play safe. This factorization is not intended to change any behavior. With much inputs from bluhm@, tested by weerd@ and florian@ on setups with p2p IPv6 interfaces. ok bluhm@, benno@, florian@
2015-01-08Do not unconditionally set a link-local address.Martin Pieuchot
carp(4) has a hack to update its Ethernet address which was also generating the corresponding IPv6 link-local address. Since the removal of the NOINET6 flag, this link-local address was generated even if no IPv6 address has been configured on the interface. This unbreak carp setup without v6 addresses, found the hard way by sebastia@. ok sebastia@, benno@, stsp@, @phessler
2015-01-05Explicitly check for a non NULL ifp in in_control(). Only MROUTINGMartin Pieuchot
ioctl(2)s are an exception to this rule. This makes clear that ifa cannot be used initialized as found by jsg@ with gcc/clang. ok krw@, bluhm@, jca@
2014-12-28remove KPDK. not really used, and a bad choice anyway. ok naddyTed Unangst
2014-12-23unifdef some more INET. v4 4life.Ted Unangst
2014-12-22Make sure rtrequest1(9) is called under splsoftnet().Martin Pieuchot
2014-12-19unifdef INET in net code as a precursor to removing the pretend option.Ted Unangst
long live the one true internet. ok henning mikeb
2014-12-19add messages to #error so we know what's what (and so unifdef doesn't poop)Ted Unangst
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-09More malloc() -> mallocarray() in the kernel.Doug Hogan
ok deraadt@ tedu@
2014-12-08Do not use a "struct route" when a "struct rtentry" is enough.Martin Pieuchot
ok millert@, bluhm@
2014-12-05Explicitly include <net/if_var.h> instead of pulling it in <net/if.h>.Martin Pieuchot
ok mikeb@, krw@, bluhm@, tedu@
2014-11-25Since in_broadcast() is now used to always iterate on all the interfacesMartin Pieuchot
of your system, put it on a diet and kill the superfluous logic. ok mikeb@
2014-11-25The proliferation of "struct route" in all its flavors didn't makeMartin Pieuchot
any good to our network stack. The most visible effect is the maze of #ifdef's and casts. But the real problem is the very fragile way of checking if a (cached) route entry is still valid or not. What should we do if the route jumped to another ifaddr or if its gateway has been changed? This change start the dance of "struct route" & friends removal by sending the completly useless "struct route_enc" to the bucket. Tweak & ok claudio@
2014-11-25unifdef -USCOPEDROUTING, no object change.Martin Pieuchot
2014-11-24Rename rt_ifa_addloop() into rt_ifa_addlocal() and make it return anMartin Pieuchot
error code on failure (unchecked for the moment). ok mikeb@, jmc@
2014-11-20sizes for simple free cases. sizeof(*) and one case where len is clear.Ted Unangst
2014-11-20Yet more #include de-duplication.Kenneth R Westerback
ok deraadt@ tedu@
2014-11-20In TCP and UDP layers do not (ab)use the receiving interface to checkMartin Pieuchot
for a multicast/broadcast destination address. These checks have already been done in the Ethernet and IP layers and the mbuf(9) should contain all the required information at this point. But since we cannot trust this spaghetti stack, be paranoid and make sure to set the flags in the IP input routines. Use explicit comments, requested by deraadt@. ok claudio@
2014-11-20funky spacing.Martin Pieuchot
2014-11-20Instead of playing hide-and-seek with the route to destination attachedMartin Pieuchot
to p2p interfaces always mark them as Multipath. This way we can have multiple routes to the same destination as long as the local address is different. ok mikeb@
2014-11-18move arc4random prototype to systm.h. more appropriate for most codeTed Unangst
to include that than rdnvar.h. ok deraadt dlg
2014-11-16remove now unnecessary casts from hash update calls.Ted Unangst
2014-11-15use siphash in the in_pcb hashing. this mitigates it against floodingDavid Gwynne
attacks. this is a textbook use of siphash. the idea of using siphash for this came from yasuoka-san, but i had the time to do it. he also tested and tweaked this diff. ok yasuoka@ mikeb@
2014-11-09To implement transparent relays for connectionless protocols, theAlexander Bluhm
pf the state has to vanish immediately when the relay closes the socket. To make this work reliably, the linkage between state and socket must be established with the first packet. This packet could be incomming or outgoing. Link the pf state in the socket layer earlier. This makes all tests in /usr/src/regress/sys/net/pf_divert pass. OK henning@
2014-11-06Let's just call a rdomain a rdomain.Martin Pieuchot
ok dlg@
2014-11-06mix the rtable into the hash for tcp sequence number generation.David Gwynne
ok tedu@ claudio@
2014-11-05Did you ever wonder why loopback's ifas have a destination address?Martin Pieuchot
It is of course not to make your life more complicated when you are dealing with ifa_ifwithaddr()! It was to reuse the point-to-point code to add a route to 127.0.0.1. But now we have local routes and we don't need this hack anymore :) ok mikeb@ as part of a larger diff.
2014-11-05Kill in_iawithaddr() and use ifa_ifwithaddr() directly.Martin Pieuchot
Note that ifa_ifwithaddr() might return a broadcast address, so if you don't want one make sure to filter them out. ok mikeb@
2014-11-04Remove "pl" suffix on pool names.Martin Pieuchot
ok dlg@, uebayasi@, mikeb@
2014-11-03Fix kernel stack overflow by preventing carp_send_ad_all() from re-entrantGerhard Roth
calls. Also, when adjusting demote counts, don't call carp_send_ad_all() for every ifgroup with a demote count of 1 but rather call it only once after adjusting the demote counts of all ifgroups. ok bluhm@ mpf@
2014-11-01Rename rtalloc1() into rtalloc(9) and convert its flags to only enableMartin Pieuchot
functionnality instead of a mix of enable/disable. ok bluhm@, jca@
2014-10-28Select a proper source address when the bound address isYASUOKA Masahiko
INADDR_BROADCAST the same as INADDR_ANY. ok mpi
2014-10-24Fix indentation of closing brace.Alexander Bluhm
From Florian Riehm
2014-10-20use sha512 instead of md5 for tcp isn. ok deraadtTed Unangst
2014-10-14Don't check for an empty list of interfaces. This is never true even ifMartin Pieuchot
you don't have a physical interface on your machine, so why rawip should be more clever^Wparanoid than the others? ok henning@, mikeb@
2014-10-14Use rtfree() instead of RTFREE(), NULLify some free'd route pointers andMartin Pieuchot
kill the macro. ok mikeb@, henning@
2014-10-08Remove #ifdef SO_OOBINLINE, it is always defined.Alexander Bluhm
OK henning@