freebsd-skq/sys/netipx
Robert Watson 8c0fec805f Modify most routines returning 'struct ifaddr *' to return references
rather than pointers, requiring callers to properly dispose of those
references.  The following routines now return references:

  ifaddr_byindex
  ifa_ifwithaddr
  ifa_ifwithbroadaddr
  ifa_ifwithdstaddr
  ifa_ifwithnet
  ifaof_ifpforaddr
  ifa_ifwithroute
  ifa_ifwithroute_fib
  rt_getifa
  rt_getifa_fib
  IFP_TO_IA
  ip_rtaddr
  in6_ifawithifp
  in6ifa_ifpforlinklocal
  in6ifa_ifpwithaddr
  in6_ifadd
  carp_iamatch6
  ip6_getdstifaddr

Remove unused macro which didn't have required referencing:

  IFP_TO_IA6

This closes many small races in which changes to interface
or address lists while an ifaddr was in use could lead to use of freed
memory (etc).  In a few cases, add missing if_addr_list locking
required to safely acquire references.

Because of a lack of deep copying support, we accept a race in which
an in6_ifaddr pointed to by mbuf tags and extracted with
ip6_getdstifaddr() doesn't hold a reference while in transmit.  Once
we have mbuf tag deep copy support, this can be fixed.

Reviewed by:	bz
Obtained from:	Apple, Inc. (portions)
MFC after:	6 weeks (portions)
2009-06-23 20:19:09 +00:00
..
ipx_cksum.c
ipx_if.h Introduce basic locking of global IPX address list 'ipx_ifaddr' using 2009-06-21 21:04:12 +00:00
ipx_input.c Include sys/lock.h before sys/rwlock.h. If anything used to bring it for us 2009-06-23 18:36:42 +00:00
ipx_outputfl.c Introduce basic locking of global IPX address list 'ipx_ifaddr' using 2009-06-21 21:04:12 +00:00
ipx_pcb.c Modify most routines returning 'struct ifaddr *' to return references 2009-06-23 20:19:09 +00:00
ipx_pcb.h
ipx_proto.c Add code to allow the system to handle multiple routing tables. 2008-05-09 23:03:00 +00:00
ipx_usrreq.c Implement socket delivery MAC checks for IPX/SPX. 2009-06-20 23:38:21 +00:00
ipx_var.h Remove unuxed ipx_zerohost. 2009-06-21 16:11:40 +00:00
ipx.c Add ipx_ifaddr locking to ipx_control(), which should close most 2009-06-21 21:42:29 +00:00
ipx.h Remove IPX over IP tunneling support, which allows IPX routing over IP 2007-06-13 14:01:43 +00:00
README Update copyright on netipx. 2009-06-21 16:11:26 +00:00
spx_debug.c Put the variable declarations for TCPDEBUG under #ifdef INET as well. 2009-06-10 09:28:50 +00:00
spx_debug.h Make tcpstates[] static, and make sure TCPSTATES is defined before 2007-07-30 11:06:42 +00:00
spx_reass.c Rework SPX segment reassembly, which was originally based on our TCP 2009-06-20 18:24:25 +00:00
spx_timer.h
spx_usrreq.c Implement socket delivery MAC checks for IPX/SPX. 2009-06-20 23:38:21 +00:00
spx_var.h Rework SPX segment reassembly, which was originally based on our TCP 2009-06-20 18:24:25 +00:00
spx.h Rework SPX segment reassembly, which was originally based on our TCP 2009-06-20 18:24:25 +00:00

$FreeBSD$

This protocol implements IPX/SPX over Ethernet_II frame type 0x8137.
Please note: the SPX implementation may require further work and testing
to insure proper operation.

Mike Mitchell, Network Engineer
AMTECH Systems Corporation, Technology and Manufacturing
8600 Jefferson Street, Albuquerque, New Mexico 87113 (505) 856-8000
supervisor@alb.asctmd.com

John Hay
Some Company
Some Address
jhay@mikom.csir.co.za

Adapted for multi-processor, multi-threaded network stack by Robert N. M.
Watson, Computer Laboratory, University of Cambridge.

--- Copyright Information ---
/*-

Copyright (c) 1984, 1985, 1986, 1987, 1993
The Regents of the University of California.  All rights reserved.

Modifications Copyright (c) 1995, Mike Mitchell
Modifications Copyright (c) 1995, John Hay
Modifications Copyright (c) 2004-2009 Robert N. M. Watson

*/

--- TODO ---

(1) netipx default socket buffer sizes are very small by contemporary
    standards, and should be increased following testing and measurement.

(2) SPX will free the PCB and socket buffer memory on close(), which means
    close() in effects terminates the transfer of any outstanding buffered
    but unsent data.  As with TCP, it should instead grab its own
    reference to the socket so that it is not released, as hold onto it
    until the data transfer is complete.