summaryrefslogtreecommitdiffstats
path: root/sys/netipx/ipx.c
Commit message (Collapse)AuthorAgeFilesLines
* Convert all users of IF_ADDR_LOCK to use new locking macros that specifyjhb2012-01-051-4/+4
| | | | | | | either a read lock or write lock. Reviewed by: bz MFC after: 2 weeks
* Use queue(9) instead of hand-crafted link lists for the global IPXrwatson2009-06-241-24/+12
| | | | | | | address list (ipx_ifaddr -> ipx_ifaddrhead), and generally adopt the naming and usage conventions found in netinet. MFC after: 6 weeks
* Rework locking and reference counting in ipx_control to be consistent withrwatson2009-06-241-58/+60
| | | | | | the model used in in_control(). MFC after: 6 weeks
* Add ipx_ifaddr locking to ipx_control(), which should close mostrwatson2009-06-211-27/+70
| | | | | | | | | | | | | | | remaining potential races in ifconfig's management of IPX addresses. This is largely accomplished by dropping a global write lock for the IPX address list over the body of in_control(), although there are some places we bump the refcount on an ifaddr of interest while calling out to the routing code or link layer code, which might require revisiting. Annotate one as a potential race if two simultaneous delete ioctls are issued for the same IPX addresses at once. MFC after: 3 weeks
* Introduce basic locking of global IPX address list 'ipx_ifaddr' usingrwatson2009-06-211-2/+7
| | | | | | | | | a new rwlock, ipx_ifaddr_rw, wrapped with macros. This locking is necessary but not sufficient, in isolation, to satisfy the stability requirements of a fully parallel IPX input path during interface reconfiguration. MFC after: 3 weeks
* In ipx_control(), lock if_addr_mtx when adding/removing addresses fromrwatson2009-06-211-3/+5
| | | | | | | interface address lists, and don't add an address until it's fully initialized. MFC after: 3 weeks
* Clean up common ifaddr management:rwatson2009-06-211-3/+2
| | | | | | | | | | | | | | - Unify reference count and lock initialization in a single function, ifa_init(). - Move tear-down from a macro (IFAFREE) to a function ifa_free(). - Move reference count bump from a macro (IFAREF) to a function ifa_ref(). - Instead of using a u_int protected by a mutex to refcount(9) for reference count management. The ifa_mtx is now used for exactly one ioctl, and possibly should be removed. MFC after: 3 weeks
* Minor style cleanups.rwatson2009-06-211-24/+25
| | | | MFC after: 3 days
* Remove the suser(9) interface from the kernel. It has been replaced fromattilio2008-09-171-4/+11
| | | | | | | | | | | | | | | | | years by the priv_check(9) interface and just very few places are left. Note that compatibility stub with older FreeBSD version (all above the 8 limit though) are left in order to reduce diffs against old versions. It is responsibility of the maintainers for any module, if they think it is the case, to axe out such cases. This patch breaks KPI so __FreeBSD_version will be bumped into a later commit. This patch needs to be credited 50-50 with rwatson@ as he found time to explain me how the priv_check() works in detail and to review patches. Tested by: Giovanni Trematerra <giovanni dot trematerra at gmail dot com> Reviewed by: rwatson
* Include priv.h to pick up suser(9) definitions, missed in an earlierrwatson2007-06-131-0/+1
| | | | | | commit. Warnings spotted by: kris
* Use ANSI C function declarations throughout netipx.rwatson2007-05-111-26/+16
| | | | Remove 'register' use.
* Factor out UCB and my copyrights from copyrights of Mike Mitchell;rwatson2007-01-081-1/+26
| | | | | | | the former use a three-clause BSD license (per UCB authorization letter), whereas he uses a four-clause BSD license. MFC after: 3 days
* Recent changes have locked down most of the highly dynamic datarwatson2005-01-091-2/+0
| | | | | | | | | | | | | | structures in IPX/SPX -- primarily, sequence numbering, PCB lists, and PCBs for IPX raw sockets, IPX datagram sockets, and IPX/SPX. As such, remove remove NET_NEEDS_GIANT() for IPX, and remove the assertion of Giant in the ipxintr() IPX input path. Note that IPX/SPX is not fully MPSAFE, and that there are some problems with IPX/SPX locking that will require some further work. However, it is now safe enough to run in general without the Giant lock. MFC after: 4 weeks
* /* -> /*- for license, minor formatting changesimp2005-01-071-1/+1
|
* Trim trailing whitespace.rwatson2005-01-021-3/+3
|
* Mark Netgraph TTY, KAME IPSEC, and IPX/SPX as requiring Giant for correctrwatson2004-08-281-0/+6
| | | | | | | operation using NET_NEEDS_GIANT(). This will result in a boot-time restoration of Giant-enabled network operation, or run-time warning on dynamic load (applicable only to the Netgraph component). Additional components will likely need to be marked with this in the future.
* Use __FBSDID().obrien2003-06-111-2/+3
|
* Allocate struct ipx_ifaddrs with an initial reference count of 1, not 0.tjr2003-02-251-0/+1
| | | | | The wrong reference count was causing them to get freed too early and have their contents scrambled.
* Back out M_* changes, per decision of the TRB.imp2003-02-191-1/+1
| | | | Approved by: trb
* add forgotten IFA_LOCK_INITfjoe2003-01-231-0/+1
|
* Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.alfred2003-01-211-1/+1
| | | | Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.
* 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@
* 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
* Convert more malloc+bzero to malloc+M_ZERO.dwmalone2000-12-081-2/+2
| | | | | Submitted by: josh@zipperup.org Submitted by: Robert Drehmel <robd@gmx.net>
* 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>.
* $Id$ -> $FreeBSD$peter1999-08-281-1/+1
|
* Suser() simplification:phk1999-04-271-2/+2
| | | | | | | | | | | | | | | | | | | 1: s/suser/suser_xxx/ 2: Add new function: suser(struct proc *), prototyped in <sys/proc.h>. 3: s/suser_xxx(\([a-zA-Z0-9_]*\)->p_ucred, \&\1->p_acflag)/suser(\1)/ The remaining suser_xxx() calls will be scrutinized and dealt with later. There may be some unneeded #include <sys/cred.h>, but they are left as an exercise for Bruce. More changes to the suser() API will come along with the "jail" code.
* Back out last change; there was 'fixup' code for the case later.eivind1998-12-091-1/+1
| | | | Noticed by: bde
* Better error checking.eivind1998-12-081-2/+2
|
* Examine all occurrences of sprintf(), strcat(), and str[n]cpy()archie1998-12-041-5/+5
| | | | | | | | | | | | | | for possible buffer overflow problems. Replaced most sprintf()'s with snprintf(); for others cases, added terminating NUL bytes where appropriate, replaced constants like "16" with sizeof(), etc. These changes include several bug fixes, but most changes are for maintainability's sake. Any instance where it wasn't "immediately obvious" that a buffer overflow could not occur was made safer. Reviewed by: Bruce Evans <bde@zeta.org.au> Reviewed by: Matthew Dillon <dillon@apollo.backplane.com> Reviewed by: Mike Spengler <mks@networkcs.com>
* This commit fixes various 64bit portability problems required fordfr1998-06-071-2/+2
| | | | | | | | | | FreeBSD/alpha. The most significant item is to change the command argument to ioctl functions from int to u_long. This change brings us inline with various other BSD versions. Driver writers may like to use (__FreeBSD_version == 300003) to detect this change. The prototype FreeBSD/alpha machdep will follow in a couple of days time.
* Removed the #ifdef IPXERRORMSGS'ed code. Fix a lot of style errors that Ijhay1997-06-261-6/+63
| | | | | introduced with the previous commit. Style fixes Submitted by: Bruce Evans <bde@FreeBSD.ORG>
* Mega IPX commit.jhay1997-05-101-61/+34
| | | | | | | | | | | | | | | | | | | | | | | | | | Use the MAC address of an interface for the host part of an IPX address and not the MAC address of the first interface for every IPX address. This is more inline with the way others like Novell do it. Mostly Submitted by: "Serge A. Babkin" <babkin@hq.icb.chel.su> Take out the error messages (the ip icmp equivalent) with #ifdef IPXERRORMSGS. This is bogus and as far as I could figure out IPX don't have anything like it. This is a leftover from its XNS heritage. If nobody complains, I will take it out completely in a few weeks. Add some more ipxstat statistics counters. Make ipxprintfs a sysctl variable and off by default. Add IPX Netbios "routing" support. This is off by default and can be switched on with a sysctl knob. General code cleanup to at least use the same style throughout the IPX code, but also be more style(9) conformant. Also make a lot of functions static. If I don't get any complaints I'll bring all of this over to the 2.2 tree in a few weeks.
* Make ipx compile again after the network interface changes.jhay1997-05-011-4/+6
|
* Don't include <sys/ioctl.h> in the kernel. Stage 2: includebde1997-03-241-2/+2
| | | | <sys/sockio.h> instead of <sys/ioctl.h> in network files.
* Back out part 1 of the MCFH that changed $Id$ to $FreeBSD$. We are notpeter1997-02-221-1/+1
| | | | ready for it yet.
* Make the long-awaited change from $Id$ to $FreeBSD$jkh1997-01-141-1/+1
| | | | | | | | This will make a number of things easier in the future, as well as (finally!) avoiding the Id-smashing problem which has plagued developers for so long. Boy, I'm glad we're not using sup anymore. This update would have been insane otherwise.
* Convert the interface address and IP interface address structureswollman1996-12-131-23/+8
| | | | | | to TAILQs. Fix places which referenced these for no good reason that I can see (the references remain, but were fixed to compile again; they are still questionable).
* Move or add #include <queue.h> in preparation for upcoming struct socketdg1996-03-111-1/+2
| | | | changes.
* Suggested by: bdejulian1995-11-041-1/+3
| | | | clear up some confusion about Id: lines on behalf of the author
* Submitted by: Mike Mitchell (mitchell@ref.tfs.com)julian1995-10-311-1/+1
| | | | | these patches bring the ipx code up to the point that it compiles cleanly with the -W arguments suggested by bruce.
* Reviewed by: julian and jhay@mikom.csir.co.zajulian1995-10-261-0/+372
Submitted by: Mike Mitchell, supervisor@alb.asctmd.com This is a bulk mport of Mike's IPX/SPX protocol stacks and all the related gunf that goes with it.. it is not guaranteed to work 100% correctly at this time but as we had several people trying to work on it I figured it would be better to get it checked in so they could all get teh same thing to work on.. Mikes been using it for a year or so but on 2.0 more changes and stuff will be merged in from other developers now that this is in. Mike Mitchell, Network Engineer AMTECH Systems Corporation, Technology and Manufacturing 8600 Jefferson Street, Albuquerque, New Mexico 87113 (505) 856-8000 supervisor@alb.asctmd.com
OpenPOWER on IntegriCloud