History log of /freebsd-9.3-release/sys/netatalk/at_control.c
Revision Date Author Comments
(<<< Hide modified files)
(Show modified files >>>)
# 267654 19-Jun-2014 gjb

Copy stable/9 to releng/9.3 as part of the 9.3-RELEASE cycle.

Approved by: re (implicit)
Sponsored by: The FreeBSD Foundation

# 233200 19-Mar-2012 jhb

MFC 229621:
Convert all users of IF_ADDR_LOCK to use new locking macros that specify
either a read lock or write lock.


# 225736 22-Sep-2011 kensmith

Copy head to stable/9 as part of 9.0-RELEASE release cycle.

Approved by: re (implicit)


# 196121 12-Aug-2009 rwatson

Reverse misordered unlock and lock in at_control for netatalk phase I
addresses.

Submitted by: Russell Cattelan <cattelan at thebarn.com>
Approved by: re (kib)


# 194913 24-Jun-2009 rwatson

Use queue(9) instead of hand-crafted link lists for the global netatalk
address list. Generally follow the style and convention of similar parts
in netinet.

MFC after: 6 weeks


# 194822 24-Jun-2009 rwatson

Printf fewer warnings when adding a route to an atalk address fails;
userspace will print the error.

MFC after: 3 days


# 194819 24-Jun-2009 rwatson

Break at_ifawithnet() into two variants:

- at_ifawithnet(), which acquires an locks it needs and returns an
at_ifaddr reference.
- at_ifawithnet_locked(), which relies on the caller locking
at_ifaddr_list, and returns a pointer rather than a reference.

Update various consumers to prefer one or the other, including ether
and fddi output, to properly release at_ifaddr references.

Rework at_control() to manage locking and references in a manner
identical to in_control().

MFC after: 6 weeks


# 194619 22-Jun-2009 rwatson

Add a global rwlock, at_ifaddr_rw, to protect the global netatalk
address lists, at_ifaddr_list. Acquire the lock, and use ifaddr
refcounts where necessary, to close most known address-related
races in netatalk.

Annotate one potential race in at_control() where we acquire an
ifaddr reference, drop the global lock, and scrub the address from
the ifnet before re-acquiring the global lock, which could allow
for a writer-writer race.

MFC after: 3 weeks


# 194602 21-Jun-2009 rwatson

Clean up common ifaddr management:

- 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


# 191281 19-Apr-2009 rwatson

Lock interface address list lock around ifaddr inserts and deletes
in at_control(). This locking is not yet complete but should prevent
some classes of race conditions.

MFC after: 2 weeks


# 166833 19-Feb-2007 rwatson

Use privilege PRIV_NET_ADDIFADDR rather than suser() to authorize
adding a netatalk address to an interface.


# 164033 06-Nov-2006 rwatson

Sweep kernel replacing suser(9) calls with priv(9) calls, assigning
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>


# 142226 22-Feb-2005 rwatson

Convert the aa_ifaddr timeout to a callout, and run the aarprobe callout
MPSAFE. Acquire the aarptab_mtx to make sure that the callout and msleep
in the ioctl thread don't race.

MFC after: 1 week


# 139827 07-Jan-2005 imp

