summaryrefslogtreecommitdiff
path: root/sys/netinet6
AgeCommit message (Collapse)Author
2015-10-23replace pointer arithmetic and casts with offsetofJonathan Gray
ok mpi@ bluhm@
2015-10-22Make sure that the address matching the key (destination) of a routeMartin Pieuchot
entry is attached to this entry. ok phessler@, bluhm@
2015-10-22Use rt_ifp instead of rt_ifa->ifa_ifp.Martin Pieuchot
ok bluhm@
2015-10-22Inspired by satosin(), use inline functions to convert sockaddr dl.Alexander Bluhm
Instead of casts they check wether the incoming object has the expected type. So introduce satosdl() and sdltosa() in the kernel. OK mpi@
2015-10-22Use rt_ifp as intended.Martin Pieuchot
During s2k15 we fixed this ugly 20+ years loopback hack of having a rt_ifp different than rt_ifa->ifa_ifp. ok millert@, bluhm@
2015-10-22Kill dead code missed in per-ifp counter removal.Martin Pieuchot
ok millert@, bluhm@
2015-10-20At guenther's suggestion replace dnssocket() with a SOCK_DNS flag onTheo de Raadt
socket(). Without pledge, all other socket behaviours become permitted, except this one case: connect/send* only works to *:53. In pledge mode, a very few are further restricted. Some backwards compatibility for the dnssocket/dnsconnect calls will remain in the tree temporarily so that people can build through the transition. ok tedu guenther semarie
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-19Remove superfluous NULL checks.Martin Pieuchot
ifa are refcounted to ensure that rt_ifa is always valid.
2015-10-19deduplicate in[6]_pcbbind() port scan loop.Vincent Gross
ok mpi@
2015-10-18Add two new system calls: dnssocket() and dnsconnect(). This creates aTheo de Raadt
SS_DNS tagged socket which has limited functionality (for example, you cannot accept on them...) The libc resolver will switch to using these, therefore pledge can identify a DNS transaction better. ok tedu guenther kettenis beck and others
2015-10-15in6_pcbconnect() returns EADDRNOTAVAIL whenVincent Gross
all the ports in the range portfirst .. portlast are in use. ok millert@, mpi@
2015-10-13Make use of rtisvalid(9) to check if local route entries match existingMartin Pieuchot
configured addressses. ok mikeb@
2015-10-13Use rtisivalid(9) to check if the given (cached) route can be used.Martin Pieuchot
Note that after calling rtalloc(9) we only check if a route has been returned or not and do not check for its validity. This cannot be improved without a massive refactoring. The kernel currently *do* use !RTF_UP route due to a mismatch between the value of ifp->if_link_state and the IFF_UP|IFF_RUNNING code. I'd explain the RTF_UP flag as follow: . If a cached route entry w/o RTF_UP is passed to ip{6,}_output(), . call rtalloc(9) to see if a better entry is present in the tree. This is enough to support MPATH and route cache invalidation. ok bluhm@
2015-10-09Rename tame() to pledge(). This fairly interface has evolved to be moreTheo de Raadt
strict than anticipated. It allows a programmer to pledge/promise/covenant that their program will operate within an easily defined subset of the Unix environment, or it pays the price.
2015-10-07Initialize the routing table before domains.Martin Pieuchot
The routing table is not an optional component of the network stack and initializing it inside the "routing domain" requires some ugly introspection in the domain interface. This put the rtable* layer at the same level of the if* level. These two subsystem are organized around the two global data structure used in the network stack: - the global &ifnet list, to be used in process context only, and - the routing table which can be read in interrupt context. This change makes the rtable_* layer domain-aware and extends the "struct domain" such that INET, INET6 and MPLS can specify the length of the binary key used in lookups. This allows us to keep, or move towards, AF-free route and rtable layers. While here stop the madness and pass the size of the maximum key length in *byte* to rn_inithead0(). ok claudio@, mikeb@
2015-10-05user land -> userland; from Rob PierceTheo de Raadt
2015-10-01Use rtdeletemsg() in nd6_free() to align it with arptfree().Martin Pieuchot
This gives us userland notification for free and get rid of a rtrequest1(9) call. ok phessler@, mikeb@, sthen@
2015-09-28Merge gif(4)'s tentacles in a single file.Martin Pieuchot
Tested by <mxb AT alumni DOT chalmers DOT se>. ok dlg@
2015-09-23Always increment rt_use inside rtalloc(9) instead of doing it in someMartin Pieuchot
specific places. ok claudio@, benno@
2015-09-22Remove inpt_lastport from struct inpcbtable, use local variablesVincent Gross
in in_pcbbind() and in6_pcbsetport() ok claudio@, with input from David Hill
2015-09-18Do not manually decrement rt's refcounter in nd6_lookup() and let theMartin Pieuchot
callers rtfree(9) it. Inputs and ok bluhm@
2015-09-13There's no point in abstracting ifp->if_output() as long as pf_test()Martin Pieuchot
needs to see lo0 in the output path. ok claudio@
2015-09-13Get the default loopback interface pointer just after doing a routeMartin Pieuchot
lookup to ensure pf_test() is called with the same interface in the input annd output path for local traffic. Fix a regression reported by Heiko Zimmermann on bugs@, thanks! ok mikeb@, claudio@
2015-09-12Now that rtrequest1(9) properly sets RTF_UP for newly added route,Martin Pieuchot
stop passing it in every rt_ifa_add(9) calls. ok claudio@
2015-09-12Stop overwriting the rt_ifp pointer of RTF_LOCAL routes with lo0ifp.Martin Pieuchot
Use instead the RTF_LOCAL flag to loop local traffic back to the corresponding protocol queue. With this change rt_ifp is now always the same as rt_ifa->ifa_ifp. ok claudio@
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-11Bad whatever, that if_put() should not be there. Found the hard way by deraadt@Claudio Jeker
OK mpi@
2015-09-11if_put after if_get for in6_src and ip6_output which got a lot easier afterClaudio Jeker
all the cleanup by mpi@ since we no longer overwrite ifps, etc. OK dlg@
2015-09-11if_put after if_get for nd6_nbr. OK dlg@Claudio Jeker
2015-09-11if_put after if_get when IP6_EXTHDR_GET fails in icmp6_input.David Gwynne
claudio missed this one cos he was drunk while he was supposed to be fixing this file. ok claudio@ mpi@
2015-09-11Rewrite in6_selectroute() to no longer return an ifp.Martin Pieuchot
The returned "struct rtentry" is either the cached one or the one passed in options. ok claudio@
2015-09-11Convert _TM_ flags to TAME_ flags, collapsing the entire mappingTheo de Raadt
layer because the strings select the right options. Mechanical conversion. ok guenther
2015-09-11When pf modifies a TCP packet, it sets the M_TCP_CSUM_OUT flag inAlexander Bluhm
the mbuf packet header. If the packet and is later dropped in ip6_forward(), the TCP mbuf is copied and passed to icmp6_error(). IPv6 uses m_copym() and M_PREPEND() which preserve the packet header. The inherited M_TCP_CSUM_OUT flag generates ICMP6 packets with an incorrect checksum. So reset the csum_flags when packets are generated by icmp6_reflect() or icmp6_redirect_output(). IPv4 does m_copydata() into a fresh mbuf. There m_inithdr() clears the packet header, so the problem does not occur. But setting the csum_flags explicitly also makes sense for icmp_send(). Do not or M_ICMP_CSUM_OUT to a value that is 0 because of some function calls before. OK mpi@ lteo@
2015-09-11Move the multicast option parsing out of in6_selectroute().Martin Pieuchot
ok claudio@
2015-09-11Kill selectroute().Martin Pieuchot
ok claudio@
2015-09-11if_put for ip6_input. OK mpi@Claudio Jeker
2015-09-11if_put for icmp6. Again we cheat a bit with the hop limit to simplify the code.Claudio Jeker
OK mpi@
2015-09-11Only include <sys/tame.h> in the .c files that need itPhilip Guenther
ok deraadt@ miod@
2015-09-11Kill yet another argument to functions in IPv6. This time ip6_output'sClaudio Jeker
ifpp - XXX: just for statistics ifpp is always NULL in all callers so that statistic confirms ifpp is dying OK mpi@
2015-09-11in6_embedscope() needs to lose some weight. Remove the last argument.Claudio Jeker
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@
2015-09-10It is time to put inet6 on a diet. Use the flensing knife and cut outClaudio Jeker
the 3rd argument of in6_recoverscope() and make it return void. OK dlg@ mikeb@
2015-09-10Kill in6_ifstat_inc() and associated per-ifp storage.Martin Pieuchot
The SIOCGIFSTAT_IN6 is no longer supported. ok mikeb@, claudio@, dlg@
2015-09-10In IPv6 source address selection prefer addresses of the outgoingAlexander Bluhm
interface. OK mpi@
2015-09-10if_put dance, shuffle some code and switch a printf to print the ifindexClaudio Jeker
instead of the name so we don't have to if_get/if_put it for just that. OK dlg@
2015-09-10Fewer in6_ifstat_inc()Martin Pieuchot
ok mikeb@
2015-09-10Stop using in6_ifstat_inc().Martin Pieuchot
ok dlg@, claudio@
2015-09-10More if_put suffling. OK dlg@Claudio Jeker
2015-09-10More complicated if_put dance. Special handling for multicast_register_ifClaudio Jeker
which is probably not even needed here but who knows for sure. OK dlg@
2015-09-10Another trivial if_put addition. OK dlg@Claudio Jeker