summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/raw_ip6.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
* Kill yet another argument to functions in IPv6. This time ip6_output'sclaudio2015-09-111-2/+2
| | | | | | | ifpp - XXX: just for statistics ifpp is always NULL in all callers so that statistic confirms ifpp is dying OK mpi@
* in6_embedscope() needs to lose some weight. Remove the last argument.claudio2015-09-111-2/+2
| | | | | | | | | In all but two calls NULL is passed and in the other 2 cases the ifp is only used to maybe feed it to in6_selecthlim() to select the hoplimit for the link. Since in6_embedscope() only works on link-local addresses it does not matter what hop limit we select since the destination is directly reachable. OK florian@ mpi@
* It is time to put inet6 on a diet. Use the flensing knife and cut outclaudio2015-09-101-2/+2
| | | | | the 3rd argument of in6_recoverscope() and make it return void. OK dlg@ mikeb@
* Kill icmp6_ifstat_inc() and associated per-ifp storage.mpi2015-09-091-4/+2
| | | | | | The SIOCGIFSTAT_ICMP6 is no longer supported. ok dlg@, mikeb@, claudio@
* Kill a couple of if_get()s only needed to increment per-ifp IPv6 stats.mpi2015-09-091-10/+4
| | | | | | | | We do not export those per-ifp statistics and they will soon all die. "We're putting inet6 on a diet" claudio@ ok dlg@, mikeb@, claudio@
* Implement pf divert-reply for raw sockets. Note that an emptybluhm2015-07-281-1/+4
| | | | | | | | | divert->addr means that the rule has a divert-reply option. With divert-to the divert->addr is always set. The divert-reply rules should compare the original packet with the socket addresses. So skip the step that compares the inp->inp_laddr with the empty divert->addr. OK mikeb@
* iDo not link an ICMP6 socket to the pf state. When multiple ICMPbluhm2015-07-281-2/+3
| | | | | | | packets with a different ICMP ID are sent over the same raw socket, multiple states should be created. Put a similar check into rip6_output() like in the IPv4 case. OK mikeb@
* m_freem() can handle NULL, do not check for this condition beforehands.deraadt2015-07-151-11/+7
| | | | ok stsp mpi
* Get rid of the undocumented & temporary* m_copy() macro added formpi2015-06-301-2/+2
| | | | | | | | compatibility with 4.3BSD in September 1989. *Pick your own definition for "temporary". ok bluhm@, claudio@, dlg@
* Store a unique ID, an interface index, rather than a pointer to thempi2015-06-161-5/+10
| | | | | | | | | | | | | | | 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@
* More damned eye searing whitespace. No change to .o files.krw2015-06-081-7/+7
|
* Do not check if the interface index matches the scope when all we wantmpi2015-03-041-2/+2
| | | | | | | | | | | is to clear the damn embedded scope. At this point the receiving interface should not matter and will in the future be cleared to prevent such layer violations. This prevent exporting addresses with embedded scope to userland. Found the hardway by and ok florian@
* Userland (base & ports) was adapted to always include <netinet/in.h>deraadt2015-01-241-4/+5
| | | | | | 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
* Explicitly include <net/if_var.h> instead of pulling it in <net/if.h>.mpi2014-12-051-1/+2
| | | | ok mikeb@, krw@, bluhm@, tedu@
* To implement transparent relays for connectionless protocols, thebluhm2014-11-091-1/+6
| | | | | | | | | | 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@
* Don't check for an empty list of interfaces. This is never true even ifmpi2014-10-141-6/+2
| | | | | | | you don't have a physical interface on your machine, so why rawip should be more clever^Wparanoid than the others? ok henning@, mikeb@
* 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.
* Invert the signature logic of in{,6}_selectsrc, make them return thejca2014-04-181-13/+9
| | | | | | | | error code and pass the resulting source address back to the caller through a pointer, as suggested by chrisz. This gives us more readable code, and eases the deletion of useless checks in the callers' error path. Add a bunch of "0 -> NULL" conversions, while here. ok chrisz@ mpi@
* "struct pkthdr" holds a routing table ID, not a routing domain one.mpi2014-04-141-3/+3
| | | | | | | | | | | | | | 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@
* Name the local variables for struct ifaddr consistently "ifa".bluhm2014-01-081-4/+4
| | | | OK mikeb@
* Switch inpt_queue from CIRCLEQ to TAILQ. Thus ending use of CIRCLEQkrw2013-12-201-2/+2
| | | | | | | in the base. Ports fixes to follow shortly for the two ports (gkrellm and net-snmp) affected. ok zhuk@ millert@
* Remove unused proc argument in in6_control().mpi2013-11-221-2/+2
| | | | ok henning@, mikeb@
* Back when some NRL code was merged into KAME to create the *BSD IPV6deraadt2013-10-231-84/+63
| | | | | | | | stack (factoid: by a bunch of people in my living room), some compatibility #define's were created to shim incompatible inpcb access methods. There was an understanding they would eventually be removed. Since they are error prone, and 1999 is a long time ago, now they die. ok mikeb claudio mpi
* Put a large chunk of the IPv6 rdomain support in-tree.phessler2013-10-201-4/+5
| | | | | | Still some important missing pieces, and this is not yet enabled. OK bluhm@
* The header file netinet/in_var.h included netinet6/in6_var.h. Thisbluhm2013-10-171-2/+2
| | | | | | | created a bunch of useless dependencies. Remove this implicit inclusion and do an explicit #include <netinet6/in6_var.h> when it is needed. OK mpi@ henning@
* Implement pf divert-to and divert-reply also for IPv6 raw sockets.bluhm2013-06-041-1/+18
| | | | OK henning@ markus@
* Pass the routing domain to IPv6 pr_ctlinput() like in IPv4.bluhm2013-06-011-2/+2
| | | | OK claudio@
* Remove a bunch of sockaddr_in6 pointer casts and replace othersbluhm2013-05-311-4/+4
| | | | | | with sin6tosa() or satosin6() inline functions. This allows the compiler to check the types more strictly. OK mpi@
* The function rip6_ctlinput() claims that sa6_src is constant tobluhm2013-05-311-5/+5
| | | | | | | | | | allow the assingment of &sa6_any. But rip6_ctlinput() could not guarantee that as it casted away the const attribute when it passes the pointer to in6_pcbnotify(). Replace sockaddr with const sockaddr_in6 in the in6_pcbnotify() parameters. This reduces the number of casts. Also adjust in6_pcbhashlookup() to handle the const attribute correctly. Input and OK claudio@
* tedu broken Resource Reservation Protocol code that was ifdef RSVP_ISI.mpi2013-05-021-2/+1
| | | | ok deraadt@, tedu@ (implicit)
* Make the SO_BINDANY socket option also work for raw IPv6 sockets.bluhm2013-04-071-1/+2
| | | | OK markus@
* There is no IPv6 default scope in OpenBSD. Remove leftovers.bluhm2013-04-011-28/+1
| | | | | No binary change. OK claudio@
* The call to in_pcballoc() in user request attach was handled inbluhm2013-03-311-8/+4
| | | | | | | | three different ways. Use the same code in udp_usrreq() and rip_usrreq() and rip6_usrreq(). This also fixes a pcb and socket leak in udp_usrreq() in case soreserve() fails. Put an splsoftassert() into in_pcballoc() for safety. OK mpi@
* Restrict protocol numbers for raw sockets to the range from 0 to 255.bluhm2013-03-301-1/+5
| | | | OK deraadt@ guenther@
* no need for a lot of code to include proc.htedu2013-03-281-2/+1
|
* Unfortunately the satosin, sintosa, ifatoia, satosin6, sin6tosa,bluhm2013-03-281-2/+1
| | | | | | | ifatoia6 macros do not check the source type. They just cast anything. Remove needless casts and do not use those macros if the source type does not match. Remove duplicate defines. No binary change. OK kettenis@ krw@
* tedu faith(4), suggested by todd@ some weeks ago after a submission bympi2013-03-141-13/+1
| | | | | | dhill. ok krw@, mikeb@, tedu@ (implicit)
* Replace the cast to struct in6_ifaddr pointer with the ifatoia6() macro.bluhm2013-03-041-2/+2
| | | | | No binary change. OK claudio@
* Add the IP_DIVERTFL socket option on divert(4) sockets to controlbenno2012-10-211-3/+36
| | | | | | which packets (as in direction) of the traffic will be diverted through the divert socket. ok claudio@, henning@
* rdomain support for IPv6sperreault2011-11-241-4/+8
| | | | ok mikeb
* Revert the pf->socket linking diff.oga2011-05-131-21/+1
| | | | | | | | | | | | | | | | | | | | | | | | | at least krw@, pirofti@ and todd@ have been seeing panics (todd and krw with xxxterm not sure about pirofti) involving pool corruption while using this commit. krw and todd confirm that this backout fixes the problem. ok blambert@ krw@, todd@ henning@ and kettenis@ Double link between pf states and sockets. Henning has already implemented half of it. The additional part is: - The pf state lookup for outgoing packets is optimized by using mbuf->inp->state. - For incomming tcp, udp, raw, raw6 packets the socket lookup always is optimized by using mbuf->state->inp. - All protocols establish the link for incomming packets. - All protocols set the inp in the mbuf for outgoing packets. This allows the linkage beginning with the first packet for outgoing connections. - In case of divert states, delete the state when the socket closes. Otherwise new connections could match on old states instead of being diverted to the listen socket. ok henning@
* Double link between pf states and sockets. Henning has alreadybluhm2011-04-241-1/+21
| | | | | | | | | | | | | | | | implemented half of it. The additional part is: - The pf state lookup for outgoing packets is optimized by using mbuf->inp->state. - For incomming tcp, udp, raw, raw6 packets the socket lookup always is optimized by using mbuf->state->inp. - All protocols establish the link for incomming packets. - All protocols set the inp in the mbuf for outgoing packets. This allows the linkage beginning with the first packet for outgoing connections. - In case of divert states, delete the state when the socket closes. Otherwise new connections could match on old states instead of being diverted to the listen socket. ok henning@
* Add the same SS_CANTRCVMORE check as was done in the other inputclaudio2011-04-041-1/+3
| | | | functions. OK blambert@
* 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
* Initial support for routing domains. This allows to bind interfaces toclaudio2009-06-051-2/+3
| | | | | | | | | alternate routing table and separate them from other interfaces in distinct routing tables. The same network can now be used in any doamin at the same time without causing conflicts. This diff is mostly mechanical and adds the necessary rdomain checks accross net and netinet. L2 and IPv4 are mostly covered still missing pf and IPv6. input and tested by jsg@, phessler@ and reyk@. "put it in" deraadt@
* When accessing cached routes make sure the route is actually still valid.claudio2008-11-231-5/+4
| | | | | | | | Before accessing a ro_rt make sure the route is either freshly allocated or RTF_UP is set. If not ro_rt should be freed and reallocated or at least no info from the ro_rt should be considered valid. This seems to solve the crashes seen by Felipe Alfaro Solana. some sort of OK dlg@
* remove dead stores and newly created unused variables.chl2008-09-171-6/+1
| | | | | | Found by LLVM/Clang Static Analyzer. ok henning@ mpf@
* ANSIfy to sync with KAME. From Karl Sjodahl <dunceor@gmail.com>.mcbride2008-06-111-18/+7
| | | | ok todd deraadt naddy bluhm
* add sysctl entry points into various network layers, in particular toderaadt2007-12-141-1/+22
| | | | provide netstat(1) with data it needs; ok claudio reyk