summaryrefslogtreecommitdiffstats
path: root/sys/net
Commit message (Collapse)AuthorAgeFilesLines
* Add FR support to sppp (MFCronyx).rik2004-12-283-14/+685
| | | | | | | | | | Silence on: net@, current@, hackers@. No objections: joerg Requested by: by many (mostly Cronyx) users for a long long time. MFC after: 10 days PR: kern/21771, kern/66348
* Fix mbuf leak.pjd2004-12-271-1/+3
| | | | | Submitted by: Johnny Eriksson <bygg@cafax.se> MFC after: 5 days
* Include fcntl.hphk2004-12-221-2/+3
| | | | | | Include selinfo.h (don't rely on vnode.h to do so) Check O_NONBLOCK instead of IO_NELAY Don't include vnode.h
* Don't include filedesc.hphk2004-12-221-3/+3
| | | | | | | Include fcntl.h Include selinfo.h (don't rely on vnode.h to do so) Check O_NONBLOCK instead of IO_NDELAY Don't include vnode.h
* Include fcntl.hphk2004-12-221-3/+3
| | | | | | | Check O_NONBLOCK instead of IO_NDELAY Include uio.h Don't include vnode.h Don't include filedesc.h
* Check O_NONBLOCK instead of IO_NDELAY.phk2004-12-221-2/+1
| | | | Don't include <sys/vnode.h>
* don't try to recurse on the bpf lock.. kqueue already locks the bpf lockjmg2004-12-171-2/+1
| | | | | | | now... Submitted by: Ed Maste of Sandvine Inc. MFC after: 1 week
* Kill double inclusion for <netinet/in.h> and <netinet/in_systm.h>.rik2004-12-141-2/+0
|
* Make sppp MPSAFE.rik2004-12-122-112/+237
| | | | | | | MPSAFE could be turned off by IFF_NEEDSGIANT. Silence on: net@, current@, hackers@. No objections: joerg
* Cleanup link state change notification:sam2004-12-082-0/+27
| | | | | o add new if_link_state_change routine that deals with link state changes o change mii to use if_link_state_change
* Don't require a device to be marked up when issuing BIOCSETIF.sam2004-12-081-4/+3
|
* Implement the check I was talking about in the previous message already.mlaier2004-11-301-4/+4
| | | | | | | | | | | | | | | | | Introduce domain_init_status to keep track of the init status of the domains list (surprise). 0 = uninitialized, 1 = initialized/unpopulated, 2 = initialized/done. Higher values can be used to support late addition of domains which right now "works", but is potential dangerous. I choose to only give a warning when doing so. Use domain_init_status with if_attachdomain[1]() to ensure that we have a complete domains list when we init the if_afdata array. Store the current value of domain_init_status in if_afdata_initialized. This way we can update if_afdata after a new protocol has been added (once that is allowed). Submitted by: se (with changes) Reviewed by: julian, glebius, se PR: kern/73321 (partly)
* Assign if_broadcastaddr to NULL not 0 in if_attach().rwatson2004-11-231-8/+10
| | | | | | | | | | | Printf() a warning if if_attachdomain() is called more than once on an interface to generate some noise on mailing lists when this occurs. Fix up style in if_start(), where spaces crept in instead of tabs at some point. MFC after: 1 week MFC note: Not the printf().
* sync comment on IFF_OACTIVE with reality.. IFF_OACTIVE is set when thejmg2004-11-171-1/+1
| | | | | | | hardware cannot take anymore packets, and so will supress the calling of the device's if_start method... Submitted by: bde
* Remove the #if 0 wrapping around !ALTQ stuff that can't be used due to ABImlaier2004-11-091-34/+0
| | | | stability anyway.
* Initialize struct pr_userreqs in new/sparse style and fill in commonphk2004-11-082-10/+20
| | | | | | default elements in net_init_domain(). This makes it possible to grep these structures and see any bogosities.
* Don't abuse tp->t_sc in sl(4) either.cognet2004-11-071-6/+15
|
* Don't abuse tp->t_sc, as it is now used by tty drivers.cognet2004-11-073-13/+26
| | | | | | This fixes the panic that occurs when using ppp(4) Reported and tested by: Yann Berthier (yb at sainte-barbe dot org)
* Utilize m_uiotombuf() in device write method, instead of home-grownglebius2004-10-312-70/+18
| | | | | | | | implementation. This also gives a performance improvement, because m_uiotombuf() utilizes clusters. Approved by: julian (mentor) MFC after: 1 month
* Move if_handoff() from an inline in if_var.h to a function to if.crwatson2004-10-302-24/+27
| | | | | | | | | in orden to harden the ABI for 5.x; this will permit us to modify the locking in the ifnet packet dispatch without requiring drivers to be recompiled. MFC after: 3 days Discussed at: EuroBSDCon Developer's Summit
* Add additional "spare" fields to 'struct ifnet' in order to improverwatson2004-10-301-0/+5
| | | | | | | | the resistance of the network driver ABI to changes that will be required as we optimize locking. MFC after: 3 days Discussed at: Developer Summit
* use NULL instead of 0 when casting/comparing w/ a pointer...jmg2004-10-251-2/+2
|
* Define IFF_LOCKGIANT() and IFF_UNLOCKGIANT() macros, which conditionallyrwatson2004-10-192-2/+40
| | | | | | | | | acquire Giant if the passed interface has IFF_NEEDSGIANT set on it. Modify calls into (ifp)->if_ioctl() in if.c to use these macros in order to ensure that Giant is held. MFC after: 3 days Bumped into by: jmg
* Push acquisition of the accept mutex out of sofree() into the callerrwatson2004-10-182-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | (sorele()/sotryfree()): - This permits the caller to acquire the accept mutex before the socket mutex, avoiding sofree() having to drop the socket mutex and re-order, which could lead to races permitting more than one thread to enter sofree() after a socket is ready to be free'd. - This also covers clearing of the so_pcb weak socket reference from the protocol to the socket, preventing races in clearing and evaluation of the reference such that sofree() might be called more than once on the same socket. This appears to close a race I was able to easily trigger by repeatedly opening and resetting TCP connections to a host, in which the tcp_close() code called as a result of the RST raced with the close() of the accepted socket in the user process resulting in simultaneous attempts to de-allocate the same socket. The new locking increases the overhead for operations that may potentially free the socket, so we will want to revise the synchronization strategy here as we normalize the reference counting model for sockets. The use of the accept mutex in freeing of sockets that are not listen sockets is primarily motivated by the potential need to remove the socket from the incomplete connection queue on its parent (listen) socket, so cleaning up the reference model here may allow us to substantially weaken the synchronization requirements. RELENG_5_3 candidate. MFC after: 3 days Reviewed by: dwhite Discussed with: gnn, dwhite, green Reported by: Marc UBM Bocklet <ubm at u-boot-man dot de> Reported by: Vlad <marchenko at gmail dot com>
* Fix packet flow when both ng_ether(4) and bridge(4) are in use:glebius2004-10-123-51/+32
| | | | | | | | | | | | | | | - push all bridge logic from if_ethersubr.c into bridge.c make bridge_in() return mbuf pointer (or NULL). - call only bridge_in() from ether_input(), after ng_ether_input() was optinally called. - call bridge_in() from ng_ether_rcv_upper(). Long description: http://lists.freebsd.org/mailman/htdig/freebsd-net/2004-May/003881.html Reported by: Jian-Wei Wang <jwwang at FreeBSD.csie.NCTU.edu.tw> Tested by: myself, Sergey Lyubka Reviewed by: sam Approved by: julian (mentor) MFC after: 2 months
* Correctly unregister a netisr by clearing the ni->ni_queue field to NULL asandre2004-10-111-0/+1
| | | | | | | | | well. This field is actually used by various netisr functions to determine the availablility of the specified netisr. This uncomplete unregister leads directly to a crash when the KLD unregistering the netisr is unloaded. Submitted by: Sam <sah@softcardsystems.com> MFC after: 3 days
* When harvesting entropy from an ethernet mbuf, do so before freeing therwatson2004-10-111-1/+1
| | | | | | mbuf. RELENG_5 candidate.
* Assign pointer NULL, not 0.glebius2004-10-111-1/+1
| | | | Approved by: julian (mentor)
* Change pfil starvation prevention from fail-open to fail-close.mlaier2004-10-081-2/+10
| | | | | | | | | We return ENOBUF to indicate the problem, which is an errno that should be handled well everywhere. Requested & Submitted by: green Silently okay'ed by: The rest of the firewall gang MFC after: 3 days
* Since net/net_osdep.c contained only one function that could bebrooks2004-10-082-59/+1
| | | | | trivially implemented as a macro, do that and remove it. NetBSD did this quite a while ago.
* Don't recurse the BPF descriptor lock during the BIOCSDLT operationgreen2004-10-061-1/+1
| | | | | | | | | (and panic). To try to finish making BPF safe, at the very least, the BPF descriptor lock really needs to change into a reader/writer lock that controls access to "settings," and a mutex that controls access to the selinfo/knote/callout. Also, use of callout_drain() instead of callout_stop() (which is really a much more widespread issue).
* Add 802.11-specific events that are dispatched through the routing socket.sam2004-10-052-13/+68
| | | | | | | This really doesn't belong here but is preferred (for the moment) over adding yet another mechanism for sending msgs from the kernel to user apps. Reviewed by: imp
* add ETHERTYPE_PAE for EAPOL/802.1xsam2004-10-051-0/+1
|
* Add an additional struct inpcb * argument to pfil(9) in order to enablemlaier2004-09-293-11/+12
| | | | | | | | | | | | | | | | | | | passing along socket information. This is required to work around a LOR with the socket code which results in an easy reproducible hard lockup with debug.mpsafenet=1. This commit does *not* fix the LOR, but enables us to do so later. The missing piece is to turn the filter locking into a leaf lock and will follow in a seperate (later) commit. This will hopefully be MT5'ed in order to fix the problem for RELENG_5 in forseeable future. Suggested by: rwatson A lot of work by: csjp (he'd be even more helpful w/o mentor-reviews ;) Reviewed by: rwatson, csjp Tested by: -pf, -ipfw, LINT, csjp and myself MFC after: 3 days LOR IDs: 14 - 17 (not fixed yet)
* Switch order for mtx_unlock and cv_signal as (condvar(9)) sez:mlaier2004-09-221-2/+2
| | | | | | | | | | | | A thread must hold mp while calling cv_signal(), cv_broadcast(), or cv_broadcastpri() even though it isn't passed as an argument. and is right with this claim. While here remove a "\" from the macro -> __inline conversion. Found by: csjp MFC after: 4 days
* Prefer C99's __func__ over GCC's __FUNCTION__.stefanf2004-09-221-1/+1
|
* Call sbuf_finish() before sbuf_data() so as to not panic the system.green2004-09-221-0/+1
|
* Fix a LOR where ifconf() used copyout while holding a mutex. This LORbrooks2004-09-221-41/+51
| | | | | | | | was seen when configuring addresses on interfaces using ifconfig. This patch has been verified to work with over eight thousand addresses assigned to an interface. LOR id: 031
* Log the renaming of an interface. This should make it easier to followbrooks2004-09-181-0/+3
| | | | kernel log files.
* Destroy global tapmtx when the if_tap module is unloaded.rwatson2004-09-171-0/+2
| | | | RELENG_5 candidated.
* Fix a LOR where copyout was called while holding a lock.brooks2004-09-151-10/+27
| | | | Reported by: rwatson
* Reformulate bpf_dettachd() to acquire the BIF_LOCK() as well asrwatson2004-09-091-11/+20
| | | | | | | | | | | | | BPFD_LOCK() when removing a descriptor from an interface descriptor list. Hold both over the operation, and do a better job at maintaining the invariant that you can't find partially connected descriptors on an active interface descriptor list. This appears to close a race that resulted in the kernel performing a NULL pointer dereference when BPF sessions are detached during heavy network activity on SMP systems. RELENG_5 candidate.
* Reformulate use of linked lists in 'struct bpf_d' and 'struct bpf_if'rwatson2004-09-092-38/+24
| | | | | | | | | | | | to use queue(3) list macros rather than hand-crafted lists. While here, move to doubly linked lists to eliminate iterating lists in order to remove entries. This change simplifies and clarifies the list logic in the BPF descriptor code as a first step towards revising the locking strategy. RELENG_5 candidate. Reviewed by: fenner
* Compare/set pointers using NULL not 0.rwatson2004-09-091-3/+3
|
* Re-add ifi_epoch, to struct if_data, this time replacing ifi_unusedbrooks2004-09-082-1/+5
| | | | | | | | | | | | to avoid ABI changes. It is set to the last time the interface counters were zeroed, currently the time if_attach() was called. It is intentended to be a valid value for RFC2233's ifCounterDiscontinuityTime and to make it easier for applications to verify that the interface they find at a given index is the one that was there last time they looked. Due to space constraints ifi_epoch is a time_t rather then a struct timeval. SNMP would prefer higher precision, but this unlikely to be useful in practice.
* don't call f_detach if the filter has alread removed the knote.. Thisjmg2004-09-061-3/+0
| | | | | | | | happens when a proc exits, but needs to inform the user that this has happened.. This also means we can remove the check for detached from proc and sig f_detach functions as this is doing in kqueue now... MFC after: 5 days
* Correct a comment typo: s/Note/Not/.rwatson2004-09-031-1/+1
| | | | Pointed out by: kensmith
* Back out ifi_epoch. The ABI breakage is too disruptive this close tobrooks2004-09-022-2/+0
| | | | | 5-STABLE. ifi_epoch will shortly be reintroduced with less precistion using the space currently allocated to ifi_unused.
* Fix an assertion when if_down()ing a ALTQ managed interface. The lock shouldmlaier2004-09-011-0/+2
| | | | | | | | | have been in place all the time the mtx_assert in the ALTQ code just discovered the shortcoming. PR: i386/71195 Tested by: Bettan (PR originator), myself MFC after: 5 days
* Use a spare byte in struct if_data to store the structure size withoutbrooks2004-09-012-0/+2
| | | | | | | | | increasing it. Add code to ifconfig to use this size to find the sockaddr_dl after the struct if_data in the routing message. This allows struct if_data to grow (up to 255 bytes) without breaking ifconfig. Submitted by: peter
OpenPOWER on IntegriCloud