summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
Commit message (Collapse)AuthorAgeFilesLines
* in6_pcblookup_local() still can return a pcb with NULLglebius2012-03-211-2/+2
| | | | | | | | | inp_socket. To avoid panic, do not dereference inp_socket, but obtain reuse port option from inp_flags2, like this is done after next call to in_pcblookup_local() a few lines down below. Submitted by: rwatson
* Clean up, no functional change.tuexen2012-03-151-3/+3
| | | | MFC after: 3 days.
* In nd6_options() ignore the RFC 6106 options completely rather than printingbz2012-03-041-0/+8
| | | | | | | | them if nd6_debug is enabled as unknown. Leave a comment about the RFC4191 option as I am undecided so far. Discussed with: hrs MFC after: 3 days
* Allow to configure net.inet6.ip6.{accept_rtadv,no_radr} by the loader tunableshrs2012-03-021-0/+2
| | | | | as well because they have to be configured before interface initialization for AF_INET6.
* Remove a redundant check.hrs2012-03-021-10/+0
|
* In selectroute() add a missing fibnum argument to an in6_rtalloc()bz2012-02-243-11/+10
| | | | | | | | | | | | call in an #if 0 section. In in6_selecthlim() optimize a case where in6p cannot be NULL due to an earlier check. More consistently use u_int instead of int for fibnum function arguments. Sponsored by: Cisco Systems, Inc. MFC after: 3 days
* When using flowtable llentrys can outlive the interface with which they're ↵kmacy2012-02-231-15/+15
| | | | | | | | | | | associated at which the lle_tbl pointer points to freed memory and the llt_free pointer is no longer valid. Move the free pointer in to the llentry itself and update the initalization sites. MFC after: 2 weeks
* Remove two clang warnings.tuexen2012-02-181-1/+1
| | | | MFC after: 1 month.
* Merge multi-FIB IPv6 support from projects/multi-fibv6/head/:bz2012-02-1716-445/+654
| | | | | | | | | | | | Extend the so far IPv4-only support for multiple routing tables (FIBs) introduced in r178888 to IPv6 providing feature parity. This includes an extended rtalloc(9) KPI for IPv6, the necessary adjustments to the network stack, and user land support as in netstat. Sponsored by: Cisco Systems, Inc. Reviewed by: melifaro (basically) MFC after: 10 days
* Remove casts from inet6 address testing macros, thus preservingglebius2012-01-261-16/+16
| | | | | | | qualifier from original argument. Obtained from: NetBSD, r. 1.67 Submitted by: maxim
* Remove unused variable.pluknet2012-01-251-2/+0
| | | | | | | | The actual ia6->ia6_lifetime access is hidden in IFA6_IS_INVALID/IFA6_IS_DEPRECATED macros since a long time ago (see netinet6/nd6.c, r1.104 of KAME for the reference). MFC after: 3 days
* Plug a possible ifa_ref leak in case of premature return from in6_purgeaddr().bz2012-01-241-2/+2
| | | | | Reviewed by: rwatson MFC after: 3 days
* Remove the stale XXX rt_newaddrmsg comment.pluknet2012-01-241-4/+0
| | | | | | | A routing socket message is generated since r192282. Reviewed by: bz MFC after: 3 days
* Remove unnecessary line break.bz2012-01-241-2/+1
| | | | MFC after: 3 days
* Clean up some #endif comments removing from short sections. Add #endifbz2012-01-221-1/+1
| | | | | | | | | | | | comments to longer, also refining strange ones. Properly use #ifdef rather than #if defined() where possible. Four #if defined(PCBGROUP) occurances (netinet and netinet6) were ignored to avoid conflicts with eventually upcoming changes for RSS. Reported by: bde (most) Reviewed by: bde MFC after: 3 days
* Small cleanup, no functional change.tuexen2012-01-151-1/+0
|
* Add an SCTP sysctl "blackhole", similar to the one for TCP.tuexen2012-01-081-2/+7
| | | | | | | | | | If set to 1, no ABORT is sent back in response to an incoming INIT. If set to 2, no ABORT is sent back in response to an out of the blue packet. If set to 0 (the default), ABORTs are sent. Discussed with rrs@. MFC after: 1 month.
* Convert all users of IF_ADDR_LOCK to use new locking macros that specifyjhb2012-01-059-82/+82
| | | | | | | either a read lock or write lock. Reviewed by: bz MFC after: 2 weeks
* Mark a couple of file local functions static and stop exporting them.bz2012-01-052-6/+6
| | | | MFC after: 1 week
* Convert an #ifdef DIAGNOSTIC if/panic to a KASSERT.bz2012-01-051-6/+2
| | | | MFC after: 1 week
* Use the mli_relinmhead list normally used to defer calls tojhb2012-01-041-21/+29
| | | | | | | | | | in6m_release_locked() to defer calls to mld_v1_transmit_report() until after the IF_ADDR_LOCK is dropped. This removes a race where the lock is dropped and reacquired while attempting to walk an interface's address list. Reviewed by: bz MFC after: 1 week
* Use correct locking when traversing interface address list.glebius2012-01-041-4/+2
| | | | Reviewed by: bz
* When cancelling multicast timers on an interface, don't release thejhb2012-01-031-8/+7
| | | | | | | | | | | | | | | | reference on a group in the leaving state while iterating over the loop. Instead, use the same approach used in igmp_ifdetach() and mld_ifdetach() of placing the groups to free on pending release list and then releasing the references after dropping the IF_ADDR_LOCK. This closes an ugly race where the code was dropping the lock in the middle of iterating over the list. It also fixes some additional potential use-after-free bugs since the cancellation routine also applied other changes to the group after dropping the reference. Now those changes are performed before the reference is dropped and the group is potentially freed. Prodded to fix by: glebius Reviewed by: bz MFC after: 1 week
* Grab a reference on the matching interface address (ifa) in the handlingjhb2012-01-031-2/+10
| | | | | | | | | of the SIOC[DG]LIFADDR icotls before dropping the IF_ADDR_LOCK() and release the reference after using it. This prevents the address from being potentially freed out from under the ioctl handler. Reviewed by: bz MFC after: 1 week
* Use TAILQ_FOREACH() instead of TAILQ_FOREACH_SAFE() for some loops thatjhb2012-01-032-4/+4
| | | | | | do not modify the queues they iterate over. Submitted by: glebius
* Remove an uneeded inpcb forward declaration and align the functionbz2012-01-021-2/+1
| | | | | | declaration following to match the style in the rest of the file. MFC after: 3 days
* Remove a declaration to a non-existent function.bz2011-12-311-1/+0
| | | | | MFC after: 3 days Sponsored by: The FreeBSD Foundation
* Use queue(3) macros instead of home-rolled versions in several places injhb2011-12-296-88/+49
| | | | | | | | the INET6 code. This includes retiring the 'ndpr_next' and 'pfr_next' macros. Submitted by: pluknet (earlier version) Reviewed by: pluknet
* Address issues found by clang. While there, fix also some styletuexen2011-12-271-47/+39
| | | | | | issues. MFC after: 3 months.
* Fix a bug where TAILQ_FIRST(&V_ifnet) was accessed without holding thejhb2011-12-241-1/+2
| | | | | | | proper lock. Reviewed by: bz MFC after: 1 week
* Provide ABI compatibility shim to enable configuring of addressesglebius2011-12-212-2/+20
| | | | | | with ifconfig(8) prior to r228571. Requested by: brooks
* o Convert IPv6 read-only stats sysctls to the read-write ones.maxim2011-12-192-4/+4
| | | | | | | | | o Teach netstat(1) -z to reset these stats sysctls. PR: bin/153206 Reviewed by: glebuis Sponsored by: NGINX, Inc. MFC after: 1 month
* Fix unused parameter warnings.tuexen2011-12-172-10/+10
| | | | | | While there, fix some whitespace issues. MFC after: 3 months.
* A major overhaul of the CARP implementation. The ip_carp.c was startedglebius2011-12-165-10/+33
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | from scratch, copying needed functionality from the old implemenation on demand, with a thorough review of all code. The main change is that interface layer has been removed from the CARP. Now redundant addresses are configured exactly on the interfaces, they run on. The CARP configuration itself is, as before, configured and read via SIOCSVH/SIOCGVH ioctls. A new prefix created with SIOCAIFADDR or SIOCAIFADDR_IN6 may now be configured to a particular virtual host id, which makes the prefix redundant. ifconfig(8) semantics has been changed too: now one doesn't need to clone carpXX interface, he/she should directly configure a vhid on a Ethernet interface. To supply vhid data from the kernel to an application the getifaddrs(8) function had been changed to pass ifam_data with each address. [1] The new implementation definitely closes all PRs related to carp(4) being an interface, and may close several others. It also allows to run a single redundant IP per interface. Big thanks to Bjoern Zeeb for his help with inet6 part of patch, for idea on using ifam_data and for several rounds of reviewing! PR: kern/117000, kern/126945, kern/126714, kern/120130, kern/117448 Reviewed by: bz Submitted by: bz [1]
* Fix double free.glebius2011-12-071-1/+0
| | | | | PR: kern/163089 Submitted by: Herbie Robinson <Herbie.Robinson stratus.com>
* Return the correct value for the IPV6_MULTICAST_HOPS getsockopt() call.bz2011-11-131-1/+1
| | | | | Submitted by: rpaulo MFC after: 3 days
* A default route learned from the RAs could be deleted manuallyqingli2011-11-114-3/+45
| | | | | | | | | | | | after its installation. This removal may be accidental and can prevent the default route from being installed in the future if the associated default router has the best preference. The cause is the lack of status update in the default router on the state of its route installation in the kernel FIB. This patch fixes the described problem. Reviewed by: hrs, discussed with hrs MFC after: 5 days
* Fix false positive EADDRINUSE that could be returned by bind, due totrociny2011-11-111-1/+1
| | | | | | | the typo made in r227207. Reported by: kib Tested by: kib
* Mark all SYSCTL_NODEs static that have no corresponding SYSCTL_DECLs.ed2011-11-074-6/+8
| | | | | | The SYSCTL_NODE macro defines a list that stores all child-elements of that node. If there's no SYSCTL_DECL macro anywhere else, there's no reason why it shouldn't be static.
* In icmp6_redirect_input:glebius2011-11-071-11/+6
| | | | | | | | - Assert that we got a valid mbuf with rcvif pointer. [1] - Use __func__ in logging. Submitted by: prabhakar lakhera <prabhakar.lakhera gmail.com> [1] Submitted by: Kristof Provost <kristof sigsegv.be> [1]
* Mark MALLOC_DEFINEs static that have no corresponding MALLOC_DECLAREs.ed2011-11-072-2/+2
| | | | This means that their use is restricted to a single C file.
* Cache SO_REUSEPORT socket option in inpcb-layer in order to avoidtrociny2011-11-062-11/+38
| | | | | | | | | | | | | | inp_socket->so_options dereference when we may not acquire the lock on the inpcb. This fixes the crash due to NULL pointer dereference in in_pcbbind_setup() when inp_socket->so_options in a pcb returned by in_pcblookup_local() was checked. Reported by: dave jones <s.dave.jones@gmail.com>, Arnaud Lacombe <lacombar@gmail.com> Suggested by: rwatson Glanced by: rwatson Tested by: dave jones <s.dave.jones@gmail.com>
* Before dereferencing intotw() check for NULL, the same way as it istrociny2011-11-061-6/+20
| | | | | | done for in_pcb (see r157474). MFC after: 1 week
* Remove a couple of write-only variables.pluknet2011-11-031-7/+0
|
* The code change made in r226040 was incomplete and resulted inqingli2011-10-161-3/+6
| | | | | | | | routes such as fe80::1%lo0 no being installed. This patch completes the original intended fix. Reviewed by: hrs, bz MFC after: 3 days
* The IPv6 code was influx at the time of r196865 due to the L2/L3qingli2011-10-161-4/+0
| | | | | | | | | | | | | | | | | | | | | | | | separation rewrite changes. r196865 was committed to fix a scope violation problem in the following test scenario: box-1# ifconfig em0 inet6 2001:db8:1:: prefixlen 64 anycast box-1# ifconfig em1 inet6 2001:db8:2::1 prefixlen 64 box-2# ifconfig re0 inet6 2001:db8:1::6 prefixlen 64 em0 and re0 are on the same link. box-2# ping6 2001:db8:1:: PING6(56=40+8+8 bytes) 2001:db8:1::6 --> 2001:db8:1:: the ICMPv6 response should have a source address of em1, which is 2001:db8:2::1, not the link-local address of em0. That code is no longer necessary and breaks the IPv6-Ready logo testing, so revert it now. Reviewed by: hrs MFC after: 3 days
* Fix a problem that an interface unexpectedly becomes IFF_UP byhrs2011-10-161-26/+29
| | | | | just doing "ifconfing inet6 -ifdisabled" when the interface has ND6_IFF_AUTO_LINKLOCAL flag and no link-local address.
* Use TAILQ_FOREACH() in the nd6_dad_find() instead of hand-rolled implementation.glebius2011-10-131-4/+4
|
* Restore functions in6_ifaddloop() and in6_ifremloop() that wereglebius2011-10-131-68/+85
| | | | | | | | inlined by Qing Li in his big new-ARP commit. I am going to utilize them in my newcarp work, and also these functions left declared in in6_var.h for all the time they were absent. Reviewed by: bz
* The IFA_RTSELF instead of the IFA_ROUTE flag should be checked toqingli2011-10-051-2/+2
| | | | | | | | | determine if a loopback route should be installed for an interface IPv6 address. Another condition is the address must not belong to a looopback interface. Reviewed by: hrs MFC after: 3 days
OpenPOWER on IntegriCloud