summaryrefslogtreecommitdiffstats
path: root/sys/net
Commit message (Collapse)AuthorAgeFilesLines
* Do not attempt to clean up data that has not been initialized yet.roam2004-08-061-4/+15
| | | | | | | This fixes two kernel panics on boot when the xl driver fails to allocate bus/port/memory resources. Reviewed by: silence on -net
* Set ip_v field properly.sobomax2004-08-051-0/+1
| | | | PR: kern/69957
* Do a lockless read of the BPF interface structure descriptor list headrwatson2004-08-051-0/+21
| | | | | | before grabbing BPF locks to see if there are any entries in order to avoid the cost of locking if there aren't any. Avoids a mutex lock/ unlock for each packet received if there are no BPF listeners.
* Avoid casts as lvalues.kan2004-07-283-4/+4
|
* Initialize ; variable eraly to shut up GCC warning.kan2004-07-281-0/+1
|
* Add a new network interface flag, IFF_NEEDSGIANT, which will allowrwatson2004-07-274-2/+58
| | | | | | | | | | | | | | | | | | | | | | device drivers to declare that the ifp->if_start() method implemented by the driver requires Giant in order to operate correctly. Add a 'struct task' to 'struct ifnet' that can be used to execute a deferred ifp->if_start() in the event that if_start needs to be called in a Giant-free environment. To do this, introduce if_start(), a wrapper function for ifp->if_start(). If the interface can run MPSAFE, it directly dispatches into the interface start routine. If it can't run MPSAFE, we're running with debug.mpsafenet != 0, and Giant isn't currently held, the task is queued to execute in a swi holding Giant via if_start_deferred(). Modify if_handoff() to use if_start() instead of direct dispatch. Modify 802.11 to use if_start() instead of direct dispatch. This is intended to provide increased compatibility for non-MPSAFE network device drivers in the presence of Giant-free operation via asynchronous dispatch. However, this commit does not mark any network interfaces as IFF_NEEDSGIANT.
* Stop tinkering with the parent's VLAN_MTU capability.yar2004-07-261-27/+7
| | | | | | | | | | | | | | | | | | Now it is user-controlled through ifconfig(8). The former ``automagic'' way of operation created more trouble than good. First, VLAN_MTU consumers other than vlan(4) had appeared, e.g., ng_vlan(4). Second, there was no way to disable VLAN_MTU manually if it were causing trouble, e.g., data corruption. Dropping the ``automagic'' should be completely invisible to the user since a) all the drivers supporting VLAN_MTU have it enabled by default, and in the first place b) there is only one driver that can really toggle VLAN_MTU in the hardware under its control (it's fxp(4), to which I added VLAN_MTU controls to illustrate the principle.)
* Prefer NULL to '0' when checking a pointer value.rwatson2004-07-241-37/+37
|
* Actually free the unit when destroying the interface.brooks2004-07-221-0/+5
| | | | | | Reported by: la at delfi.lt Tested by: la at delfi.lt PR: 68618
* When removing the last reference to a cloner, do not try to unlock twice -mlaier2004-07-201-2/+3
| | | | | | esp. not since the backing memory was just freed. Reviewed by: rwatson
* 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
|
OpenPOWER on IntegriCloud