aboutsummaryrefslogtreecommitdiff
path: root/sys/netinet6
Commit message (Collapse)AuthorAgeFilesLines
* Avoid spurious release of an rtentry.Seigo Tanimura2006-05-231-3/+3
| | | | Notes: svn path=/head/; revision=158843
* In IN6_IS_ADDR_V4MAPPED case instead of returning directly set error andBjoern A. Zeeb2006-05-201-2/+4
| | | | | | | | | goto out so that locks will be dropped. Reviewed by: rwatson, gnn Notes: svn path=/head/; revision=158765
* Remove ip6fw. Since ipfw has full functional IPv6 support now and - inMax Laier2006-05-125-1647/+0
| | | | | | | contrast to ip6fw - is properly lockes, it is time to retire ip6fw. Notes: svn path=/head/; revision=158500
* Assert ip6_forward_rt protected by Giant adding GIANT_REQUIRED toBjoern A. Zeeb2006-05-042-0/+6
| | | | | | | | | | | functions not yet asserting it but working on global ip6_forward_rt route cache which is not locked and perhaps should go away in the future though cache hit/miss ration wasn't bad. It's #if 0ed in frag6 because the code working on ip6_forward_rt is. Notes: svn path=/head/; revision=158295
* Break out socket access control and delivery logic from udp6_input()Robert Watson2006-05-011-96/+55
| | | | | | | | | | | | | | into its own function, udp6_append(). This mirrors a similar structure in udp_input() and udp_append(), and makes the whole thing a lot more readable. While here, add missing inpcb locking in UDP6 input path. Reviewed by: bz MFC after: 3 months Notes: svn path=/head/; revision=158237
* Move lock assertions to top of in6_pcbladdr(): we still want them to runRobert Watson2006-04-252-3/+10
| | | | | | | | | | | | | | | even if we're going to return an argument-based error. Assert pcbinfo lock in in6_pcblookup_local(), in6_pcblookup_hash(), since they walk pcbinfo inpcb lists. Assert inpcb and pcbinfo locks in in6_pcbsetport(), since port reservations are changing. MFC after: 3 months Notes: svn path=/head/; revision=158011
* Modify in6_pcbpurgeif0() to accept a pcbinfo structure rather than a pcbRobert Watson2006-04-233-8/+10
| | | | | | | | | | | | | list head structure; this improves congruence to IPv4, and also allows in6_pcbpurgeif0() to lock the pcbinfo. Modify in6_pcbpurgeif0() to lock the pcbinfo before iterating the pcb list, use queue(9)'s LIST_FOREACH() for the iteration, and to lock individual inpcb's while manipulating them. MFC after: 3 months Notes: svn path=/head/; revision=157978
* Allow for nmbclusters and maxsockets to be increased via sysctl.Paul Saab2006-04-211-0/+10
| | | | | | | | An eventhandler is used to update all the various zones that depend on these values. Notes: svn path=/head/; revision=157927
* Mirror IPv4 pcb locking into in6_setsockaddr() and in6_setpeeraddr():Robert Watson2006-04-151-0/+4
| | | | | | | | | | acquire inpcb lock when reading inpcb port+address in order to prevent races with other threads that may be changing them. MFC after: 3 months Notes: svn path=/head/; revision=157767
* Assert the inpcb lock in udp6_output(), as we dereference variousRobert Watson2006-04-121-0/+2
| | | | | | | | | fields. MFC after: 3 months Notes: svn path=/head/; revision=157679
* Add comment to udp6_input() that locking is missing from multicastRobert Watson2006-04-121-1/+8
| | | | | | | | | | | | UDPv6 delivery. Lock the inpcb of the UDP connection being delivered to before processing IPSEC policy and other delivery activities. MFC after: 3 months Notes: svn path=/head/; revision=157678
* Add udbinfo locking in udp6_input() to protect lookups of the inpcbRobert Watson2006-04-121-2/+8
| | | | | | | | | lists during UDPv6 receipt. MFC after: 3 months Notes: svn path=/head/; revision=157677
* Don't use spl around call to in_pcballoc() in IPv6 raw socket support;Robert Watson2006-04-121-3/+1
| | | | | | | | | all necessary synchronization appears present. MFC after: 3 months Notes: svn path=/head/; revision=157676
* Remove one remaining use of spl in the IPv6 fragmentation code, asRobert Watson2006-04-121-3/+0
| | | | | | | | | this code appears properly locked. MFC after: 3 months Notes: svn path=/head/; revision=157675
* Add missing locking to udp6_getcred(), remove spl use.Robert Watson2006-04-121-24/+21
| | | | | | | MFC after: 3 months Notes: svn path=/head/; revision=157674
* Remove spl use from IPv6 inpcb code.Robert Watson2006-04-121-25/+13
| | | | | | | | | | In various inpcb methods for IPv6 sockets, don't check of so_pcb is NULL, assert it isn't. MFC after: 3 months Notes: svn path=/head/; revision=157673
* ip6_mrouter_done(): use if_allmulti(0) for disabling the multicast ↵SUZUKI Shinsuke2006-04-101-7/+1
| | | | | | | | | | promiscuous mode Obtained from: KAME MFC after: 2 days Notes: svn path=/head/; revision=157633
* Fix assertion description: !=, not ==.Robert Watson2006-04-091-1/+1
| | | | | | | | Submitted by: pjd MFC after: 3 months Notes: svn path=/head/; revision=157607
* Update in_pcb-derived basic socket types following changes toRobert Watson2006-04-012-70/+31
| | | | | | | | | | | | | | | | | | | | | | | | pru_abort(), pru_detach(), and in_pcbdetach(): - Universally support and enforce the invariant that so_pcb is never NULL, converting dozens of unnecessary NULL checks into assertions, and eliminating dozens of unnecessary error handling cases in protocol code. - In some cases, eliminate unnecessary pcbinfo locking, as it is no longer required to ensure so_pcb != NULL. For example, in protocol shutdown methods, and in raw IP send. - Abort and detach protocol switch methods no longer return failures, nor attempt to free sockets, as the socket layer does this. - Invoke in_pcbfree() after in_pcbdetach() in order to free the detached in_pcb structure for a socket. MFC after: 3 months Notes: svn path=/head/; revision=157374
* Break out in_pcbdetach() into two functions:Robert Watson2006-04-012-13/+12
| | | | | | | | | | | | | | | | | | | | | - in_pcbdetach(), which removes the link between an inpcb and its socket. - in_pcbfree(), which frees a detached pcb. Unlike the previous in_pcbdetach(), neither of these functions will attempt to conditionally free the socket, as they are responsible only for managing in_pcb memory. Mirror these changes into in6_pcbdetach() by breaking it into in6_pcbdetach() and in6_pcbfree(). While here, eliminate undesired checks for NULL inpcb pointers in sockets, as we will now have as an invariant that sockets will always have valid so_pcb pointers. MFC after: 3 months Notes: svn path=/head/; revision=157373
* Chance protocol switch method pru_detach() so that it returns voidRobert Watson2006-04-012-6/+4
| | | | | | | | | | | | | | | | | | | | | | | | | | | | rather than an error. Detaches do not "fail", they other occur or the protocol flags SS_PROTOREF to take ownership of the socket. soclose() no longer looks at so_pcb to see if it's NULL, relying entirely on the protocol to decide whether it's time to free the socket or not using SS_PROTOREF. so_pcb is now entirely owned and managed by the protocol code. Likewise, no longer test so_pcb in other socket functions, such as soreceive(), which have no business digging into protocol internals. Protocol detach routines no longer try to free the socket on detach, this is performed in the socket code if the protocol permits it. In rts_detach(), no longer test for rp != NULL in detach, and likewise in other protocols that don't permit a NULL so_pcb, reduce the incidence of testing for it during detach. netinet and netinet6 are not fully updated to this change, which will be in an upcoming commit. In their current state they may leak memory or panic. MFC after: 3 months Notes: svn path=/head/; revision=157370
* Change protocol switch pru_abort() API so that it returns void ratherRobert Watson2006-04-012-6/+6
| | | | | | | | | | | | | | | | | than an int, as an error here is not meaningful. Modify soabort() to unconditionally free the socket on the return of pru_abort(), and modify most protocols to no longer conditionally free the socket, since the caller will do this. This commit likely leaves parts of netinet and netinet6 in a situation where they may panic or leak memory, as they have not are not fully updated by this commit. This will be corrected shortly in followup commits to these components. MFC after: 3 months Notes: svn path=/head/; revision=157366
* This comment on various IPPORT_ defines was copied from in.h andDavid Malone2006-03-281-25/+3
| | | | | | | | | | | probably never fully applied to IPv6. Over time it has become more stale, so replace it with something more up to date. Reviewed by: ume MFC after: 1 month Notes: svn path=/head/; revision=157209
* Remove manual assignment of m_pkthdr from one mbuf to another inRobert Watson2006-03-281-9/+0
| | | | | | | | | | | | | | ipsec_copypkt(), as this is already handled by the call to M_MOVE_PKTHDR(), which also knows how to correctly handle MAC m_tags. This corrects a panic when running with MAC and KAME IPSEC. PR: kern/94599 Submitted by: zhouyi zhou <zhouyi04 at ios dot cn> Reviewed by: bz MFC after: 3 days Notes: svn path=/head/; revision=157207
* fixed a memory leak when net.inet6.icmp6.nd6_maxqueuelen is greater than 1SUZUKI Shinsuke2006-03-241-4/+26
| | | | | | | | Obtained from: KAME MFC after: 3 days Notes: svn path=/head/; revision=157097
* Make net.inet.ip.portrange.reservedhigh andDavid Malone2006-03-191-1/+2
| | | | | | | | | | | | | | | | | net.inet.ip.portrange.reservedlow apply to IPv6 aswell as IPv4. We could have made new sysctls for IPv6, but that potentially makes things complicated for mapped addresses. This seems like the least confusing option and least likely to cause obscure problems in the future. This change makes the mac_portacl module useful with IPv6 apps. Reviewed by: ume MFC after: 1 month Notes: svn path=/head/; revision=156877
* implements section 2.2 of RFC4191, regarding the reserved preference value (10)SUZUKI Shinsuke2006-03-191-12/+2
| | | | | | | | Obtained from: KAME MFC after: 1 day Notes: svn path=/head/; revision=156871
* updates net.inet6.ip6.kame_version as the proof of the latest KAME mergeSUZUKI Shinsuke2006-03-191-1/+1
| | | | | | | | Reviewed by: KAME MFC after: 2 days Notes: svn path=/head/; revision=156865
* fixed a bug that an MLD report is not advertised when group-specific MLD ↵SUZUKI Shinsuke2006-03-041-2/+3
| | | | | | | | | | | query is received. PR: kern/93526 Obtained from: KAME MFC after: 1 day Notes: svn path=/head/; revision=156274
* avoided the use of purged address structure when an address becameHajimu UMEMOTO2006-02-121-2/+1
| | | | | | | | | | | | | | invalid in nd6_timer(). PR: kern/93170 Reported by: kris Submitted by: JINMEI Tatuya <jinmei__at__isl.rdc.toshiba.co.jp> Confirmed by: kris Obtained from: KAME MFC after: 2 days Notes: svn path=/head/; revision=155575
* Fix for an inappropriate bzero of the ICMPv6 stats. The code was zero'ing ↵George V. Neville-Neil2006-02-081-1/+1
| | | | | | | | | | | the wrong structure member but setting the correct one. Submitted by: James dot Juran at baesystems dot com Reviewed by: gnn MFC after: 1 week Notes: svn path=/head/; revision=155454
* shut up strict-aliasing rules warning.Hajimu UMEMOTO2006-02-051-1/+1
| | | | Notes: svn path=/head/; revision=155333
* make IPV6_V6ONLY socket option work for UDP as well.Hajimu UMEMOTO2006-02-021-12/+4
| | | | | | | | | PR: ports/92620 Reported by: Kurt Miller <kurt__at__intricatesoftware.com> MFC after: 1 week Notes: svn path=/head/; revision=155217
* Somewhat re-factor the read/write locking mechanism associated with the packetChristian S.J. Peron2006-02-023-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | filtering mechanisms to use the new rwlock(9) locking API: - Drop the variables stored in the phil_head structure which were specific to conditions and the home rolled read/write locking mechanism. - Drop some includes which were used for condition variables - Drop the inline functions, and convert them to macros. Also, move these macros into pfil.h - Move pfil list locking macros intp phil.h as well - Rename ph_busy_count to ph_nhooks. This variable will represent the number of IN/OUT hooks registered with the pfil head structure - Define PFIL_HOOKED macro which evaluates to true if there are any hooks to be ran by pfil_run_hooks - In the IP/IP6 stacks, change the ph_busy_count comparison to use the new PFIL_HOOKED macro. - Drop optimization in pfil_run_hooks which checks to see if there are any hooks to be ran, and returns if not. This check is already performed by the IP stacks when they call: if (!PFIL_HOOKED(ph)) goto skip_hooks; - Drop in assertion which makes sure that the number of hooks never drops below 0 for good measure. This in theory should never happen, and if it does than there are problems somewhere - Drop special logic around PFIL_WAITOK because rw_wlock(9) does not sleep - Drop variables which support home rolled read/write locking mechanism from the IPFW firewall chain structure. - Swap out the read/write firewall chain lock internal to use the rwlock(9) API instead of our home rolled version - Convert the inlined functions to macros Reviewed by: mlaier, andre, glebius Thanks to: jhb for the new locking API Notes: svn path=/head/; revision=155201
* Add some initial locking to gif(4). It doesn't covers the whole driver,Gleb Smirnoff2006-01-301-0/+2
| | | | | | | | | | | | | | | | | however IPv4-in-IPv4 tunnels are now stable on SMP. Details: - Add per-softc mutex. - Hold the mutex on output. The main problem was the rtentry, placed in softc. It could be freed by ip_output(). Meanwhile, another thread being in in_gif_output() can read and write this rtentry. Reported by: many Tested by: Alexander Shiryaev <aixp mail.ru> Notes: svn path=/head/; revision=155037
* don't embed scope id before running packet filters.Hajimu UMEMOTO2006-01-251-20/+20
| | | | | | | | | Reported by: YAMAMOTO Takashi <yamt__at__mwd.biglobe.ne.jp> Obtained from: NetBSD MFC after: 1 week Notes: svn path=/head/; revision=154804
* Convert in6_cksum() to ANSI C function declaration.Robert Watson2006-01-221-4/+1
| | | | | | | MFC after: 1 week Notes: svn path=/head/; revision=154667
* When storing the results of malloc() in a pointer to a pointer, checkRobert Watson2006-01-141-1/+1
| | | | | | | | | | the pointer to a pointer for NULL, not the pointer for NULL. Noticed by: Coverity Prevent analysis tool MFC after: 3 days Notes: svn path=/head/; revision=154324
* In ipcomp6_input(), check 'md' not 'm' after a call to m_pulldown(): 'm'Robert Watson2006-01-131-1/+1
| | | | | | | | | | | may be a stale pointer at this point, and we're interested in whether or not m_pulldown() failed. Noticed by: Coverity Prevent analysis tool MFC after: 3 days Notes: svn path=/head/; revision=154322
* added a note about the assumption for m->m_pkthdr.rcvifSUZUKI Shinsuke2006-01-091-0/+8
| | | | | | | | Obtained from: KAME MFC After: 1 day Notes: svn path=/head/; revision=154131
* Add RFC 3378 EtherIP support. This change makes it possible to add gifAndrew Thompson2005-12-211-0/+19
| | | | | | | | | | | interfaces to bridges, which will then send and receive IP protocol 97 packets. Packets are Ethernet frames with an EtherIP header prepended. Obtained from: NetBSD MFC after: 2 weeks Notes: svn path=/head/; revision=153621
* fixed a kernel crash at the initialization time of PIM-SM register interfaceSUZUKI Shinsuke2005-12-091-13/+30
| | | | | | | MFC after: 2 days Notes: svn path=/head/; revision=153257
* the response NS to a DAD NS was not sent correctly due to theHajimu UMEMOTO2005-12-081-5/+5
| | | | | | | | | | invalid destination address. Submitted by: JINMEI Tatuya <jinmei__at__isl.rdc.toshiba.co.jp> MFC after: 1 day Notes: svn path=/head/; revision=153227
* fixed a kernel crash due to an improper removal of callout-timerSUZUKI Shinsuke2005-11-161-0/+1
| | | | | | | | | | | (ToDo: similar fix is necessary for other NDP-related callout-timers in netinet6/nd6*.c) PR: kern/88725 MFC after: 1 month Notes: svn path=/head/; revision=152524
* Use sparse initializers for "struct domain" and "struct protosw",Ruslan Ermilov2005-11-091-93/+154
| | | | | | | so they are easier to follow for the human being. Notes: svn path=/head/; revision=152242
* statically configured IPv6 address is properly added/deleted nowSUZUKI Shinsuke2005-10-311-75/+51
| | | | | | | | | Obtained from: KAME Reported in: freebsd-net@freebsd MFC after: 1 day Notes: svn path=/head/; revision=151915
* fixed a compilation failure on amd64/sparc64/ia64SUZUKI Shinsuke2005-10-222-4/+6
| | | | | | | | Submitted by: max MFC after: 2 month Notes: svn path=/head/; revision=151546
* nuked non-existing commandsSUZUKI Shinsuke2005-10-211-5/+0
| | | | Notes: svn path=/head/; revision=151540
* sync with KAME regarding NDPSUZUKI Shinsuke2005-10-2113-711/+1367
| | | | | | | | | | | | | | | - introduced fine-grain-timer to manage ND-caches and IPv6 Multicast-Listeners - supports Router-Preference <draft-ietf-ipv6-router-selection-07.txt> - better prefix lifetime management - more spec-comformant DAD advertisement - updated RFC/internet-draft revisions Obtained from: KAME Reviewed by: ume, gnn MFC after: 2 month Notes: svn path=/head/; revision=151539
* perform NUD on an IPv6-aware point-to-point interfaceSUZUKI Shinsuke2005-10-211-0/+2
| | | | | | | | Obtained from: KAME MFC after: 1 week Notes: svn path=/head/; revision=151537