summaryrefslogtreecommitdiff
path: root/sys/netinet6/ip6_input.c
AgeCommit message (Collapse)Author
2016-08-24Kill ip6_forward_rt reducing differences between v4 and v6.Martin Pieuchot
A single forwarding cache is not the answer. The answer is 42... err PF! ok bluhm@
2016-07-19protect a pf specific function with the correct #if. Fixes ramdisk building.Peter Hessler
(we got lucky before, because the variable that used to be checked was always available) OK bluhm@
2016-07-19In ip6_input() use a shortcut to detect our own address if the pfAlexander Bluhm
state key is linked to a socket inp. OK mpi@ henning@
2016-07-19Use a flag to indicate that a packet has been received on an IPv6Martin Pieuchot
anycast address. This will allow us to split ip6_input() in two parts using a queue in the middle. ok jca@, florian@, bluhm@
2016-07-18Kill the rtableid variable in ip6_input(). It does not make senseAlexander Bluhm
to store a field in an extra variable that is only accessed twice. OK mpi@
2016-07-14Drop received packets with an IPv4-compatible address as source orMartin Pieuchot
destination as per RFC4213. We're not in 1999 anymore, what was earlier a "stronger check than RFC1933" is now a best practice. This matches the behavior of the reject (R) routes added by default by netstart(8). ok jca@, florian@, claudio@, bluhm@
2016-07-06Move Hop-by-Hop processing into its own function ip6_hbhchcheck().Martin Pieuchot
This function will help splitting the IPv6 input path in two, in order to run the first part without KERNEL_LOCK() held. Tested by Hrvoje Popovski, ok bluhm@
2016-07-05Expand IN6_IFF_NOTREADY, ok bluhm@Martin Pieuchot
2016-05-19Remove sysctl net.inet6.ip6.v6onlyJeremie Courreges-Anglas
This sysctl is a no-op, read-only since it was introduced. There are no plans to support IPv4-mapped addresses on OpenBSD, thus this sysctl is meaningless. Noticed by djm@, ok claudio@ mpi@ sthen@ henning@
2016-05-07Remove duplicate check.Martin Pieuchot
ok sthen@, visa@
2016-04-19Instead of freeing a cached RTF_MPATH route after using it, free itMartin Pieuchot
when the next packet needs to be forwarded, just like if the route was invalid. ok mikeb@, claudio@
2016-04-11Search in the correct routing table if NPF is not defined.Martin Pieuchot
ok jca@, phessler@, mikeb@
2016-03-29remove dead stores and unused variablesCharles Longeau
ok bluhm@ jca@
2016-03-14Change a bunch of (<blah> *)0 to NULL.Kenneth R Westerback
ok beck@ deraadt@
2016-01-21Introduce in{,6}_hasmulti(), two functions to check in the hot path ifMartin Pieuchot
an interface joined a specific multicast group. ok phessler@, visa@, dlg@
2016-01-06fix comment typosStuart Henderson
2015-12-03ip_send()/ip6_send() allow PF to send response packet in ipsoftnet task.Alexandr Nedvedicky
this avoids current recursion to pf_test() function. the change also switches icmp_error()/icmp6_error() to use ip_send()/ip6_send() so they are safe for PF. The idea comes from Markus Friedl. bluhm, mikeb and mpi helped me a lot to get it into shape. OK bluhm@, mpi@
2015-11-11Store the index of the lo0 interface instead of a pointer to itsMartin Pieuchot
descriptor. Allow to get rid of two if_ref() in the output paths. ok dlg@
2015-10-29RFC 2292 API support was removed 9 years ago, but left in a binary compatTed Unangst
ABI form for the sake of existing programs. no programs from that era have been able to run for quite some time. Kill it all. ok deraadt florian millert mpi (I believe this is my first IPv6 diff. Future, here I come!)
2015-10-23replace pointer arithmetic and casts with offsetofJonathan Gray
ok mpi@ bluhm@
2015-10-19Stop checking for RTF_UP directly, call rtisvalid(9) instead.Martin Pieuchot
While here add two missing ``rtableid'' checks in in6_selectsrc(). ok bluhm@
2015-10-13Make use of rtisvalid(9) to check if local route entries match existingMartin Pieuchot
configured addressses. ok mikeb@
2015-09-11if_put for ip6_input. OK mpi@Claudio Jeker
2015-09-10Fewer in6_ifstat_inc()Martin Pieuchot
ok mikeb@
2015-07-16Kill IP_ROUTETOETHER.Martin Pieuchot
This pseudo-option is a hack to support return-rst on bridge(4). It passes Ethernet information via a "struct route" through ip_output(). "struct route" is slowly dying... ok claudio@, benno@
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@
2015-06-08More damned eye searing whitespace. No change to .o files.Kenneth R Westerback
2015-04-10replace the use of ifqueues for most input queues serviced by netisrDavid Gwynne
with niqueues. this change is so big because there's a lot of code that takes pointers to different input queues (eg, ether_input picks between ipv4, ipv6, pppoe, arp, and mpls input queues) and falls through to code to enqueue packets against the pointer. if i changed only one of the input queues id have to add sepearate code paths, one for ifqueues and one for niqueues in each of these places by flipping all these input queues at once i can keep the currently common code common. testing by mpi@ sthen@ and rafael zalamena ok mpi@ sthen@ claudio@ henning@
2015-03-14Remove some includes include-what-you-use claims don'tJonathan Gray
have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
2015-02-09Implement 2 sysctl to retrieve the multicast forwarding cache (mf6c) and theClaudio Jeker
multicast interface table (mif6). Will be used by netstat soon. Looked over by guenther@
2015-02-09provide a net.inet6.ip6.ifq sysctl so people can see and fiddleDavid Gwynne
with the ip6intrq. ok claudio@
2015-02-09Remove a chunk missed in previous scope ID shuffling creating wrongMartin Pieuchot
states for external traffic through a link-local address. Found the hard way and fix tested by bluhm@.
2015-02-05Make sure pf(4) does not see embedded scopes.Martin Pieuchot
Packets destinated to link-local addresses are looped back with embedded scopes because we cannot restore them using the receiving interface (lo0). Embedded scopes are needed by the routing table to match RTF_LOCAL routes, but pf(4) never saw them and existing rules are likely to break without teaching the rule engine about them, found by dlg@ the hard way. So save and restore embedded scopes around pf_test() for packets going through loopback. ok dlg@, mikeb@
2015-01-19<netinet6/in6_ifattach.h> is not needed here.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-05Explicitly include <net/if_var.h> instead of pulling it in <net/if.h>.Martin Pieuchot
ok mikeb@, krw@, bluhm@, tedu@
2014-11-20Rework the handling of interfaces and IPv6 addresses for local delivery.Martin Pieuchot
- Unicast packets sent to any local address will have their interface set to loobpack. - In order to differentiate traffic from interfaces having identical link-local addresses, provide the scoped addresses to pf(4). - Update the icmp6 state lookup logic to match scoped MLL addresses. - Remove a shortcut in ip6_input() that bypasses pf and always look for an RTF_LOCAL route. Packets sent to multicast addresses still retain their original interface due to the fact that local multicast packet delivering does not use if_output. This makes ping6 to link-local addresses work even with pf enabled and "set skip" on loopbacks, reported by Pieter Verberne. Debugged, analysed and tested with mikeb@. ok mikeb@, henning@, sthen@
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-10-14Use rtfree() instead of RTFREE(), NULLify some free'd route pointers andMartin Pieuchot
kill the macro. ok mikeb@, henning@
2014-09-27Kill rtalloc() and update rtalloc1() and rtalloc_mpath() to no longerMartin Pieuchot
rely on "struct route" that should die. ok claudio@
2014-07-22Fewer <netinet/in_systm.h> !Martin Pieuchot
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-06-03Do not include <sys/malloc.h> where it is not needed.Martin Pieuchot
2014-05-13Remove some m->m_pkthdr.rcvif dereference to help for upcomingMartin Pieuchot
receiving pointer -> index conversion. No functional change. ok claudio@, mikeb@, lteo@
2014-04-14"struct pkthdr" holds a routing table ID, not a routing domain one.Martin Pieuchot
Avoid the confusion by using an appropriate name for the variable. Note that since routing domain IDs are a subset of the set of routing table IDs, the following idiom is correct: rtableid = rdomain But to get the routing domain ID corresponding to a given routing table ID, you must call rtable_l2(9). claudio@ likes it, ok mikeb@
2014-02-13Another chunk of IPv6 dead code bites the dust.Martin Pieuchot
ok bluhm@, mikeb@
2014-02-05Kill some dead code.Martin Pieuchot
ok bluhm@
2013-11-15After discussion with deraadt@ and Fernando Gont, it seems that theAlexander Bluhm
stack should still scan for IPv6 type 0 routing headers. There are OpenBSD routers running without pf and there are plenty of legacy implementations supporting RH0. Bring back the function ip6_check_rh0hdr() that I removed a month ago. As an improvement to the prevoius solution, only scan the header chain in ip6_input() if the packet has not been inspected by pf. Both implementations drop packets with RH0 anywhere in the extension header chain. OK mikeb@ henning@
2013-11-11Replace most of our formating functions to convert IPv4/6 addresses fromMartin Pieuchot
network to presentation format to inet_ntop(). The few remaining functions will be soon converted. ok mikeb@, deraadt@ and moral support from henning@
2013-10-28kill kame version symbols and sysctlTheo de Raadt
ports tree grep run by sthen