summaryrefslogtreecommitdiff
path: root/sys/netinet6
AgeCommit message (Collapse)Author
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
2015-09-10Trivial if_put addition. OK dlg@Claudio Jeker
2015-09-09Kill icmp6_ifstat_inc() and associated per-ifp storage.Martin Pieuchot
The SIOCGIFSTAT_ICMP6 is no longer supported. ok dlg@, mikeb@, claudio@
2015-09-09Kill some commented out in6_ifstat_inc().Martin Pieuchot
2015-09-09Kill a couple of if_get()s only needed to increment per-ifp IPv6 stats.Martin Pieuchot
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@
2015-09-04Tunnels also need a cloning route.Martin Pieuchot
Fix a regression reported by Brad.
2015-09-04Make every subsystem using a radix tree call rn_init() and pass theMartin Pieuchot
length of the key as argument. This way every consumer of the radix tree has a chance to explicitly initialize the shared data structures and no longer rely on another subsystem to do the initialization. As a bonus ``dom_maxrtkey'' is no longer used an die. ART kernels should now be fully usable because pf(4) and IPSEC properly initialized the radix tree. ok chris@, reyk@
2015-09-03Change the order of operations for loopback interfaces to haveMartin Pieuchot
::1 configured before fe80::1. (lo0:0) in pf should resolve to 127.0.0.1 ::1. reported by and ok mikeb@
2015-09-03Revert (again!) the two uses of rtisvalid(9), they break NFS!Martin Pieuchot
Found the hardway by naddy@
2015-09-03Convert ip{,6}_output() (cached) route entry checks to rtisvalid(9).Martin Pieuchot
This introduces a behavior change as we now reject !RTF_UP routes to output packets. This stricter check exposed a bug in the setup of new routes and was the reason for the previous revert. This should be now fixed by r1.229 of sys/net/route.c . ok bluhm@
2015-09-02Revert the two uses of rtisvalid(9) for the moment, it breaks dhclient(8)Martin Pieuchot
configured networks on RAMDISK kernels. The problem is that the default route installed by dhclient(8) does not have the RTF_UP flag in this environement and rtisvalid(9) doesn't allow you to use a RTF_DOWN route.
2015-09-01Kill unused ``ia_net'' field in the struct in6_ifaddr, bad copyMartin Pieuchot
paste from the IPv4 time. While here update the comment about ``ia6_ndpr'' it's now only used for autoconf.
2015-09-01Convert ip{,6}_output() (cached) route entry checks to rtisvalid(9).Martin Pieuchot
ok bluhm@
2015-08-31The return value of nd6_cache_lladdr() is never used so make it a void.Martin Pieuchot
Fewer "struct rtentry" left in the wild!
2015-08-31Do not install connected routes on loopback interfaces.Martin Pieuchot
Previously loopback connected routes were managed via the global list of prefixes, which mean that systems with AUTOCONF'd addresses did not see them in the routing table. This also makes inet6 route creation coherent with inet.
2015-08-31Compute the checksum before looping back the copy of a multicast packet.Martin Pieuchot
Found while comparing IPv4 and IPv6 versions. ok naddy@
2015-08-31`encif' should only be used under #ifdef NPF.Martin Pieuchot
Reported by jsg@, ok deraadt@
2015-08-30Use a global table for domains instead of building a list at run time.Martin Pieuchot
As a side effect there's no need to run if_attachdomain() after the list of domains has been built. ok claudio@, reyk@
2015-08-24nd6_prefix_add() is no longer used and die.Martin Pieuchot
2015-08-24Start moving away from the global prefix list by limiting its usage toMartin Pieuchot
AUTOCONF'd addresses. This prevent the kernel from removing connected (/64) routes as soon as it configures an AUTOCONF'd address based on a RA. Tested by sebastia@, ok sthen@
2015-08-24Always increment the reference counter of the returned route entry inMartin Pieuchot
rtrequest1(9). This simplifies rtfree(9) dances and will prevent another CPU to free the entry before we're done with it as soon as routing functions can be executed in parallel. ok bluhm@, mikeb@
2015-08-24Rework the code to decide when to perform DAD to no longer rely on theMartin Pieuchot
IN6_IFF_NODAD pseudo-flag not being set. This was just a flag for spaghetti code that should not exist in the first place. Tested by sebastia@, ok sthen@
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-08-23Use simple byte pointer arithmetic and memcpy from/to aligned stackChristian Weisgerber
variables to handle the "packed" binary format passed out to userland when querying the prefix/router list. From NetBSD (Martin Husemann). ok mpi@
2015-08-22Move to tame(int flags, char *paths[]) API/ABI.Theo de Raadt
The pathlist is a whitelist of dirs and files; anything else returns ENOENT. Recommendation is to use a narrowly defined list. Also add TAME_FATTR, which permits explicit change operations against "struct stat" fields. Some other TAME_ flags are refined slightly. Not cranking libc now, since nothing commited in base uses this and the timing is uncomfortable for others. Discussed with many; thanks for a few bug fixes from semarie, doug, guenther. ok guenther
2015-08-19Convert all calls to rtrequest1() and the following error checkAlexander Bluhm
into a common pattern. In the man page clarify the usage of the returned route. OK mpi@ mikeb@ jmc@
2015-08-19Remove some verbose logs in in6_update_ifa() now that errors areMartin Pieuchot
propagated.
2015-08-18Call rtfree(9) when we no longer need the route entry rather thanMartin Pieuchot
decrementing rt_refcnt just after rtrequest1(9). While here reduce the differences with rt_ifa_add(9). There's still an ambiguity about rtrequest1(9)'s return value, but bluhm@ will address that in a different diff. Discussed with and ok bluhm@
2015-08-18Check the error value returned by in6_ifattach().Martin Pieuchot
Prodded by and ok bluhm@
2015-08-17Remove anoying comment about in6_update_ifa().Martin Pieuchot
2015-08-17Use __func__ rather than the function name in log(9) calls to removeMartin Pieuchot
some grep output noise.
2015-08-12Remove backward compatibilify goos for IN6_IFF_DEPRECATED and insteadMartin Pieuchot
reject SIOCAIFADDR_IN6 ioctl(2) where it is set. ok jca@, bluhm@
2015-07-28Implement pf divert-reply for raw sockets. Note that an emptyAlexander Bluhm
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@