summaryrefslogtreecommitdiffstats
path: root/sys/net
Commit message (Collapse)AuthorAgeFilesLines
* Comment clarifying debug_mpsafenet.rwatson2004-07-181-4/+5
|
* Gratuitous whitespace change to un-wrap a short line.rwatson2004-07-181-2/+1
|
* Preparation commit for the tty cleanups that will follow in the nearphk2004-07-151-1/+1
| | | | | | | | | future: rename ttyopen() -> tty_open() and ttyclose() -> tty_close(). We need the ttyopen() and ttyclose() for the new generic cdevsw functions for tty devices in order to have consistent naming.
* Do a pass over all modules in the kernel and make them return EOPNOTSUPPphk2004-07-1512-3/+22
| | | | | | | | for unknown events. A number of modules return EINVAL in this instance, and I have left those alone for now and instead taught MOD_QUIESCE to accept this as "didn't do anything".
* Fix a copy-and-paste-o in IFQ_DRV_PREPEND - all pointyhats to me.mlaier2004-07-141-5/+5
| | | | | | | While here also fix a (not less stupid) braino in IFQ_DRV_PURGE. Reported-by: clement Tested-by: clement (_PREPEND in sis(4))
* Convert SLIP to using C99 structure initialization for its structrwatson2004-07-141-2/+8
| | | | linesw.
* Use ETHER_IS_MULTICAST() consistently in ether_resolvemulti().bms2004-07-091-1/+1
| | | | Reviewed by: jmallett
* Use M_ZERO instead of bzero().bms2004-07-061-2/+1
|
* Be consistent and use bzero() instead of memset().bms2004-07-061-1/+1
|
* Use M_ZERO instead of memset() (!).bms2004-07-061-2/+1
|
* Use M_ZERO instead of bzero().bms2004-07-061-2/+1
|
* Replace a bzero() after malloc() with M_ZERO.bms2004-07-061-2/+1
|
* Style.bms2004-07-061-13/+15
|
* In the BPF and ethernet bridging code, don't allow callouts to executerwatson2004-07-052-2/+2
| | | | without Giant if we're not debug.mpsafenet=1.
* Workaround a locking problem in vlan(4). vlan_setmulti() may be calledbms2004-07-041-2/+11
| | | | | | | | | | | | | with sleepable locks held from further up in the network stack, and attempts to allocate memory to hold multicast group membership information with M_WAITOK. This panic was triggered specifically when an exiting routing daemon process closes its raw sockets after joining multicast groups on them. While we're here, comment some possible locking badness. PR: kern/48560
* style(9)/whitespace cleanup while I'm in this file.bms2004-07-041-54/+55
|
* The net.link.ether.bridge.enable sysctl MIB variable enables bridgebms2004-07-041-0/+1
| | | | | | | | | | functionality by setting to a non-zero value. This is an integer, but is treated as a boolean by the code, so clamp it to a boolean value when set so as to avoid unnecessary bridge reinitialization if it's changed to another value. PR: kern/61174 Requested by: Bruce Cran
* Don't announce the ethernet address when it's 00:00:00:00:00:00. It'sbrooks2004-07-021-2/+7
| | | | | not of any interest. This primairly happens when vlan(4) interfaces are created.
* Bring in the first chunk of altq driver modifications. This covers themlaier2004-07-021-7/+30
| | | | | | | | | | | following drivers: bfe(4), em(4), fxp(4), lnc(4), tun(4), de(4) rl(4), sis(4) and xl(4) More patches are pending on: http://peoples.freebsd.org/~mlaier/ Please take a look and tell me if "your" driver is missing, so I can fix this. Tested-by: many No-objection: -current, -net
* Do not m_free packet since IF_HANDOFF (called from netisr_queue) willrik2004-06-281-1/+1
| | | | do it for us, just count it.
* Those are unneeded too.pjd2004-06-271-1/+0
|
* Add two missing includes and remove two uneeded.pjd2004-06-272-1/+2
| | | | | This is quite serious fix, because even with MAC framework compiled in, MAC entry points in those two files were simply ignored.
* Pick the hotchar out of the tty structure instead of caching privatephk2004-06-261-0/+1
| | | | | | | | copies. No current line disciplines have a dynamically changing hotchar, and expecting to receive anything sensible during a change in ldisc is insane so no locking of the hotchar field is necessary.
* Fix line discipline switching issues: If opening a new ldisc fails,phk2004-06-262-17/+4
| | | | | | | | | | | | | we have to revert to TTYDISC which we know will successfully open rather than try the previous ldisc which might also fail to open. Do not let ldisc implementations muck about with ->t_line, and remove code which checks for reopens, it should never happen. Move ldisc->l_hotchar to tty->t_hotchar and have ldisc implementation initialize it in their open routines. Reset to zero when we enter TTYDISC. ("no" should really be -1 since zero could be a valid hotchar for certain old european mainframe protocols.)
* Do not count loobacks as other fuilures.rik2004-06-251-1/+2
| | | | | | As a result magic will not be rejected any more in case of loopback. Discussed with: joerg@
* Add a couple of #ifdef DEBUG printf()s in vlan_input() I found to bejoerg2004-06-241-0/+6
| | | | | useful when debugging the ether_demux() problem (when bridging over VLANs).
* When considering an ethernet frame that is not destined for us, do notjoerg2004-06-241-3/+9
| | | | | | | | | | | | | | only allow this to be further processed when bridging is active on that interface, but also if the current packet has a VLAN tag and VLANs are active on our interface. This gives the VLAN layers a chance to also consider the packet (and perhaps drop it instead of the main dispatcher). This fixes a situation where bridging was only active on VLAN interfaces but ether_demux() called on behalf of the main interface had already thrown the packet away. MFC after: 4 weeks
* Make dependencies on the TCP/IP stack conditional on INET / INET6. Thisdes2004-06-241-0/+21
| | | | | | makes it possible to build a kernel with NIC drivers but no TCP/IP stack. Sponsored by: Teleplan AS
* Major overhaul of pseudo-interface cloning. Highlights include:brooks2004-06-2213-306/+784
| | | | | | | | | | | | | | | | | | | | | | | | | | | | - Split the code out into if_clone.[ch]. - Locked struct if_clone. [1] - Add a per-cloner match function rather then simply matching names of the form <name><unit> and <name>. - Use the match function to allow creation of <interface>.<tag> vlan interfaces. The old way is preserved unchanged! - Also the match function to allow creation of stf(4) interfaces named stf0, stf, or 6to4. This is the only major user visible change in that "ifconfig stf" creates the interface stf rather then stf0 and does not print "stf0" to stdout. - Allow destroy functions to fail so they can refuse to delete interfaces. Currently, we forbid the deletion of interfaces which were created in the init function, particularly lo0, pflog0, and pfsync0. In the case of lo0 this was a panic implementation so it does not count as a user visiable change. :-) - Since most interfaces do not need the new functionality, an family of wrapper functions, ifc_simple_*(), were created to wrap old style cloner functions. - The IF_CLONE_INITIALIZER macro is replaced with a new incompatible IFC_CLONE_INITIALIZER and ifc_simple consumers use IFC_SIMPLE_DECLARE instead. Submitted by: Maurycy Pawlowski-Wieronski <maurycy at fouk.org> [1] Reviewed by: andre, mlaier Discussed on: net
* Give zlib the ability to be a module that can be depended on,markm2004-06-201-0/+24
| | | | in the MODULE_DEPEND() sense.
* Include <sys/_lock.h>'s prerequisite <sys/queue.h> before including thebde2004-06-191-1/+1
| | | | | | former, not after. Don't hide this bug by including <sys/queue.h> in <sys/_lock.h>.
* Second half of the dev_t cleanup.phk2004-06-173-3/+3
| | | | | | | | | | | The big lines are: NODEV -> NULL NOUDEV -> NODEV udev_t -> dev_t udev2dev() -> findcdev() Various minor adjustments including handling of userland access to kernel space struct cdev etc.
* Do the dreaded s/dev_t/struct cdev */phk2004-06-168-42/+42
| | | | Bump __FreeBSD_version accordingly.
* Replace IF_HANDOFF with new IFQ_HANDOFF to enqueue with ALTQ once enabled onmlaier2004-06-1511-29/+45
| | | | the respective drivers.
* Lock down rawcb_list, a global list of control blocks for raw sockets,rwatson2004-06-153-0/+10
| | | | | | | | | | | using rawcb_mtx. Hold this mutex while modifying or iterating over the control list; this means that the mutex is held over calls into socket delivery code, which no longer causes a lock order reversal as the routing socket code uses a netisr to avoid recursing socket -> routing -> socket. Note: Locking of IPsec consumers of rawcb_list is not included in this commit.
* Fix a typeo in IFQ_HANDOFF.mlaier2004-06-151-1/+1
|
* Transform tbr_dequeue into a function pointer in order to build drivers withmlaier2004-06-152-5/+5
| | | | | | ALTQ enabled versions of IFQ_* macros by default, as requested by serveral others. This is a follow-up to the quick fix I committed yesterday which turned off the ALTQ checks for non-ALTQ kernels.
* Fix big-endian build.dfr2004-06-141-2/+2
|
* Unbreak non-ALTQ kernel linking. I forgot about tbr_dequeue.mlaier2004-06-141-1/+1
| | | | | | | | | In the end drivers should be building with ALTQ checks by default, but for now build them with the old macros for non-ALTQ kernels. Note: Check new features w/ LINT *and* w/ LINT minus the new feature. Found-by: rwatson
* Add MAC framework bits to the output path.dfr2004-06-131-0/+6
|
* Remove advertising clause.dfr2004-06-131-4/+0
|
* Link ALTQ to the build and break with ABI for struct ifnet. Please recompilemlaier2004-06-135-12/+228
| | | | | | | | | | | | your (network) modules as well as any userland that might make sense of sizeof(struct ifnet). This does not change the queueing yet. These changes will follow in a seperate commit. Same with the driver changes, which need case by case evaluation. __FreeBSD_version bump will follow. Tested-by: (i386)LINT
* Add a new driver to support IP over firewire. This driver is intended todfr2004-06-133-0/+941
| | | | | | | | conform to the rfc2734 and rfc3146 standard for IP over firewire and should eventually supercede the fwe driver. Right now the broadcast channel number is hardwired and we don't support MCAP for multicast channel allocation - more infrastructure is required in the firewire code itself to fix these problems.
* Extend coverage of SOCK_LOCK(so) to include so_count, the socketrwatson2004-06-122-1/+6
| | | | | | | | | | | | | | | | | | | | | | | | | reference count: - Assert SOCK_LOCK(so) macros that directly manipulate so_count: soref(), sorele(). - Assert SOCK_LOCK(so) in macros/functions that rely on the state of so_count: sofree(), sotryfree(). - Acquire SOCK_LOCK(so) before calling these functions or macros in various contexts in the stack, both at the socket and protocol layers. - In some cases, perform soisdisconnected() before sotryfree(), as this could result in frobbing of a non-present socket if sotryfree() actually frees the socket. - Note that sofree()/sotryfree() will release the socket lock even if they don't free the socket. Submitted by: sam Sponsored by: FreeBSD Foundation Obtained from: BSD/OS
* Constify raw_sendspace and raw_recvspace, as they're not mutable.rwatson2004-06-111-2/+2
|
* Switch to conditionally acquiring and dropping Giant around calls intorwatson2004-06-111-2/+2
| | | | | | ifp->if_output() basedd on debug.mpsafenet. That way once bpfwrite() can be called without Giant, it will acquire Giant (if desired) before entering the network stack.
* Un-staticize 'dst' sockaddr in the stack of bpfwrite() to preventrwatson2004-06-111-1/+2
| | | | | | | the need to synchronize access to the structure. I believe this should fit into the stack under the necessary circumstances, but if not we can either add synchronization or use a thread-local malloc for the duration.
* Introduce a netisr to deliver kernel-generated routing, avoidingrwatson2004-06-092-4/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | recursive entering of the socket code from the routing code: - Modify rt_dispatch() to bundle up the sockaddr family, if any, associated with a pending mbuf to dispatch to routing sockets, in an m_tag on the mbuf. - Allocate NETISR_ROUTE for use by routing sockets. - Introduce rtsintrq, an ifqueue to be used by the netisr, and introduce rts_input(), a function to unbundle the tagged sockaddr and inject the mbuf and address into raw_input(), which previously occurred in rt_dispatch(). - Introduce rts_init() to initialize rtsintrq, its mutex, and register the netisr. Perform this at the same point in system initialization as setup of the domains. This change introduces asynchrony between the generation of a pending routing socket message and delivery to sockets for use by userspace. It avoids socket->routing->rtsock->socket use and helps to avoid lock order reversals between the routing code and socket code (in particular, raw socket control blocks), as route locks are held over calls to rt_dispatch(). Reviewed by: "George V.Neville-Neil" <gnn@neville-neil.com> Conceptual head nod by: sam
* Use ldisc_[de]register() instead of frobbing linesw[] directly.phk2004-06-071-1/+2
|
* Add helper functions to calculate the standard ethernet CRC innaddy2004-06-022-0/+75
| | | | | | | | | little/big endian fashion, so that network drivers can just reference the standard implementation and don't have to bring their own. As discussed on arch@. Obtained from: NetBSD
OpenPOWER on IntegriCloud