summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/in6.c (follow)
Commit message (Collapse)AuthorAgeFilesLines
...
* Use rtfree() instead of RTFREE(), NULLify some free'd route pointers andmpi2014-10-141-7/+7
| | | | | | kill the macro. ok mikeb@, henning@
* Do not protect the SIOCSIFADDR call by splnet(). Drivers alreadympi2014-10-071-9/+7
| | | | | | | | | | | | raise it inside their ioctl handler (except for carp(4), what else?). In general, global structures manipulated in the softnet codepath only require a splsoftnet() protection when they are modified in process (ioctl) context. Also put some IPL_SOFNET asserts in functions accessing global structures. Previous version diff ok mikeb@, with inputs from and ok bluhm@
* Do not hand-roll all routers link local address.florian2014-08-261-1/+3
| | | | pointed out & OK bluhm@
* Move sending of router solicitations to the kernel; receiving andflorian2014-08-251-1/+4
| | | | | | | | | | | | | | | processing of router advertisements was already in the kernel. With this rtsol{,d}(8) is no longer necessary. The kernel starts sending solicitations with # ifconfig $IF inet6 autoconf or inet6 autoconf in /etc/hostname.$IF. input stsp@ much help & OK mpi@ tweaks & OK bluhm@
* add a size argument to free. will be used soon, but for now default to 0.tedu2014-07-121-8/+8
| | | | after discussions with beck deraadt kettenis.
* Do not use nd6_rtrequest() for addresses configured on loopbackmpi2014-05-151-2/+2
| | | | | | interfaces. ok mikeb@
* Use a custom ifa_rtrequest function for point-to-point interfacesmpi2014-05-051-3/+6
| | | | | | | | | | instead of relying on hacks in nd6_rtrequest() to add a route to loopback for each address configured on such interfaces. While here document that abusing lo0 for local traffic is not safe for interfaces in a non-default rdomain. Tested by claudio@, jca@ and sthen@, ok sthen@
* Retire rtinit() an use rt_ifa_add(9) and rt_ifa_del(9) to managempi2014-04-101-5/+7
| | | | | | | | | | connected routes to prefixes/hosts. Since the introduction of rt_ifa_addloop(9) and rt_ifa_delloop(9), rtinit() was just a wrapper, so use the underlying functions directly and document them. Inputs from and ok mikeb@, manpage tweaks from jmc@
* Introduce rt_ifa_{add,del}loop() to replace in6_{add,rem}loop().mpi2014-04-031-150/+30
| | | | | | | | | Move these functions to a more generic place and make them reuse existing code, they'll be soon used in IPv4 too. Tested by André Lucas, Vigdis and sthen@, thanks! ok sthen@
* Stop mixing interface address flags with routing entry ones.mpi2014-03-271-7/+5
| | | | | | | | | | Instead of always copying ifa_flags to the routing entry flags when creating a route by calling rtinit(), explicitly pass the RTF_CLONING flag when required. This means ifa_flags are now *only* used to check if an address has an associated route that was created by the kernel auto-magically. ok benno@
* Kill a never defined old compatibility goo from 12 years ago.mpi2014-02-121-20/+1
| | | | ok mikeb@, bluhm@
* There's no reason to pass a netmask argument when doing a RTF_HOSTmpi2014-01-221-8/+1
| | | | | | request, so kill it along with the associated global variable. ok claudio@
* Do not clean the multicast records of an interface when it is destroyedmpi2014-01-211-12/+15
| | | | | | | | | | | (unplugged). Even if it makes no sense to keep them around if the interface is no more, we cannot safely remove them since pcb multicast options might keep a pointer to them. Fixes a user after free introduced by the multicast address linking rewrite and reported by Alexey Suslikov, thanks! ok claudio@
* Remove assigned but never read value.mpi2014-01-151-6/+3
| | | | ok stsp@
* Call all local valiables of type struct in6_ifaddr "ia6". This isbluhm2014-01-131-165/+165
| | | | | consistent with struct ifaddr "ifa" and struct in_ifaddr "ia". OK mpi@
* Some follow-up fixes for IFID collision handling in IPv6CP.stsp2014-01-071-2/+2
| | | | | | | | | | | | | | | Really change the link-local address in the unlikely event of an IFID collision, instead of going into an infinite conf-nak loop with the peer. To make the netinet6 code use the IPv6CP IFID in a new link-local address, in6_ifattach_linklocal() must accept a provided IFID. Replace the unused 'altifp' parameter with a new 'ifid' parameter for this purpose. Always use the latest suggested address in IPv6CP replies, even if the task to update the interface's address hasn't run yet. Also, clear the ifindex (KAME hack) in addresses sent during IPv6CP. ok mpi
* Change the way protocol multicast addresses are linked to an interface.mpi2013-11-281-182/+34
| | | | | | | | | | | | | | | | | | | | | | Instead of linking multicast records to the first configured address of the corresponding protocol, making this address and its position in the global list special, add them to a new list directly linked to the interface descriptor. This new multicast address list is similar to the address list, all its elements contain a protocol agnostic part. This design allows us to be able to join a multicast group without necessarily having a configured address. That means IPv6 multicast kludges are no longer needed. Another benefit is to be able to add and remove an IP address from an interface without worrying about multicast records. That means that the global IPv4 list is no longer needed since the first configured address of an interface is no longer special. This new list might also be extended in the future to contain the link-layer addresses used to configure hardware filters. Tested by sthen@ and weerd@, ok mikeb@
* Remove unused proc argument in in6_control().mpi2013-11-221-10/+8
| | | | ok henning@, mikeb@
* In in6_update_ifa(), don't set the TENTATIVE flag on an IPv6 address thatstsp2013-11-131-2/+3
| | | | | | | | | | | is marked as NODAD. Since we're not gonna do duplicate address detection for this address, the TENTATIVE flag won't get cleared, rendering the address unusable. The existing logic only checked whether DAD was enabled for the interface, but DAD can be configured on a per-address basis. ok sthen@ as part of a larger diff
* Replace most of our formating functions to convert IPv4/6 addresses frommpi2013-11-111-69/+42
| | | | | | | | network to presentation format to inet_ntop(). The few remaining functions will be soon converted. ok mikeb@, deraadt@ and moral support from henning@
* Significant namespace cleanup of netinet6 symbols.deraadt2013-10-241-17/+17
| | | | | | | | One worrying bit is in icmp6.h where some htols() and htonl() are added, which may affect compatibility down the line. This component can be reverted if issues show up. Ports tree greps indicate no issue. ok claudio mpi etc
* Put a large chunk of the IPv6 rdomain support in-tree.phessler2013-10-201-2/+2
| | | | | | 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@
* Do not pass the SIOCSIF{DSTADDR,BRDADDR,NETMASK} ioctls down to thempi2013-10-011-2/+5
| | | | | | driver when using an AF_INET6 socket without checking for permission. From Loganaden Velvindron, ok bluhm@
* No one uses the obsolete IPv6 ioctls SIOCGDRLST_IN6, SIOCGPRLST_IN6,bluhm2013-08-261-4/+1
| | | | | | | OSIOCGIFINFO_IN6 anymore. Remove them together with the structs in6_drlist, in6_oprlist, in6_prlist, in6_ondireq and the kernel implementation. OK mikeb@ henning@
* Switch time_t, ino_t, clock_t, and struct kevent's ident and dataguenther2013-08-131-5/+5
| | | | | | | | | | | | | | | | | | | | members to 64bit types. Assign new syscall numbers for (almost all) the syscalls that involve the affected types, including anything with time_t, timeval, itimerval, timespec, rusage, dirent, stat, or kevent arguments. Add a d_off member to struct dirent and replace getdirentries() with getdents(), thus immensely simplifying and accelerating telldir/seekdir. Build perl with -DBIG_TIME. Bump the major on every single base library: the compat bits included here are only good enough to make the transition; the T32 compat option will be burned as soon as we've reached the new world are are happy with the snapshots for all architectures. DANGER: ABI incompatibility. Updating to this kernel requires extra work or you won't be able to login: install a snapshot instead. Much assistance in fixing userland issues from deraadt@ and tedu@ and build assistance from todd@ and otto@
* Revert previous and unbreak asr, the new include should be protected.mpi2013-06-201-4/+4
| | | | Reported by naddy@
* Allocate the various hook head descriptors as part of the ifnetmpi2013-06-201-4/+4
| | | | | | | structure rather than doing various M_WAITOK allocations during the *attach() functions, we always rely on them anyway. ok mikeb@, uebayasi@
* If the prefixlen is 128, SIOCAIFADDR_IN6 does not add a prefix. Inbluhm2013-06-161-2/+3
| | | | | | | this case, in6_unlink_ifa() must not complain about a missing prefix. To avoid a false log message, check the prefixmask when the interface address gets deleted. OK mpi@
* As it is correct that the loopback address has no prefix, do notbluhm2013-06-131-3/+4
| | | | | | | complain about a missing prefix for ::1 in in6_unlink_ifa(). Also log the actual IPv6 address in the error message instead of the kernel pointer of the interface address. OK sthen@ mpi@
* Remove a bunch of sockaddr_in6 pointer casts and replace othersbluhm2013-05-311-26/+18
| | | | | | with sin6tosa() or satosin6() inline functions. This allows the compiler to check the types more strictly. OK mpi@
* Do not allow SIOCSIFADDR on AF_INET6 sockets. The ioctl is handled downclaudio2013-05-301-1/+7
| | | | | to the driver where uninitialized data will be accessed. Problem reported by hugh@, OK and input deraadt@, henning@
* no need for a lot of code to include proc.htedu2013-03-281-2/+1
|
* Substitute the handcrafted list of IPv6 addresses by a proper TAILQ.mpi2013-03-251-33/+14
| | | | ok bluhm@, mikeb@
* simple replacement of LIST_END with NULL. ok mpitedu2013-03-221-5/+4
|
* tedu faith(4), suggested by todd@ some weeks ago after a submission bympi2013-03-141-9/+1
| | | | | | dhill. ok krw@, mikeb@, tedu@ (implicit)
* Remove unused code manipulating a default interface and its index,mpi2013-03-111-3/+1
| | | | | | | This is a leftover from the on-link assumption behavior removal, which has been deprecated by RFC4861 anyway. ok mikeb@, bluhm@, florian@
* Remove the IFAFREE() macro, the ifafree() function it was calling alreadympi2013-03-071-7/+7
| | | | | | check for the reference counter. ok mikeb@, miod@, pelikan@, kettenis@, krw@
* Replace the cast to struct in6_ifaddr pointer with the ifatoia6() macro.bluhm2013-03-041-5/+5
| | | | | No binary change. OK claudio@
* When deleting an IPv6 interface address, also remove the prefix andbluhm2013-03-041-14/+10
| | | | | the cloning route. bug report and test Florian Riehm; original fix sperreault@; OK claudio@
* Make sure that IPv6 source address selection only chooses a CARPbluhm2013-03-031-1/+24
| | | | | | | address if the interface is in master state. Disable duplicate address detection on CARP interfaces as the peer may have the same addresses. Test and OK sthen@ florian@ benno@ camield@
* Fix typo in comment.stsp2012-11-301-2/+2
|
* Point an interface directly to its bridgeport configuration, insteadcamield2012-10-051-3/+5
| | | | | | | | | | of to the bridge itself. This is ok, since an interface can only be part of one bridge, and the parent bridge is easy to find from the bridgeport. This way we can get rid of a lot of list walks, improving performance and shortening the code. ok henning stsp sthen reyk
* Use TAILQ_FOREACH macro for loops. No binary diff.bluhm2012-09-191-5/+3
| | | | OK henning@
* Make IPv6 privacy addresses appear alongside regular SLAAC addresses.sperreault2012-07-141-43/+4
| | | | | | Also fix a memory management problem that was made obvious by this diff. ok bluhm@, previous version ok @stsp
* Instead of casting interface address pointers, use the macrobluhm2012-07-081-22/+13
| | | | | ifatoia6(). No binary diff. OK henning@
* During IPv6 source address selection, give address scope higher prioritystsp2012-01-171-17/+19
| | | | | | | | than the autoconfprivacy bit, as per by RFC3484. Prevents privacy addresses from being erroneously used as source address if the destination address is in a different scope. Privacy addresses are still preferred over other source addresses from the same scope. Problem found by sthen, fix suggested by sperreault; ok sperreault
* To access the ifaddr of an in_ifaddr or in6_ifaddr struct, it isbluhm2012-01-031-3/+3
| | | | | | cleaner to access the first member via ia_ifa instead of casting. No binary change. ok henning@ krw@
* rdomain support for IPv6sperreault2011-11-241-9/+13
| | | | ok mikeb
* If two carp interfaces on the same physical interface had addressesbluhm2011-08-081-1/+3
| | | | | | | with the same prefix, neighbor discovery did not work. When comparing two carp interfaces in in6_ifpprefix(), assume they share the prefix if they have the same parent. sure deraadt@