summaryrefslogtreecommitdiffstats
path: root/sys/netinet6
Commit message (Collapse)AuthorAgeFilesLines
* Assert ip6_forward_rt protected by Giant adding GIANT_REQUIRED tobz2006-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.
* Break out socket access control and delivery logic from udp6_input()rwatson2006-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
* Move lock assertions to top of in6_pcbladdr(): we still want them to runrwatson2006-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
* Modify in6_pcbpurgeif0() to accept a pcbinfo structure rather than a pcbrwatson2006-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
* Allow for nmbclusters and maxsockets to be increased via sysctl.ps2006-04-211-0/+10
| | | | | An eventhandler is used to update all the various zones that depend on these values.
* Mirror IPv4 pcb locking into in6_setsockaddr() and in6_setpeeraddr():rwatson2006-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
* Assert the inpcb lock in udp6_output(), as we dereference variousrwatson2006-04-121-0/+2
| | | | | | fields. MFC after: 3 months
* Add comment to udp6_input() that locking is missing from multicastrwatson2006-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
* Add udbinfo locking in udp6_input() to protect lookups of the inpcbrwatson2006-04-121-2/+8
| | | | | | lists during UDPv6 receipt. MFC after: 3 months
* Don't use spl around call to in_pcballoc() in IPv6 raw socket support;rwatson2006-04-121-3/+1
| | | | | | all necessary synchronization appears present. MFC after: 3 months
* Remove one remaining use of spl in the IPv6 fragmentation code, asrwatson2006-04-121-3/+0
| | | | | | this code appears properly locked. MFC after: 3 months
* Add missing locking to udp6_getcred(), remove spl use.rwatson2006-04-121-24/+21
| | | | MFC after: 3 months
* Remove spl use from IPv6 inpcb code.rwatson2006-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
* ip6_mrouter_done(): use if_allmulti(0) for disabling the multicast ↵suz2006-04-101-7/+1
| | | | | | | promiscuous mode Obtained from: KAME MFC after: 2 days
* Fix assertion description: !=, not ==.rwatson2006-04-091-1/+1
| | | | | Submitted by: pjd MFC after: 3 months
* Update in_pcb-derived basic socket types following changes torwatson2006-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
* Break out in_pcbdetach() into two functions:rwatson2006-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
* Chance protocol switch method pru_detach() so that it returns voidrwatson2006-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
* Change protocol switch pru_abort() API so that it returns void ratherrwatson2006-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
* This comment on various IPPORT_ defines was copied from in.h anddwmalone2006-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
* Remove manual assignment of m_pkthdr from one mbuf to another inrwatson2006-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
* fixed a memory leak when net.inet6.icmp6.nd6_maxqueuelen is greater than 1suz2006-03-241-4/+26
| | | | | Obtained from: KAME MFC after: 3 days
* Make net.inet.ip.portrange.reservedhigh anddwmalone2006-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
* implements section 2.2 of RFC4191, regarding the reserved preference value (10)suz2006-03-191-12/+2
| | | | | Obtained from: KAME MFC after: 1 day
* updates net.inet6.ip6.kame_version as the proof of the latest KAME mergesuz2006-03-191-1/+1
| | | | | Reviewed by: KAME MFC after: 2 days
* fixed a bug that an MLD report is not advertised when group-specific MLD ↵suz2006-03-041-2/+3
| | | | | | | | query is received. PR: kern/93526 Obtained from: KAME MFC after: 1 day
* avoided the use of purged address structure when an address becameume2006-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
* Fix for an inappropriate bzero of the ICMPv6 stats. The code was zero'ing ↵gnn2006-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
* shut up strict-aliasing rules warning.ume2006-02-051-1/+1
|
* make IPV6_V6ONLY socket option work for UDP as well.ume2006-02-021-12/+4
| | | | | | PR: ports/92620 Reported by: Kurt Miller <kurt__at__intricatesoftware.com> MFC after: 1 week
* Somewhat re-factor the read/write locking mechanism associated with the packetcsjp2006-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
* Add some initial locking to gif(4). It doesn't covers the whole driver,glebius2006-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>
* don't embed scope id before running packet filters.ume2006-01-251-20/+20
| | | | | | Reported by: YAMAMOTO Takashi <yamt__at__mwd.biglobe.ne.jp> Obtained from: NetBSD MFC after: 1 week
* Convert in6_cksum() to ANSI C function declaration.rwatson2006-01-221-4/+1
| | | | MFC after: 1 week
* When storing the results of malloc() in a pointer to a pointer, checkrwatson2006-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
* In ipcomp6_input(), check 'md' not 'm' after a call to m_pulldown(): 'm'rwatson2006-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
* added a note about the assumption for m->m_pkthdr.rcvifsuz2006-01-091-0/+8
| | | | | Obtained from: KAME MFC After: 1 day
* Add RFC 3378 EtherIP support. This change makes it possible to add gifthompsa2005-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
* fixed a kernel crash at the initialization time of PIM-SM register interfacesuz2005-12-091-13/+30
| | | | MFC after: 2 days
* the response NS to a DAD NS was not sent correctly due to theume2005-12-081-5/+5
| | | | | | | invalid destination address. Submitted by: JINMEI Tatuya <jinmei__at__isl.rdc.toshiba.co.jp> MFC after: 1 day
* fixed a kernel crash due to an improper removal of callout-timersuz2005-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
* Use sparse initializers for "struct domain" and "struct protosw",ru2005-11-091-93/+154
| | | | so they are easier to follow for the human being.
* statically configured IPv6 address is properly added/deleted nowsuz2005-10-311-75/+51
| | | | | | Obtained from: KAME Reported in: freebsd-net@freebsd MFC after: 1 day
* fixed a compilation failure on amd64/sparc64/ia64suz2005-10-222-4/+6
| | | | | Submitted by: max MFC after: 2 month
* nuked non-existing commandssuz2005-10-211-5/+0
|
* sync with KAME regarding NDPsuz2005-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
* perform NUD on an IPv6-aware point-to-point interfacesuz2005-10-211-0/+2
| | | | | Obtained from: KAME MFC after: 1 week
* sync with KAME (renamed a macro IPV6_DADOUTPUT to IPV6_UNSPECSRC)suz2005-10-213-3/+3
| | | | Obtained from: KAME
* sync with KAME (nuked unused code, use NULL to denote a NULL pointer)suz2005-10-193-65/+7
| | | | | Obtained from: KAME Reviewed by: ume, gnn
* sync with KAME (removed a unnecesary non-standard macro)suz2005-10-192-16/+10
| | | | | Obtained from: KAME Reviewd by: ume, gnn
OpenPOWER on IntegriCloud