summaryrefslogtreecommitdiffstats
path: root/sys/netinet6/in6_src.c
Commit message (Collapse)AuthorAgeFilesLines
* Clean up VCS Ids.obrien2007-12-101-3/+5
|
* Space cleanupdelphij2007-07-051-2/+2
| | | | Approved by: re (rwatson)
* ANSIfy[1] plus some style cleanup nearby.delphij2007-07-051-57/+33
| | | | | | Discussed with: gnn, rwatson Submitted by: Karl Sj?dahl - dunceor <dunceor gmail com> [1] Approved by: re (rwatson)
* Eliminate now-unused SUSER_ALLOWJAIL arguments to priv_check_cred(); inrwatson2007-06-121-2/+1
| | | | | | | | | | | | | | | some cases, move to priv_check() if it was an operation on a thread and no other flags were present. Eliminate caller-side jail exception checking (also now-unused); jail privilege exception code now goes solely in kern_jail.c. We can't yet eliminate suser() due to some cases in the KAME code where a privilege check is performed and then used in many different deferred paths. Do, however, move those prototypes to priv.h. Reviewed by: csjp Obtained from: TrustedBSD Project
* Rename some fields of struct inpcbinfo to have the ipi_ prefix,rwatson2007-04-301-3/+3
| | | | | | consistent with the naming of other structure field members, and reducing improper grep matches. Clean up and comment structure fields in structure definition.
* Optimize sx locks to use simple atomic operations for the common cases ofjhb2007-03-311-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | obtaining and releasing shared and exclusive locks. The algorithms for manipulating the lock cookie are very similar to that rwlocks. This patch also adds support for exclusive locks using the same algorithm as mutexes. A new sx_init_flags() function has been added so that optional flags can be specified to alter a given locks behavior. The flags include SX_DUPOK, SX_NOWITNESS, SX_NOPROFILE, and SX_QUITE which are all identical in nature to the similar flags for mutexes. Adaptive spinning on select locks may be enabled by enabling the ADAPTIVE_SX kernel option. Only locks initialized with the SX_ADAPTIVESPIN flag via sx_init_flags() will adaptively spin. The common cases for sx_slock(), sx_sunlock(), sx_xlock(), and sx_xunlock() are now performed inline in non-debug kernels. As a result, <sys/sx.h> now requires <sys/lock.h> to be included prior to <sys/sx.h>. The new kernel option SX_NOINLINE can be used to disable the aforementioned inlining in non-debug kernels. The size of struct sx has changed, so the kernel ABI is probably greatly disturbed. MFC after: 1 month Submitted by: attilio Tested by: kris, pjd
* MFp4: 92972, 98913 + one more changebz2006-12-121-3/+4
| | | | | | | In ip6_sprintf no longer use and return one of eight static buffers for printing/logging ipv6 addresses. The caller now has to hand in a sufficiently large buffer as first argument.
* Sweep kernel replacing suser(9) calls with priv(9) calls, assigningrwatson2006-11-061-1/+4
| | | | | | | | | | | | | specific privilege names to a broad range of privileges. These may require some future tweaking. Sponsored by: nCircle Network Security, Inc. Obtained from: TrustedBSD Project Discussed on: arch@ Reviewed (at least in part) by: mlaier, jmg, pjd, bde, ceri, Alex Lyashkov <umka at sevcity dot net>, Skip Ford <skip dot ford at verizon dot net>, Antoine Brodin <antoine dot brodin at laposte dot net>
* With exception of the if_name() macro, all definitions in net_osdep.hbrooks2006-08-041-2/+0
| | | | | | | | were unused or already in if_var.h so add if_name() to if_var.h and remove net_osdep.h along with all references to it. Longer term we may want to kill off if_name() entierly since all modern BSDs have if_xname variables rendering it unnecessicary.
* Avoid spurious release of an rtentry.tanimura2006-05-231-3/+3
|
* Move lock assertions to top of in6_pcbladdr(): we still want them to runrwatson2006-04-251-0/+3
| | | | | | | | | | | | 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
* sync with KAME (removed a unnecesary non-standard macro)suz2005-10-191-8/+10
| | | | | Obtained from: KAME Reviewd by: ume, gnn
* - fix race condition using sx lock.ume2005-08-171-14/+24
| | | | | | - use TAILQ_FOREACH() for readability. Suggested by: jhb
* avoid exclusive sleep mutex.ume2005-08-161-3/+3
|
* - fix typo in comment.ume2005-08-121-1/+1
| | | | | | | - nuke unused code. Submitted by: suz Obtained from: KAME
* nuke duplicate inclusion of scope6_var.h.ume2005-07-261-3/+0
|
* scope cleanup. with this changeume2005-07-251-231/+115
| | | | | | | | | | | | | | | | | | | - most of the kernel code will not care about the actual encoding of scope zone IDs and won't touch "s6_addr16[1]" directly. - similarly, most of the kernel code will not care about link-local scoped addresses as a special case. - scope boundary check will be stricter. For example, the current *BSD code allows a packet with src=::1 and dst=(some global IPv6 address) to be sent outside of the node, if the application do: s = socket(AF_INET6); bind(s, "::1"); sendto(s, some_global_IPv6_addr); This is clearly wrong, since ::1 is only meaningful within a single node, but the current implementation of the *BSD kernel cannot reject this attempt. Submitted by: JINMEI Tatuya <jinmei__at__isl.rdc.toshiba.co.jp> Obtained from: KAME
* Fixes for various nits found by the Coverity tool.gnn2005-05-151-1/+1
| | | | | | | | | In particular 2 missed return values and an inappropriate bcopy from a possibly NULL pointer. Reviewed by: jake Approved by: rwatson MFC after: 1 week
* /* -> /*- for license, minor formatting changes, separate for KAMEimp2005-01-071-2/+2
|
* Remove advertising clause from University of California Regent'simp2004-04-071-4/+0
| | | | | | | license, per letter dated July 22, 1999 and email from Peter Wemm, Alan Cox and Robert Watson. Approved by: core, peter, alc, rwatson
* Reduce 'td' argument to 'cred' (struct ucred) argument in those functions:pjd2004-03-271-3/+3
| | | | | | | | | | | | | | - in_pcbbind(), - in_pcbbind_setup(), - in_pcbconnect(), - in_pcbconnect_setup(), - in6_pcbbind(), - in6_pcbconnect(), - in6_pcbsetport(). "It should simplify/clarify things a great deal." --rwatson Requested by: rwatson Reviewed by: rwatson, ume
* KNFume2004-02-041-8/+7
| | | | Obtained from: KAME
* Catch a few places where NULL (pointer) was used where 0 (integer) waspeter2003-12-231-1/+1
| | | | expected.
* Introduce tcp_hostcache and remove the tcp specific metrics fromandre2003-11-201-8/+37
| | | | | | | | | | | | | | | | | | | | | | | the routing table. Move all usage and references in the tcp stack from the routing table metrics to the tcp hostcache. It caches measured parameters of past tcp sessions to provide better initial start values for following connections from or to the same source or destination. Depending on the network parameters to/from the remote host this can lead to significant speedups for new tcp connections after the first one because they inherit and shortcut the learning curve. tcp_hostcache is designed for multiple concurrent access in SMP environments with high contention and is hash indexed by remote ip address. It removes significant locking requirements from the tcp stack with regard to the routing table. Reviewed by: sam (mentor), bms Reviewed by: -net, -current, core@kame.net (IPv6 parts) Approved by: re (scottl)
* reflect ip6_pktopts and ip6_moptions into embeded scope ofume2003-11-121-3/+17
| | | | | | destination address. it makes `ping6 -I <if> <link-local>' work again. since we don't merge scope cleanup yet, we need this for workaround.
* make sure to treat destrination address as KAME internal formume2003-11-051-29/+8
| | | | of embedscope.
* source address selection part of RFC3484.ume2003-11-041-104/+555
| | | | | | | | TODO: since there is scope issue to be solved, multicast and link-local address are treated as special for workaround for now. Obtained from: KAME
* - update comments to refrect recent BSDs.ume2003-11-041-1/+2
| | | | | | | - nuke unused macro PSUEDO_SET(). - I believe our if_xname stuff is nothing strange against other BSDs. Obtained from: KAME
* - unlock on error.ume2003-10-301-4/+10
| | | | - don't call malloc with M_WAITOK within lock context.
* add management part of address selection policy described inume2003-10-301-0/+202
| | | | | | RFC3484. Obtained from: KAME
* check return result from rtalloc1 before invoking RTUNLOCKsam2003-10-231-1/+2
|
* drop the code of HAVE_NRL_INPCB part. our system doesn'tume2003-10-221-10/+0
| | | | use NRL style INPCB.
* - change scope to zone.ume2003-10-211-10/+9
| | | | | | | | - change node-local to interface-local. - better error handling of address-to-scope mapping. - use in6_clearscope(). Obtained from: KAME
* - add dom_if{attach,detach} framework.ume2003-10-171-1/+1
| | | | | | - transition to use ifp->if_afdata. Obtained from: KAME
* - fix typo in comments.ume2003-10-081-24/+5
| | | | | | | | | | - style. - NULL is not 0. - some variables were renamed. - nuke unused logic. (there is no functional change.) Obtained from: KAME
* return(code) -> return (code)ume2003-10-061-20/+20
| | | | (reduce diffs against KAME)
* Locking for updates to routing table entries. Each rtentry gets a mutexsam2003-10-041-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | that covers updates to the contents. Note this is separate from holding a reference and/or locking the routing table itself. Other/related changes: o rtredirect loses the final parameter by which an rtentry reference may be returned; this was never used and added unwarranted complexity for locking. o minor style cleanups to routing code (e.g. ansi-fy function decls) o remove the logic to bump the refcnt on the parent of cloned routes, we assume the parent will remain as long as the clone; doing this avoids a circularity in locking during delete o convert some timeouts to MPSAFE callouts Notes: 1. rt_mtx in struct rtentry is guarded by #ifdef _KERNEL as user-level applications cannot/do-no know about mutex's. Doing this requires that the mutex be the last element in the structure. A better solution is to introduce an externalized version of struct rtentry but this is a major task because of the intertwining of rtentry and other data structures that are visible to user applications. 2. There are known LOR's that are expected to go away with forthcoming work to eliminate many held references. If not these will be resolved prior to release. 3. ATM changes are untested. Sponsored by: FreeBSD Foundation Obtained from: BSD/OS (partly)
* Back out my lats commit of locking down a socket, it conflicts with hsu's work.tanimura2002-05-311-2/+0
| | | | Requested by: hsu
* Lock down a socket, milestone 1.tanimura2002-05-201-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | o Add a mutex (sb_mtx) to struct sockbuf. This protects the data in a socket buffer. The mutex in the receive buffer also protects the data in struct socket. o Determine the lock strategy for each members in struct socket. o Lock down the following members: - so_count - so_options - so_linger - so_state o Remove *_locked() socket APIs. Make the following socket APIs touching the members above now require a locked socket: - sodisconnect() - soisconnected() - soisconnecting() - soisdisconnected() - soisdisconnecting() - sofree() - soref() - sorele() - sorwakeup() - sotryfree() - sowakeup() - sowwakeup() Reviewed by: alfred
* Change the suser() API to take advantage of td_ucred as well as do ajhb2002-04-011-1/+1
| | | | | | | | | | | | general cleanup of the API. The entire API now consists of two functions similar to the pre-KSE API. The suser() function takes a thread pointer as its only argument. The td_ucred member of this thread must be valid so the only valid thread pointers are curthread and a few kernel threads such as thread0. The suser_cred() function takes a pointer to a struct ucred as its first argument and an integer flag as its second argument. The flag is currently only used for the PRISON_ROOT flag. Discussed on: smp@
* - Check the address family of a cached destination, in case ofume2002-01-211-1/+4
| | | | | | | sharing the cache with IPv4. - Check if the cached route is up in in6_selectsrc(). Obtained from: KAME
* KSE Milestone 2julian2001-09-121-3/+3
| | | | | | | | | | | | | | Note ALL MODULES MUST BE RECOMPILED make the kernel aware that there are smaller units of scheduling than the process. (but only allow one thread per process at this time). This is functionally equivalent to teh previousl -current except that there is a thread associated with each process. Sorry john! (your next MFC will be a doosie!) Reviewed by: peter@freebsd.org, dillon@freebsd.org X-MFC after: ha ha ha ha
* Wrap array accesses in macros, which also happen to be lvalues:jlemon2001-09-061-5/+4
| | | | | | | ifnet_addrs[i - 1] -> ifaddr_byindex(i) ifindex2ifnet[i] -> ifnet_byindex(i) This is intended to ease the conversion to SMPng.
* Sync with recent KAME.ume2001-06-111-14/+23
| | | | | | | | | | | | | | | | | | This work was based on kame-20010528-freebsd43-snap.tgz and some critical problem after the snap was out were fixed. There are many many changes since last KAME merge. TODO: - The definitions of SADB_* in sys/net/pfkeyv2.h are still different from RFC2407/IANA assignment because of binary compatibility issue. It should be fixed under 5-CURRENT. - ip6po_m member of struct ip6_pktopts is no longer used. But, it is still there because of binary compatibility issue. It should be removed under 5-CURRENT. Reviewed by: itojun Obtained from: KAME MFC after: 3 weeks
* Yikes, these files bogusly #include "loop.h" but didn't use the value.peter2001-01-291-2/+0
| | | | My searching for NLOOP missed them. :-(
* Move suser() and suser_xxx() prototypes and a related #define fromphk2000-10-291-1/+0
| | | | | | | | | <sys/proc.h> to <sys/systm.h>. Correctly document the #includes needed in the manpage. Add one now needed #include of <sys/systm.h>. Remove the consequent 48 unused #includes of <sys/proc.h>.
* sync with kame tree as of july00. tons of bug fixes/improvements.itojun2000-07-041-0/+550
API changes: - additional IPv6 ioctls - IPsec PF_KEY API was changed, it is mandatory to upgrade setkey(8). (also syntax change)
OpenPOWER on IntegriCloud