summaryrefslogtreecommitdiffstats
path: root/sys/netgraph
Commit message (Collapse)AuthorAgeFilesLines
* Lock down a socket, milestone 1.tanimura2002-05-202-11/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* Add a NGM_PPPOE_SESSIONID message to the ng_pppoe node.brian2002-05-142-1/+21
| | | | | | | This message is sent to the control socket when the SessionID is established. Approved by: archie (after a very cursory glance)
* Don't send packets out an interface unless it is IFF_UP|IFF_RUNNING.archie2002-05-091-2/+10
| | | | | | | This fixes panics with certain Ethernet drivers when doing bridging, PPPoE, etc. before the driver has been fully brought up. MFC after: 1 week
* Revert the change of #includes in sys/filedesc.h and sys/socketvar.h.tanimura2002-04-301-3/+5
| | | | | | | | | | 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.
* Use 'struct callout' instead of 'struct callout_handle' to avoidarchie2002-04-141-25/+81
| | | | | | | | | | | exhausting the kernel timeout table. Perform the usual gymnastics to avoid race conditions between node shutdown and timeouts occurring. Also fix a bug in handling ack delays < PPTP_MIN_ACK_DELAY. Before, we were ack'ing immediately. Instead, just impose a minimum ack delay time, like the name of the macro implies. MFC after: 1 week
* Change callers of mtx_init() to pass in an appropriate lock type name. Injhb2002-04-041-6/+6
| | | | | | | most cases NULL is passed, but in some cases such as network driver locks (which use the MTX_NETWORK_LOCK macro) and UMA zone locks, a name is used. Tested on: i386, alpha, sparc64
* Change the suser() API to take advantage of td_ucred as well as do ajhb2002-04-012-2/+2
| | | | | | | | | | | | 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@
* Fix bugs where the ng_ppp node could transmit PPP frames whose lengtharchie2002-03-151-4/+18
| | | | | | exceeded the peer's configured MRU or MRRU. MFC after: 1 week
* Official timeout routines for netgraph nodes that know how tojulian2002-03-052-0/+66
| | | | | | use (and abuse) the node locking system. MFC after: 1 week
* Simple p_ucred -> td_ucred changes to start using the per-thread ucredjhb2002-02-271-1/+1
| | | | reference.
* Send a NGM_PPPOE_ACNAME message to userland when a node is connected.brian2002-02-202-2/+25
| | | | | | Submitted by: Andre Albsmeier <andre@albsmeier.net> Shuffled about by: brian Approved by: julian
* o Move NTOHL() and associated macros into <sys/param.h>. These aremike2002-02-181-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | deprecated in favor of the POSIX-defined lowercase variants. o Change all occurrences of NTOHL() and associated marcros in the source tree to use the lowercase function variants. o Add missing license bits to sparc64's <machine/endian.h>. Approved by: jake o Clean up <machine/endian.h> files. o Remove unused __uint16_swap_uint32() from i386's <machine/endian.h>. o Remove prototypes for non-existent bswapXX() functions. o Include <machine/endian.h> in <arpa/inet.h> to define the POSIX-required ntohl() family of functions. o Do similar things to expose the ntohl() family in libstand, <netinet/in.h>, and <sys/param.h>. o Prepend underscores to the ntohl() family to help deal with complexities associated with having MD (asm and inline) versions, and having to prevent exposure of these functions in other headers that happen to make use of endian-specific defines. o Create weak aliases to the canonical function name to help deal with third-party software forgetting to include an appropriate header. o Remove some now unneeded pollution from <sys/types.h>. o Add missing <arpa/inet.h> includes in userland. Tested on: alpha, i386 Reviewed by: bde, jake, tmm
* Fix another bug in handling of multi-link sequence numbers.archie2002-02-131-3/+4
| | | | MFC after: 1 week
* Fix bug in previous commit.archie2002-02-121-2/+1
| | | | Submitted by: Harti Brandt <brandt@fokus.gmd.de>
* Pre-KSE/M3 commit.julian2002-02-071-3/+3
| | | | | | | | | | this is a low-functionality change that changes the kernel to access the main thread of a process via the linked list of threads rather than assuming that it is embedded in the process. It IS still embeded there but remove all teh code that assumes that in preparation for the next commit which will actually move it out. Reviewed by: peter@freebsd.org, gallatin@cs.duke.edu, benno rice,
* The hardware checksum code makes the assumption that a packet routed outarchie2002-02-051-2/+9
| | | | | | | | | | | | a particular Ethernet interface will actually be delivered by (only) that device driver. This is not necessarily true when ng_ether(4) is used. To word around this, while a ng_ether(4)'s "upper" hook is connected, turn off all hardware checksum, fragmentation, etc., features for that interface. PR: kern/31586 MFC after: 1 week
* Get rid of the twisted MFREE() macro entirely.dillon2002-02-052-9/+3
| | | | | Reviewed by: dg, bmilekic MFC after: 3 days
* Some netgraph parse types (such as for the 'value' field in ng_ksocket'sarchie2002-02-011-8/+15
| | | | | | | | 'struct ng_ksocket_sockopt') like to peek into the ng_mesg header for information. Make sure when generating default values that we provide a valid header to peek into. MFC after: 1 week
* Replace ffind_* with fget calls.alfred2002-01-141-3/+2
| | | | | | | | Make fget MPsafe. Make fgetvp and fgetsock use the fget subsystem to reduce code bloat. Push giant down in fpathconf().
* SMP Lock struct file, filedesc and the global file list.alfred2002-01-131-4/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Seigo Tanimura (tanimura) posted the initial delta. I've polished it quite a bit reducing the need for locking and adapting it for KSE. Locks: 1 mutex in each filedesc protects all the fields. protects "struct file" initialization, while a struct file is being changed from &badfileops -> &pipeops or something the filedesc should be locked. 1 mutex in each struct file protects the refcount fields. doesn't protect anything else. the flags used for garbage collection have been moved to f_gcflag which was the FILLER short, this doesn't need locking because the garbage collection is a single threaded container. could likely be made to use a pool mutex. 1 sx lock for the global filelist. struct file * fhold(struct file *fp); /* increments reference count on a file */ struct file * fhold_locked(struct file *fp); /* like fhold but expects file to locked */ struct file * ffind_hold(struct thread *, int fd); /* finds the struct file in thread, adds one reference and returns it unlocked */ struct file * ffind_lock(struct thread *, int fd); /* ffind_hold, but returns file locked */ I still have to smp-safe the fget cruft, I'll get to that asap.
* Staticise the socket list.msmith2002-01-081-1/+1
|
* Avoid reentrantly sending on the same socket, which causes a kernel panic.archie2002-01-061-0/+9
|
* o Make the credential used by socreate() an explicit argument torwatson2001-12-311-1/+2
| | | | | | | | | | | | | | socreate(), rather than getting it implicitly from the thread argument. o Make NFS cache the credential provided at mount-time, and use the cached credential (nfsmount->nm_cred) when making calls to socreate() on initially connecting, or reconnecting the socket. This fixes bugs involving NFS over TCP and ipfw uid/gid rules, as well as bugs involving NFS and mandatory access control implementations. Reviewed by: freebsd-arch
* Typo.archie2001-12-151-1/+1
|
* Don't free a structure containing a 'struct callout' structure while thatarchie2001-12-151-8/+17
| | | | | | callout is still pending. MFC after: 3 days
* Add support for 56 bit MPPE encryption.archie2001-12-152-9/+12
| | | | MFC after: 3 days
* Update to C99, s/__FUNCTION__/__func__/,obrien2001-12-1024-101/+101
| | | | also don't use ANSI string concatenation.
* When a socket is not connected, allow the peer "struct sockaddr"archie2001-11-282-13/+77
| | | | | | | | to be included in the meta information that is associated with incoming and outgoing packets. Reviewed by: julian MFC after: 1 week
* A node that allows ethernet type packets to be filtered to differentjulian2001-10-302-0/+588
| | | | | | | | hooks depending on ethertype. Great for prototyping protocols. connects to the lower and upper hooks of an ethernet type of node. Obtained from: Monzoon Networks. Thanks to Andre Oppermann, May 2001.
* log routine called w/ %ld and int argument, cast argument to longdillon2001-10-291-1/+1
|
* Fix bug that cheated hook names out of the last 2 bytes.archie2001-10-101-2/+2
| | | | MFC after: 3 days
* Let "raw" mean IPPROTO_RAW instead of IPPROTO_IP.archie2001-10-101-1/+1
| | | | | Noticed by: jdp MFC after: 3 days
* Hopefully improve control message passing over Unix domain sockets.dwmalone2001-10-041-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 1) Allow the sending of more than one control message at a time over a unix domain socket. This should cover the PR 29499. 2) This requires that unp_{ex,in}ternalize and unp_scan understand mbufs with more than one control message at a time. 3) Internalize and externalize used to work on the mbuf in-place. This made life quite complicated and the code for sizeof(int) < sizeof(file *) could end up doing the wrong thing. The patch always create a new mbuf/cluster now. This resulted in the change of the prototype for the domain externalise function. 4) You can now send SCM_TIMESTAMP messages. 5) Always use CMSG_DATA(cm) to determine the start where the data in unp_{ex,in}ternalize. It was using ((struct cmsghdr *)cm + 1) in some places, which gives the wrong alignment on the alpha. (NetBSD made this fix some time ago). This results in an ABI change for discriptor passing and creds passing on the alpha. (Probably on the IA64 and Spare ports too). 6) Fix userland programs to use CMSG_* macros too. 7) Be more careful about freeing mbufs containing (file *)s. This is made possible by the prototype change of externalise. PR: 29499 MFC after: 6 weeks
* Fixed pedantic syntax error (trailing semicolon in enum).bde2001-10-041-1/+1
|
* Remove a couple unintentional mentions of Ethernet that crept in frombrooks2001-09-281-2/+2
| | | | ng_ether.c.
* Add ng_ip_input. A new netgraph node for queuing IP packets into thebrooks2001-09-272-0/+217
| | | | main IP input processing code.
* The initial commit contained an error in the license, this is thebrooks2001-09-274-9/+21
| | | | correct one.
* /home/brooks/ng_gif.messagebrooks2001-09-264-0/+1122
|
* KSE Milestone 2julian2001-09-127-28/+50
| | | | | | | | | | | | | | 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
* First pass at porting John's "accept" changes tojulian2001-09-072-49/+383
| | | | | | | | | | | | allow an in-kernel webserver (or similar) to accept and handle incoming connections using netgraph without ever leaving the kernel. (allows incoming tunnel requests to be handled totally within the kernel for example) Needs work, but shouldn't break existing functionality. Submitted by: John Polstra <jdp@polstra.com> MFC after: 2 weeks
* MFS: change name of sysctl to something more diplomatic.julian2001-09-041-9/+9
|
* Fix kernel crash when VLANs are combined with ng_ether(4), by attachingarchie2001-08-301-1/+2
| | | | | | interfaces of type IFT_L2VLAN as well as IFT_ETHER during module load. Submitted by: yar
* Fix two typosbrian2001-08-211-2/+2
|
* Pack struct uniqtag declarations to stop our data field from being pushedbrian2001-08-021-2/+2
| | | | | | | 4 bytes to the right on the alpha. Tested by: Thomas Pornin <Thomas.Pornin@ens.fr> MFC after: 1 week
* If an attempt is made to LISTEN for a service tag that's already beingbrian2001-07-251-14/+28
| | | | | | | | | | | | | LISTENed for, return EEXISTS. Only match the magic "*" service tag if no other LISTEN service tags match. Require an explicit LISTEN for an empty service tag in order to match empty service requests. Approved by: julian MFC after: 3 days
* General cleanup providing better style(9) conformance and generallybrooks2001-07-242-91/+47
| | | | | | | | | | improved readability. The two real functional changes are that netgraph now sees this as the "split" node type rather then the "ng_split" node type and that meta data is passed through without processing rather then being dropped. Reviewed by: jhb, julian MFC after: 7 weeks
* Add an external function to unlink a netgraph type from the types list.julian2001-07-232-0/+21
|
* remember to set the return address in a message whenjulian2001-07-141-0/+1
| | | | | | | | | sending it along a hook. PR: 27906 Submitted by: Harti Brandt <brandt@fokus.gmd.de> no MFC as code is different in 4.x
* Fix warning: (int/long mixup in printf)peter2001-06-151-1/+1
| | | | 475: warning: unsigned int format, long unsigned int arg (arg 3)
* Fix a range checking bug in ng_int32_parse which affected 64-bitjdp2001-05-191-4/+5
| | | | | | | | | | | | | | | | | | | | | machines. The code formerly read: long val; if (val < (long)-0x80000000 || ...) return EINVAL; The constant 0x80000000 has type unsigned int. The unary `-' operator does not change the type (or the value, in this case). Therefore the promotion to long is done by 0-extension, giving 0x0000000080000000 instead of the desired 0xffffffff80000000. I got rid of the `-' and changed the cast to (int32_t) to give proper sign-extension on all architectures and to better reflect the fact that we are range-checking a 32-bit value. This commit also makes the analogous changes to ng_int{8,16}_parse for consistency. MFC after: 3 days
OpenPOWER on IntegriCloud