summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/in6.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Purge routes attached to an address when this address is removed.mpi2016-09-041-7/+7
| | | | | | | This is done to stop using stale ifa attached to routes, which is the easiest way to make rtisvalid(9) MP-safe. sthen@ and henning@ like it, ok claudio@
* Sizes for free(9) from David Hill.mpi2016-08-221-2/+2
|
* Execute address hooks in the update case.mpi2016-08-081-2/+4
| | | | | | | | This matches what IPv4 is doing and unbreak carp(4) when the same address is set twice, for example when running netstart(8) multiple times. Issue reported by and fix from Simon Mages.
* Introduce RTF_MULTICAST and flag corresponding IPv6 routes as suchmpi2016-07-131-4/+3
| | | | | | instead of abusing RTF_CLONING. Fix a leak reporeted by Aaron Riekenberg on misc@, ok sthen@
* Expand IN6_IFF_NOTREADY, ok bluhm@mpi2016-07-051-2/+3
|
* Move the ioctl(2) logic of in{,6}_control() into two new functionsmpi2016-06-131-13/+22
| | | | | | | | | in{,6}_ioctl() that do not deal with sockets. This will allow to automagically configure interface addresses in the kernel without too many layer violations. Required by upcoming umb(4).
* Kill IPv6 prefix and router renumbering ioctls.jca2016-03-031-14/+1
| | | | | | | | Router renumbering was never supported, prefix ioctls were deprecated ~15 years ago. Move some items in netinet6/nd6.h where they are still used. ok mikeb@ mpi@
* Delete all traces of SIOCSIF(ADDR|DSTADDR|NETMASK)_IN6jca2016-03-031-13/+1
| | | | | | | Those ioctls never made sense, IPv6 was designed right from the start with support for multiple addresses by interface. ok mikeb@ mpi@
* Remove SIOCSIFALIFETIME_IN6 ioctl, as NetBSD did.stefan2016-02-281-37/+1
| | | | | | | | | | | As described in NetBSD kern/35897 PR, the parameters this ioctl needs overlay each other in a union. The ioctl cannot have worked properly. Discovered while discussing overflow checks with mmcc@ and mpi@ The checks were part of the removed code. ok deraadt@
* Introduce in{,6}_hasmulti(), two functions to check in the hot path ifmpi2016-01-211-1/+17
| | | | | | an interface joined a specific multicast group. ok phessler@, visa@, dlg@
* Do not return EEXIST if the same address is added twice.mpi2015-12-221-5/+12
| | | | | | Reported by sebastisa@. ok sebasitia@, stsp@, florian@, vgross@
* add sizes to some free() calls. ok claudiotedu2015-12-031-5/+5
|
* Remove "just for safety" over engineering checks.mpi2015-12-011-7/+1
| | | | | | | ifa->ifa_addr must not be NULL when an ifa is on a per-interface list of addresses. ok bluhm@, sthen@, benno@, millert@
* Factorize the bits to check if a L2 route is connected, wether it ismpi2015-11-181-43/+1
| | | | | | | attached to a carp(4) or bridge(4) member, to not dereference rt_ifp directly. ok visa@
* Retire ARP load-balacing, thanks for all the fish!mpi2015-11-021-6/+2
| | | | | | | | | One of the keys of our MP work relies on making OpenBSD's kernel simpler! In this case turning ARP processing MP-safe is quite complicated due to the way carp(4) is hooked in arpinput() and nowadays you'd better run kitchensinkd(9) anyway :) ok bluhm@, claudio@, reyk@
* Rename rtrequest1() to rtrequest().bluhm2015-10-301-3/+3
| | | | OK mpi@
* Introduce if_rtrequest() the successor of ifa_rtrequest().mpi2015-10-251-8/+2
| | | | | | | | | L2 resolution depends on the protocol (encoded in the route entry) and an ``ifp''. Not having to care about an ``ifa'' makes our life easier in our MP effort. Fewer dependencies between data structures implies fewer headaches. Discussed with bluhm@, ok claudio@
* Now that rtrequest1(9) properly sets RTF_UP for newly added route,mpi2015-09-121-6/+6
| | | | | | stop passing it in every rt_ifa_add(9) calls. ok claudio@
* Kill in6_ifstat_inc() and associated per-ifp storage.mpi2015-09-101-13/+1
| | | | | | The SIOCGIFSTAT_IN6 is no longer supported. ok mikeb@, claudio@, dlg@
* In IPv6 source address selection prefer addresses of the outgoingbluhm2015-09-101-1/+7
| | | | | interface. OK mpi@
* Trivial if_put addition. OK dlg@claudio2015-09-101-1/+2
|
* Kill icmp6_ifstat_inc() and associated per-ifp storage.mpi2015-09-091-12/+2
| | | | | | The SIOCGIFSTAT_ICMP6 is no longer supported. ok dlg@, mikeb@, claudio@
* Tunnels also need a cloning route.mpi2015-09-041-4/+7
| | | | Fix a regression reported by Brad.
* Do not install connected routes on loopback interfaces.mpi2015-08-311-6/+8
| | | | | | | | 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.
* Start moving away from the global prefix list by limiting its usage tompi2015-08-241-39/+13
| | | | | | | | | 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@
* Rework the code to decide when to perform DAD to no longer rely on thempi2015-08-241-22/+15
| | | | | | | | | 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@
* In kernel initialize struct sockaddr_in and sockaddr_in6 to zerobluhm2015-08-241-3/+3
| | | | | | | everywhere to avoid passing around pointers to uninitialized stack memory. While there, fix the call to in6_recoverscope() in fill_drlist(). OK deraadt@ mpi@
* Convert all calls to rtrequest1() and the following error checkbluhm2015-08-191-3/+3
| | | | | | into a common pattern. In the man page clarify the usage of the returned route. OK mpi@ mikeb@ jmc@
* Remove some verbose logs in in6_update_ifa() now that errors arempi2015-08-191-41/+6
| | | | propagated.
* Check the error value returned by in6_ifattach().mpi2015-08-181-2/+6
| | | | Prodded by and ok bluhm@
* Remove backward compatibilify goos for IN6_IFF_DEPRECATED and insteadmpi2015-08-121-9/+2
| | | | | | reject SIOCAIFADDR_IN6 ioctl(2) where it is set. ok jca@, bluhm@
* Merge two identical chunks to add new prefixes to the global datampi2015-07-181-49/+15
| | | | | | structures into a function. ok florian@
* Pass an interface index instead of a pointer to in6_addr2scopeid().mpi2015-07-081-9/+5
| | | | ok millert@
* More damned eye searing whitespace. No change to .o files.krw2015-06-081-6/+6
|
* Store the IP address of the corresponding ifa in the rt_gateway fieldmpi2015-05-261-7/+3
| | | | | | | | | | | | | | | of RTF_CLONING and RTF_BROASCAST routes to not create MPATH conflicts when IP address aliases are used. This change makes it possible to have multiple RTF_CLONING routes with the same priority. Note that any of the existing RTF_CLONING route might be used by the kernel to create a RTF_CLONED route which should not be a problem with aliases since they are attached to the same ifp. This unbreak address aliases since the kernel supports multiple connected routes for a subnet. Found the hardway by djm@, ok claudio@
* Allow multiple connected/interface routes to exist at the same time.claudio2015-05-151-3/+8
| | | | | | | | | | | Use the existing multipath code. Switch away from using the ifa address when making the cloning route and instead put a dummy sockaddr_dl route in. With this it is possible to use the same network on multiple interfaces at the same time. So if wireless and ethernet share the same network the system will use the wired connection as long as there is link. Still missing is builtin proxy-arp for the other interface IPs to allow hitless failover. OK mpi@
* Do not treat loopback interfaces as p2p interfaces and create onlympi2015-04-201-4/+6
| | | | | | | | | | | | | | | | | | | | | one route to "::1". Due to a clever BSD trick, the `ifa_dstaddr` field of addresses on IFF_LOOPBACK ifps is set to the same value that `ifa_addr`. That's why filtering for broadcast addresses is so complicated, because guess what, `ifa_broadaddr` is the same as `ifa_dstaddr`! Sadly our IPv6 code was "only" checking for `ifa_dstaddr` without looking if the ifa was attached to a IFF_POINTOTPOINT interface. So it always tried to create two routes to "::1" and, with the recent RTF_LOCAL work, succeed. You should now have only one local route to "::1". ::1 ::1 UHl 14 0 32768 1 lo0 -::1 ::1 UH 0 0 32768 4 lo0 ok henning@
* Always call rt_ifa_dellocal(9) when removing an IPv6 address.mpi2015-04-201-32/+4
| | | | | | | | | | The routing layer already check for the correct ifa when asked to delete a local route, so do not try to be clever here. This change also prevent having a NULL ifp pointer in your routing table when you delete loopback interfaces having the same address. ok henning@
* Remove some includes include-what-you-use claims don'tjsg2015-03-141-2/+1
| | | | | | | have any direct symbols used. Tested for indirect use by compiling amd64/i386/sparc64 kernels. ok tedu@ deraadt@
* All other calls to pfxlist_onlink_check() are protected by splsoftnet.bluhm2015-02-191-1/+3
| | | | | | | Put an splsoftnet() around the call to pfxlist_onlink_check() in in6_control(SIOCAIFADDR_IN6). Include the call to dohooks() in the protection like it is done elsewhere. splassert failure reported and fix tested by matthieu@; OK mikeb@
* Always call if_ioctl() for loopback interfaces, just like IPv4 do, tompi2015-01-271-2/+3
| | | | | | | make sure the default MTU is set for every address configured on the ifp and not just the first one. Regress test breakage reported by daniel@
* Ensure that link-local addresses are correctly configured on loopbackmpi2015-01-271-3/+2
| | | | | | | | | | | | | | | | | | | | interfaces. When the kernel automagically configures IPv6 addresses on loopback interfaces, start by assigning a link-local address and then try to assign "::1". Only the first configured loopback interface per rdomain can have the "::1" address. But even if other loopback interfaces failed to get this address, because it is already taken, give them a chance to have a link-local address. While here change in6_ifattach() to return an error value and remove duplicated code. Fix a regression introduced by the NOINET6 flag removal. ok henning@, stsp@, florian@, benno@
* Userland (base & ports) was adapted to always include <netinet/in.h>deraadt2015-01-241-1/+2
| | | | | | 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
* Correct some comments and merge in6_if_up() into in6_ifattach() tompi2015-01-101-30/+2
| | | | | | | reflect that IPv6 link-local addresses are no longer automagically configured the first time an interface is brought up. ok henning@, stsp@
* Remove the NOINET6 interface flag, a left-over from the times when IPv6stsp2015-01-061-6/+5
| | | | | | | | | | | was enabled by default. Add AFATTACH/AFDETACH ioctls which enable/disable an address family for an interface (currently used for IPv6 only). New kernel needs new ifconfig for IPv6 configuration (address assignment still works with old ifconfig making this easy to cross over). Committing on behalf of henning@ who is currently lebensmittelvergiftet. ok stsp, benno, mpi
* Do not take into account addresses configured in a different rdomainmpi2014-12-081-1/+4
| | | | | | | | | to decide whether or not to remove local routes. Prevent from having a NULL ifp pointer in the routing table when an address present in another rdomain is removed from an interface. ok bluhm@
* Rename rt_ifa_addloop() into rt_ifa_addlocal() and make it return anmpi2014-11-241-3/+3
| | | | | | error code on failure (unchecked for the moment). ok mikeb@, jmc@
* What have no need for a variable that holds the maximum MTU size ofmpi2014-11-201-23/+1
| | | | | | interfaces with an IPv6 address. ok henning@, mikeb@, deraadt@
* Rename rtalloc1() into rtalloc(9) and convert its flags to only enablempi2014-11-011-4/+4
| | | | | | functionnality instead of a mix of enable/disable. ok bluhm@, jca@
* Introduce a special hack for carp during IPv6 source address selection:stsp2014-10-221-2/+20
| | | | | | | | | | | | | | | | | If there is a tie then a carp interface is not allowed to win even if it has an address with a longer bitwise match. This allows reliable IPv6 communication between carp master and backup across a shared IPv6 subnet. Consider the carp address 2001:DB8:10::14, which is configured on firewall A (in carp master state) and firewall B (in carp backup state), each of which has another address in the same prefix on a non-carp interface (A has 2001:DB8:10::1 and B has 2001:DB8:10::11). In this setup, A would use 2001:DB8:10::14 as source address when sending neighbour solicitations to B. Since 2001:DB8:10::14 is a local address from B's point of view, B never replied to the neighbour solicitations sent by A. With this change A uses 2001:DB8:10::1 as source address instead. ok mpi@