summaryrefslogtreecommitdiff
path: root/sys/netinet6/udp6_usrreq.c
Commit message (Collapse)AuthorAgeFilesLines
* Remove advertising clause from University of California Regent'sWarner Losh2004-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 Notes: svn path=/head/; revision=128019
* UDP checksum is mandatory in IPv6 (RFC2460 p.28)SUZUKI Shinsuke2004-04-011-2/+4
| | | | | | | Obtained from: KAME Notes: svn path=/head/; revision=127711
* Reduce 'td' argument to 'cred' (struct ucred) argument in those functions:Pawel Jakub Dawidek2004-03-271-4/+6
| | | | | | | | | | | | | | | | | - 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 Notes: svn path=/head/; revision=127505
* Remove unused argument.Pawel Jakub Dawidek2004-03-271-1/+1
| | | | | | | Reviewed by: ume Notes: svn path=/head/; revision=127504
* IPSEC and FAST_IPSEC have the same internal API now;Hajimu UMEMOTO2004-02-171-30/+12
| | | | | | | | | so merge these (IPSEC has an extra ipsecstat) Submitted by: "Bjoern A. Zeeb" <bzeeb+freebsd@zabbadoz.net> Notes: svn path=/head/; revision=125941
* - wrap mappedaddr block by #ifdef INET for IPv6-only kernel in future.Hajimu UMEMOTO2004-02-131-38/+42
| | | | | | | | | | | | | | | - rejects IPv6 packet toward IPv4-mapped address if its source address is not an IPv4-mapped IPv6 address, since the converted IPv4 packets would have an unexpected IPv4 source address. - when V6ONLY socket option is set, discard packets destined to a v4/ipv4 mapped ipv6 address. - have PULLDOWN_TEST codepath. - get rid of in6_mcmatch(). Obtained from: KAME Notes: svn path=/head/; revision=125777
* supported IPV6_RECVPATHMTU socket option.Hajimu UMEMOTO2004-02-131-3/+6
| | | | | | | Obtained from: KAME Notes: svn path=/head/; revision=125776
* pass pcb rather than so. it is expected that per socket policyHajimu UMEMOTO2004-02-031-3/+3
| | | | | | | works again. Notes: svn path=/head/; revision=125396
* Split the "inp" mutex class into separate classes for each of divert,Sam Leffler2003-11-261-1/+1
| | | | | | | | | | | raw, tcp, udp, raw6, and udp6 sockets to avoid spurious witness complaints. Reviewed by: rwatson Approved by: re (rwatson) Notes: svn path=/head/; revision=122991
* Introduce a MAC label reference in 'struct inpcb', which cachesRobert Watson2003-11-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | the MAC label referenced from 'struct socket' in the IPv4 and IPv6-based protocols. This permits MAC labels to be checked during network delivery operations without dereferencing inp->inp_socket to get to so->so_label, which will eventually avoid our having to grab the socket lock during delivery at the network layer. This change introduces 'struct inpcb' as a labeled object to the MAC Framework, along with the normal circus of entry points: initialization, creation from socket, destruction, as well as a delivery access control check. For most policies, the inpcb label will simply be a cache of the socket label, so a new protocol switch method is introduced, pr_sosetlabel() to notify protocols that the socket layer label has been updated so that the cache can be updated while holding appropriate locks. Most protocols implement this using pru_sosetlabel_null(), but IPv4/IPv6 protocols using inpcbs use the the worker function in_pcbsosetlabel(), which calls into the MAC Framework to perform a cache update. Biba, LOMAC, and MLS implement these entry points, as do the stub policy, and test policy. Reviewed by: sam, bms Obtained from: TrustedBSD Project Sponsored by: DARPA, Network Associates Laboratories Notes: svn path=/head/; revision=122875
* - cleanup SP refcnt issue.Hajimu UMEMOTO2003-11-041-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - share policy-on-socket for listening socket. - don't copy policy-on-socket at all. secpolicy no longer contain spidx, which saves a lot of memory. - deep-copy pcb policy if it is an ipsec policy. assign ID field to all SPD entries. make it possible for racoon to grab SPD entry on pcb. - fixed the order of searching SA table for packets. - fixed to get a security association header. a mode is always needed to compare them. - fixed that the incorrect time was set to sadb_comb_{hard|soft}_usetime. - disallow port spec for tunnel mode policy (as we don't reassemble). - an user can define a policy-id. - clear enc/auth key before freeing. - fixed that the kernel crashed when key_spdacquire() was called because key_spdacquire() had been implemented imcopletely. - preparation for 64bit sequence number. - maintain ordered list of SA, based on SA id. - cleanup secasvar management; refcnt is key.c responsibility; alloc/free is keydb.c responsibility. - cleanup, avoid double-loop. - use hash for spi-based lookup. - mark persistent SP "persistent". XXX in theory refcnt should do the right thing, however, we have "spdflush" which would touch all SPs. another solution would be to de-register persistent SPs from sptree. - u_short -> u_int16_t - reduce kernel stack usage by auto variable secasindex. - clarify function name confusion. ipsec_*_policy -> ipsec_*_pcbpolicy. - avoid variable name confusion. (struct inpcbpolicy *)pcb_sp, spp (struct secpolicy **), sp (struct secpolicy *) - count number of ipsec encapsulations on ipsec4_output, so that we can tell ip_output() how to handle the packet further. - When the value of the ul_proto is ICMP or ICMPV6, the port field in "src" of the spidx specifies ICMP type, and the port field in "dst" of the spidx specifies ICMP code. - avoid from applying IPsec transport mode to the packets when the kernel forwards the packets. Tested by: nork Obtained from: KAME Notes: svn path=/head/; revision=122062
* rename variables.Hajimu UMEMOTO2003-11-021-8/+8
| | | | | | | Obtained from: KAME Notes: svn path=/head/; revision=121901
* ip6_savecontrol() argument is redundantHajimu UMEMOTO2003-10-291-4/+3
| | | | Notes: svn path=/head/; revision=121674
* - typo in commentHajimu UMEMOTO2003-10-091-1/+1
| | | | | | | | | | | - style - ANSIfy (there is no functional change.) Obtained from: KAME Notes: svn path=/head/; revision=120941
* return(code) -> return (code)Hajimu UMEMOTO2003-10-061-1/+1
| | | | | | | (reduce diffs against KAME) Notes: svn path=/head/; revision=120856
* Add a TCP TIMEWAIT state which uses less space than a fullblown TCPJonathan Lemon2003-02-191-3/+3
| | | | | | | | | | | control block. Allow the socket and tcpcb structures to be freed earlier than inpcb. Update code to understand an inp w/o a socket. Reviewed by: hsu, silby, jayanth Sponsored by: DARPA, NAI Labs Notes: svn path=/head/; revision=111145
* Tie new "Fast IPsec" code into the build. This involves the usualSam Leffler2002-10-161-0/+29
| | | | | | | | | | | | | | | configuration stuff as well as conditional code in the IPv4 and IPv6 areas. Everything is conditional on FAST_IPSEC which is mutually exclusive with IPSEC (KAME IPsec implmentation). As noted previously, don't use FAST_IPSEC with INET6 at the moment. Reviewed by: KAME, rwatson Approved by: silence Supported by: Vernier Networks Notes: svn path=/head/; revision=105199
* Enclose IPv6 addresses in brackets when they are displayed printable with aJuli Mallett2002-08-191-1/+1
| | | | | | | | | | | TCP/UDP port seperated by a colon. This is for the log_in_vain facility. Pointed out by: Edward J. M. Brocklesby Reviewed by: ume MFC after: 2 weeks Notes: svn path=/head/; revision=102131
* cleanup usage of ip6_mapped_addr_on and ip6_v6only. now,Hajimu UMEMOTO2002-07-251-3/+3
| | | | | | | | | ip6_mapped_addr_on is unified into ip6_v6only. MFC after: 1 week Notes: svn path=/head/; revision=100683
* - fixed a bug that we can't send a packet to ipv4mapped ipv6 addressHajimu UMEMOTO2002-07-151-0/+2
| | | | | | | | | | | | | using a udp6 socket without bind(2)ing. - fbsd4/430 reported from the FreeBSD team. - this fix is different from the fix reported in the above PR. i think this better, but we need some test. Obtained from: KAME MFC after: 3 weeks Notes: svn path=/head/; revision=100132
* Notify functions can destroy the pcb, so they have to return anJeffrey Hsu2002-06-141-1/+1
| | | | | | | | | | | indication of whether this happenned so the calling function knows whether or not to unlock the pcb. Submitted by: Jennifer Yang (yangjihui@yahoo.com) Bug reported by: Sid Carter (sidcarter@symonds.net) Notes: svn path=/head/; revision=98211
* Back out my lats commit of locking down a socket, it conflicts with hsu's work.Seigo Tanimura2002-05-311-49/+8
| | | | | | | Requested by: hsu Notes: svn path=/head/; revision=97658
* Lock down a socket, milestone 1.Seigo Tanimura2002-05-201-8/+49
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=96972
* Revert the change of #includes in sys/filedesc.h and sys/socketvar.h.Seigo Tanimura2002-04-301-10/+13
| | | | | | | | | | | | | Requested by: bde Since locking sigio_lock is usually followed by calling pgsigio(), move the declaration of sigio_lock and the definitions of SIGIO_*() to sys/signalvar.h. While I am here, sort include files alphabetically, where possible. Notes: svn path=/head/; revision=95759
* just merged cosmetic changes from KAME to ease sync between KAME and FreeBSD.SUZUKI Shinsuke2002-04-191-6/+5
| | | | | | | | | | (based on freebsd4-snap-20020128) Reviewed by: ume MFC after: 1 week Notes: svn path=/head/; revision=95023
* Change the suser() API to take advantage of td_ucred as well as do aJohn Baldwin2002-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@ Notes: svn path=/head/; revision=93593
* Introduce a version field to `struct xucred' in place of one of theDima Dorfman2002-02-271-5/+1
| | | | | | | | | | | | | | | spares (the size of the field was changed from u_short to u_int to reflect what it really ends up being). Accordingly, change users of xucred to set and check this field as appropriate. In the kernel, this is being done inside the new cru2x() routine which takes a `struct ucred' and fills out a `struct xucred' according to the former. This also has the pleasant sideaffect of removing some duplicate code. Reviewed by: rwatson Notes: svn path=/head/; revision=91354
* Fix warnings caused by discarding const.Alfred Perlstein2002-02-271-1/+2
| | | | | | | Hairy Eyeball At: peter Notes: svn path=/head/; revision=91346
* Corrected an argument to in6_pcbnotify().Hajimu UMEMOTO2002-02-041-2/+3
| | | | | | | | Obtained from: KAME MFC after: 1 week Notes: svn path=/head/; revision=90199
* o Replace reference to 'struct proc' with 'struct thread' in 'structRobert Watson2001-11-081-1/+1
| | | | | | | | | | | | | | | | | | sysctl_req', which describes in-progress sysctl requests. This permits sysctl handlers to have access to the current thread, permitting work on implementing td->td_ucred, migration of suser() to using struct thread to derive the appropriate ucred, and allowing struct thread to be passed down to other code, such as network code where td is not currently available (and curproc is used). o Note: netncp and netsmb are not updated to reflect this change, as they are not currently KSE-adapted. Reviewed by: julian Obtained from: TrustedBSD Project Notes: svn path=/head/; revision=86183
* Make faith loadable, unloadable, and clonable.Brooks Davis2001-09-251-8/+1
| | | | Notes: svn path=/head/; revision=83934
* KSE Milestone 2Julian Elischer2001-09-121-11/+11
| | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=83366
* move ipsec security policy allocation into in_pcballoc, beforeHajimu UMEMOTO2001-07-261-7/+0
| | | | | | | | | | | making pcbs available to the outside world. otherwise, we will see inpcb without ipsec security policy attached (-> panic() in ipsec.c). Obtained from: KAME MFC after: 3 days Notes: svn path=/head/; revision=80406
* Sync with recent KAME.Hajimu UMEMOTO2001-06-111-50/+40
| | | | | | | | | | | | | | | | | | | | | 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 Notes: svn path=/head/; revision=78064
* Switch to using a struct xucred instead of a struct xucred when notBrian Feldman2001-02-181-5/+9
| | | | | | | | | | | | | | | | | | | | actually in the kernel. This structure is a different size than what is currently in -CURRENT, but should hopefully be the last time any application breakage is caused there. As soon as any major inconveniences are removed, the definition of the in-kernel struct ucred should be conditionalized upon defined(_KERNEL). This also changes struct export_args to remove dependency on the constantly-changing struct ucred, as well as limiting the bounds of the size fields to the correct size. This means: a) mountd and friends won't break all the time, b) mountd and friends won't crash the kernel all the time if they don't know what they're doing wrt actual struct export_args layout. Reviewed by: bde Notes: svn path=/head/; revision=72650
* be careful on mbuf overrun on ctlinput.Jun-ichiro itojun Hagino2000-10-231-1/+5
| | | | | | | | short icmp6 packet may be able to panic the kernel. sync with kame. Notes: svn path=/head/; revision=67456
* sync with kame tree as of july00. tons of bug fixes/improvements.Jun-ichiro itojun Hagino2000-07-041-129/+49
| | | | | | | | | | API changes: - additional IPv6 ioctls - IPsec PF_KEY API was changed, it is mandatory to upgrade setkey(8). (also syntax change) Notes: svn path=/head/; revision=62587
* Previous commit changing SYSCTL_HANDLER_ARGS violated KNF.Poul-Henning Kamp2000-07-041-1/+1
| | | | | | | Pointed out by: bde Notes: svn path=/head/; revision=62573
* Style police catches up with rev 1.26 of src/sys/sys/sysctl.h:Poul-Henning Kamp2000-07-031-1/+1
| | | | | | | | | | | Sanitize SYSCTL_HANDLER_ARGS so that simplistic tools can grog our sources: -sysctl_vm_zone SYSCTL_HANDLER_ARGS +sysctl_vm_zone (SYSCTL_HANDLER_ARGS) Notes: svn path=/head/; revision=62454
* correct bad TTL with packets generated by v4 mapped udp. from kameJun-ichiro itojun Hagino2000-06-221-0/+7
| | | | Notes: svn path=/head/; revision=61958
* Remove ~25 unneeded #include <sys/conf.h>Poul-Henning Kamp2000-04-191-1/+0
| | | | | | | Remove ~60 unneeded #include <sys/malloc.h> Notes: svn path=/head/; revision=59391
* Support per socket based IPv4 mapped IPv6 addr enable/disable control.Yoshinobu Inoue2000-04-011-3/+3
| | | | | | | Submitted by: ume Notes: svn path=/head/; revision=58907
* Merge a bug fix from freebsd-current; check m != NULL before touching it,Yoshinobu Inoue2000-01-181-1/+1
| | | | | | | | | | at udp6_ctlinput(). There should be kernel panic at PCCARD suspend etc, before this bug fix. Submitted by: Hajimu UMEMOTO <ume@mahoroba.org> Notes: svn path=/head/; revision=56228
* tcp updates to support IPv6.Yoshinobu Inoue2000-01-091-11/+2
| | | | | | | | | | also a small patch to sys/nfs/nfs_socket.c, as max_hdr size change. Reviewed by: freebsd-arch, cvs-committers Obtained from: KAME project Notes: svn path=/head/; revision=55679
* IPSEC support in the kernel.Yoshinobu Inoue1999-12-221-9/+13
| | | | | | | | | | | pr_input() routines prototype is also changed to support IPSEC and IPV6 chained protocol headers. Reviewed by: freebsd-arch, cvs-committers Obtained from: KAME project Notes: svn path=/head/; revision=55009
* Change incorrect NULLs to 0sEivind Eklund1999-12-211-4/+5
| | | | Notes: svn path=/head/; revision=54952
* M_PREPEND-related cleanups (unregisterifying struct mbuf *s).Brian Feldman1999-12-191-1/+1
| | | | Notes: svn path=/head/; revision=54799
* udp IPv6 support, IPv6/IPv4 tunneling support in kernel,Yoshinobu Inoue1999-12-071-0/+835
packet divert at kernel for IPv6/IPv4 translater daemon This includes queue related patch submitted by jburkhol@home.com. Submitted by: queue related patch from jburkhol@home.com Reviewed by: freebsd-arch, cvs-committers Obtained from: KAME project Notes: svn path=/head/; revision=54263