/* -> /*- for license, minor formatting changes, insert COPYRIGHT into files


# 132411 19-Jul-2004 rwatson

Further function forward declaration white space tweaks.


# 132410 19-Jul-2004 rwatson

Re-style at_control.c to bring it closer to style(9), primarily with
regard to function prototypes and indentation. The lack of indentation
in if clauses and case statements made this code extremely difficult
to read.


# 132009 12-Jul-2004 rwatson

Remove spl's from netatalk in preparation to merge locking.


# 127292 22-Mar-2004 rwatson

Rename 'at_ifaddr' list to 'at_ifaddr_list' so that the variable is
more easily mechanically distinguished from 'struct at_ifaddr'.


# 127291 22-Mar-2004 rwatson

Compare pointers with NULL rather than 0, or treating them as boolans in
if statements.

at_rmx gets a $FreeBSD$ out of the deal also (this code appears to be
unused).


# 127288 22-Mar-2004 rwatson

Since I have my hands all over netatalk adding locking and restructuring
it, cinch the file's style closer to style(9) with regard to parenthesis:

s/( /(/g
s/ )/)/g
s/return(/return (/g
s/return 0/return (0)/
s/return 1/return (1)/


# 127255 21-Mar-2004 rwatson

Spell "(struct foo *)0" as "NULL".


# 123018 28-Nov-2003 sam

Eliminate a duplicate free when deleting an interface address. This
caused crashes, typically during shutdown, because the second free
referenced a mutex that had been destroyed.

Tested by: several
Approved by: re (scottl)


# 111119 19-Feb-2003 imp

Back out M_* changes, per decision of the TRB.

Approved by: trb


# 109623 21-Jan-2003 alfred

Remove M_TRYWAIT/M_WAITOK/M_WAIT. Callers should use 0.
Merge M_NOWAIT/M_DONTWAIT into a single flag M_NOWAIT.


# 108033 18-Dec-2002 hsu

Lock up ifaddr reference counts.


# 93593 01-Apr-2002 jhb

Change the suser() API to take advantage of td_ucred as well as do a
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@


# 83366 12-Sep-2001 julian

KSE Milestone 2
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


# 69781 08-Dec-2000 dwmalone

Convert more malloc+bzero to malloc+M_ZERO.

Submitted by: josh@zipperup.org
Submitted by: Robert Drehmel <robd@gmx.net>


# 67893 29-Oct-2000 phk

Move suser() and suser_xxx() prototypes and a related #define from
<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>.


# 46112 27-Apr-1999 phk

Suser() simplification:

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.


# 43305 27-Jan-1999 dillon

Fix warnings in preparation for adding -Wall -Wcast-qual to the
kernel compile


# 37965 30-Jul-1998 alex

Typo fix: teh --> (the|they)


# 36735 07-Jun-1998 dfr

This commit fixes various 64bit portability problems required for
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.


# 35256 17-Apr-1998 des

Seventy-odd "its" / "it's" typos in comments fixed as per kern/6108.


# 34961 30-Mar-1998 phk

Eradicate the variable "time" from the kernel, using various measures.
"time" wasn't a atomic variable, so splfoo() protection were needed
around any access to it, unless you just wanted the seconds part.

Most uses of time.tv_sec now uses the new variable time_second instead.

gettime() changed to getmicrotime(0.

Remove a couple of unneeded splfoo() protections, the new getmicrotime()
is atomic, (until Bruce sets a breakpoint in it).

A couple of places needed random data, so use read_random() instead
of mucking about with time which isn't random.

Add a new nfs_curusec() function.

Mark a couple of bogosities involving the now disappeard time variable.

Update ffs_update() to avoid the weird "== &time" checks, by fixing the
one remaining call that passwd &time as args.

Change profiling in ncr.c to use ticks instead of time. Resolution is
the same.

Add new function "tvtohz()" to avoid the bogus "splfoo(), add time, call
hzto() which subtracts time" sequences.

Reviewed by: bde


# 30822 28-Oct-1997 julian

Fix various problems with netatalk kernel support.
Some of these changes are a bit rough and will become
more polished later. the changes to if_ethersubr should largely be moved
to within the appletalk code, but that will happen later.
A few of these were related to network-byteorder problems,
and more were related to loopback failures.


# 29681 21-Sep-1997 gibbs

Update for new callout interface.


# 29188 07-Sep-1997 bde

Removed unused #includes.


# 29182 07-Sep-1997 bde

Fixed sloppy common-style declarations.


# 29024 01-Sep-1997 bde

Added used #include - don't depend on <sys/mbuf.h> including
<sys/malloc.h> (unless we only use the bogusly shared M*WAIT flags).


# 28845 27-Aug-1997 julian

Add a per-interface-address pointer to a function that can be supplied
by a protocol, to detirmine if an address matches the net this address
is part of. This is needed by protocols for which netmasks
"just don't work", for example appletalk.

Also add the code in appletalk to make use of this new feature.
Thsi fixes one of the longest standing bugs in appletalk.
The inability to talk to machines to which the path is via a router
which is on a different net, but the same netrange, as your interface.
Protocols that do not supply this function (e.g. IP) should not be affected.


# 25791 13-May-1997 julian

First cut at patches to make appletalk compile again
after the dissapearance of the USRREQ() entrypoint.


# 25047 20-Apr-1997 bde

Fixed the type of timeout functions and removed casts that hid the
type mismatches. There was no problem in practice (at least on 386's).


# 24204 24-Mar-1997 bde

Don't include <sys/ioctl.h> in the kernel. Stage 2: include
<sys/sockio.h> instead of <sys/ioctl.h> in network files.


# 20407 13-Dec-1996 wollman

Convert the interface address and IP interface address structures
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).


# 18244 11-Sep-1996 julian

bzero the entire at_ifaddr struct we malloc, not just the first part of it..


# 18240 11-Sep-1996 julian

chnages to bring atlak a bit more into the BSD4.4 world and to
(more) properly keep track of the allocation and freeing of
interface address structures.


# 18207 10-Sep-1996 bde

Updated #includes to 4.4Lite style.


# 18005 03-Sep-1996 julian

allow a new loopback route to overwrite an old one..
this allows the atalkd to be restarted.. a better fix will come later.


# 17967 31-Aug-1996 julian

wow we can even make net ranges go away now (how sophisticated!)


# 17964 31-Aug-1996 julian

Add code to automaticall support subnets on ethertalk networks
Subnets are represented in the routing table as a set of
binary routing nets using the standard netmask algorythm.
The code produces the minimum possible set of standard netmasks and
net addresses to be able to represent a given netrange.


# 17921 29-Aug-1996 julian

Massively COMMENT at_control.c
and fix some bugs..
also fix a bug in aarp.c that didn't take netranges into account.
default routes now work with appletalk, which is a poor-man's
way of being able to access netranges if you only have one network :)

Hopefully the full netranges fix will happen soon.


# 17661 19-Aug-1996 julian

fix a broken atalk stack..
the lat commits (3 weeks ago ) broke this, and I'm only now getting
complaints.. oops!


# 17265 23-Jul-1996 julian

Submitted by: archie@whistle.com

slight cleanups on yesterday's patches


# 17254 22-Jul-1996 julian

Submitted by: archie@whistle.com

appletalk cleanups


# 15885 23-May-1996 julian

Obtained from: netatalk distribution netatalk@itd.umich.edu

Kernel Appletalk protocol support
both CAP and netatalk can make use of this..
still needs some owrk but it seemd the right tiime to commit it
so other can experiment.