aboutsummaryrefslogtreecommitdiff
path: root/sys
Commit message (Collapse)AuthorAgeFilesLines
* Acquire socket lock around frobbing of socket state in divert sockets.Robert Watson2004-06-221-0/+2
| | | | Notes: svn path=/head/; revision=130901
* Prefer use of the inpcb as a MAC label source for outgoing packets sentRobert Watson2004-06-221-6/+8
| | | | | | | via divert sockets, when available. Notes: svn path=/head/; revision=130900
* Remove spl's from uipc_socket to ease in merging.Robert Watson2004-06-221-40/+8
| | | | Notes: svn path=/head/; revision=130899
* one too many #endif's from the update broke the buildDarren Reed2004-06-221-1/+0
| | | | Notes: svn path=/head/; revision=130898
* Fix another typo in the previous commit.Scott Long2004-06-211-1/+1
| | | | Notes: svn path=/head/; revision=130893
* Put the pre FreeBSD-2.x tty compat code under BURN_BRIDGES.Poul-Henning Kamp2004-06-2116-2/+73
| | | | Notes: svn path=/head/; revision=130892
* on media exchange, update/rescan the drives. This allows a volumePaul Saab2004-06-211-0/+4
| | | | | | | in a failed stated to come back on-line without a reboot. Notes: svn path=/head/; revision=130891
* Update ipfilter from 3.4.31 -> 3.4.35. Some important changes:Darren Reed2004-06-2116-392/+692
| | | | | | | | | | | | | | | | | | * block packets that fail to create state table entries * only allow non-fragmented packets to influence whether or not a logged packet is the same as the one logged before. * correct the ICMP packet checksum fixing up when processing ICMP errors for NAT * implement a maximum for the number of entries in the NAT table (NAT_TABLE_MAX and ipf_nattable_max) * frsynclist() wasn't paying attention to all the places where interface names are, like it should. * fix comparing ICMP packets with established TCP state where only 8 bytes of header are returned in the ICMP error. MFC after: 1 week Notes: svn path=/head/; revision=130886
* Fix typo that somehow crept into the previous commitScott Long2004-06-211-1/+1
| | | | Notes: svn path=/head/; revision=130885
* Update previous commit to:Kelly Yancey2004-06-211-18/+13
| | | | | | | | | | | | | | | | * Obtain/release schedlock around calls to calcru. * Sort switch cases which do not cascade per style(9). * Sort local variables per style(9). * Remove "superfluous" whitespace. * Cleanup handling of NULL uap->tp in clock_getres(). It would probably be better to return EFAULT like clock_gettime() does by passing the pointer to copyout(), but I presume it was written to not fail on purpose in the original code. I'll defer to -standards on this one. Reported by: bde Notes: svn path=/head/; revision=130884
* Add the sysctl node 'kern.sched.name' that has the name of the schedulerScott Long2004-06-212-1/+13
| | | | | | | | currently in use. Move the 4bsd kern.quantum node to kern.sched.quantum for consistency. Notes: svn path=/head/; revision=130881
* Be BURN_BRIDGES compliantPoul-Henning Kamp2004-06-211-1/+1
| | | | Notes: svn path=/head/; revision=130880
* Be BURN_BRIDGES compliant.Poul-Henning Kamp2004-06-211-1/+1
| | | | Notes: svn path=/head/; revision=130879
* There is no need to call ciss_media_accept async anymore since allPaul Saab2004-06-211-42/+16
| | | | | | | notify events are handled in a kthread. Notes: svn path=/head/; revision=130878
* Mark the thread in an exiting program as inactive.Julian Elischer2004-06-211-1/+1
| | | | | | | | | | This is not really used by the process but it's confusing to some status readers to see zombie processes the "runnin" threads. Pointed out by: Don Lewis <truckman@FreeBSD.org> Notes: svn path=/head/; revision=130877
* Call the detach function with g_waitfor_event() so that it can accessBrian Feldman2004-06-211-1/+8
| | | | | | | | | | | the GEOM topology. There are still issues with not detaching from cam correctly such that upon a device detach there's an invalid pointer dereference from the later call to cam_rescan(). Notes: svn path=/head/; revision=130876
* Kill g_access_rel() already now before we send it down 5-stablePoul-Henning Kamp2004-06-211-3/+0
| | | | Notes: svn path=/head/; revision=130875
* Add SCSI passthrough support to CISS. This allows devices like tape drivesScott Long2004-06-213-22/+286
| | | | | | | | | | | | | | that are on a CISS bus to be exported up to CAM and made available as normal devices. This will typically add one or two buses to CAM, which will be numbered starting at 32 to allow room for CISS proxy buses. Also, the CISS firmware usually hides disk devices, but these can also be exposed as 'pass' devices if you set the hw.ciss.expose_hidden_physical tunable. Sponsored by: Tape Laboratories, Inc. MFC After: 3 days Notes: svn path=/head/; revision=130874
* Give control devices their own cdevsw{} so that we can eliminate themPoul-Henning Kamp2004-06-211-51/+111
| | | | | | | | | from the trafic functions. Do not use com_addr() when we don't need it. Notes: svn path=/head/; revision=130872
* Revert rev 1.140, it was a bit pre-mature.Paul Saab2004-06-211-5/+0
| | | | Notes: svn path=/head/; revision=130866
* Add a quirk for ciss to stop trying to read the serial number offPaul Saab2004-06-211-0/+5
| | | | | | | of logical volumes. Notes: svn path=/head/; revision=130864
* Turned off the "calcru: negative time" warning for certain SMP casesBruce Evans2004-06-211-12/+34
| | | | | | | | | | | | | | where it is known to detect a problem but the problem is not very easy to fix. The warning became very common recently after a call to calcru() was added to fill_kinfo_thread(). Another (much older) cause of "negative times" (actually non-monotonic times) was fixed in rev.1.237 of kern_exit.c. Print separate messages for non-monotonic and negative times. Notes: svn path=/head/; revision=130858
* Use the correct type (lwpid_t) for ki_tid .Garance A Drosehn2004-06-211-1/+1
| | | | | | | | Noticed by: julian Approved by: julian, marcel Notes: svn path=/head/; revision=130855
* (1) Removed the bogus condition "p->p_pid != 1" on calling sched_exit()Bruce Evans2004-06-211-7/+1
| | | | | | | | | | | | | | | | | | | | | | | | from exit1(). sched_exit() must be called unconditionally from exit1(). It was called almost unconditionally because the only exits on system shutdown if at all. (2) Removed the comment that presumed to know what sched_exit() does. sched_exit() does different things for the ULE case. The call became essential when it started doing load average stuff, but its caller should not know that. (3) Didn't fix bugs caused by bitrot in the condition. The condition was last correct in rev.1.208 when it was in wait1(). There p was spelled curthread->td_proc and was for the waiting parent; now p is for the exiting child. The condition was to avoid lowering init's priority. It should be in sched_exit() itself. Lowering of priorities is broken in other ways in at least the 4BSD scheduler, and doing it for init causes less noticeable problems than doing it for for shells. Noticed by: julian (1) Notes: svn path=/head/; revision=130847
* Update p_runtime on exit. This fixes calcru() on zombies, and preparesBruce Evans2004-06-211-2/+9
| | | | | | | | | | for not calling calcru() on exit. calcru() on a zombie can happen if ttyinfo() (^T) picks one. PR: 52490 Notes: svn path=/head/; revision=130842
* Prevent the rp driver from panic'ing on first access and make atAndrew Gallatin2004-06-213-29/+33
| | | | | | | | | | | | | | | | | | | | | | least the pci device unloadable - Use ttymalloc() rather than a plain malloc to allocate the rp->rp_tty ttys. This is now required due to the recent locking changes to ttys and prevents a panic due to locking an unitialized t_mtx. - Allow the pci driver to be unloaded. This involved moving the call rp_releaseresource() to the end of rp_pcireleaseresource(), since rp_pcireleaseresource() uses ctlp->dev, which is freed by rp_releaseresource(). - Allow the generic part of the driver to be unattached by providing a hook to cancel timeouts. Glanced at by: obrien Notes: svn path=/head/; revision=130841
* New style functions, kill register keyword.Poul-Henning Kamp2004-06-211-43/+28
| | | | Notes: svn path=/head/; revision=130840
* Don't hold topology lock while calling g_gate_release().Pawel Jakub Dawidek2004-06-211-0/+2
| | | | | | | Found by: KASSERT() Notes: svn path=/head/; revision=130836
* Include module.hScott Long2004-06-211-0/+1
| | | | | | | Submitted by: Koop Mast Notes: svn path=/head/; revision=130833
* Merge next step in socket buffer locking:Robert Watson2004-06-216-69/+558
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - sowakeup() now asserts the socket buffer lock on entry. Move the call to KNOTE higher in sowakeup() so that it is made with the socket buffer lock held for consistency with other calls. Release the socket buffer lock prior to calling into pgsigio(), so_upcall(), or aio_swake(). Locking for this event management will need revisiting in the future, but this model avoids lock order reversals when upcalls into other subsystems result in socket/socket buffer operations. Assert that the socket buffer lock is not held at the end of the function. - Wrapper macros for sowakeup(), sorwakeup() and sowwakeup(), now have _locked versions which assert the socket buffer lock on entry. If a wakeup is required by sb_notify(), invoke sowakeup(); otherwise, unconditionally release the socket buffer lock. This results in the socket buffer lock being released whether a wakeup is required or not. - Break out socantsendmore() into socantsendmore_locked() that asserts the socket buffer lock. socantsendmore() unconditionally locks the socket buffer before calling socantsendmore_locked(). Note that both functions return with the socket buffer unlocked as socantsendmore_locked() calls sowwakeup_locked() which has the same properties. Assert that the socket buffer is unlocked on return. - Break out socantrcvmore() into socantrcvmore_locked() that asserts the socket buffer lock. socantrcvmore() unconditionally locks the socket buffer before calling socantrcvmore_locked(). Note that both functions return with the socket buffer unlocked as socantrcvmore_locked() calls sorwakeup_locked() which has similar properties. Assert that the socket buffer is unlocked on return. - Break out sbrelease() into a sbrelease_locked() that asserts the socket buffer lock. sbrelease() unconditionally locks the socket buffer before calling sbrelease_locked(). sbrelease_locked() now invokes sbflush_locked() instead of sbflush(). - Assert the socket buffer lock in socket buffer sanity check functions sblastrecordchk(), sblastmbufchk(). - Assert the socket buffer lock in SBLINKRECORD(). - Break out various sbappend() functions into sbappend_locked() (and variations on that name) that assert the socket buffer lock. The !_locked() variations unconditionally lock the socket buffer before calling their _locked counterparts. Internally, make sure to call _locked() support routines, etc, if already holding the socket buffer lock. - Break out sbinsertoob() into sbinsertoob_locked() that asserts the socket buffer lock. sbinsertoob() unconditionally locks the socket buffer before calling sbinsertoob_locked(). - Break out sbflush() into sbflush_locked() that asserts the socket buffer lock. sbflush() unconditionally locks the socket buffer before calling sbflush_locked(). Update panic strings for new function names. - Break out sbdrop() into sbdrop_locked() that asserts the socket buffer lock. sbdrop() unconditionally locks the socket buffer before calling sbdrop_locked(). - Break out sbdroprecord() into sbdroprecord_locked() that asserts the socket buffer lock. sbdroprecord() unconditionally locks the socket buffer before calling sbdroprecord_locked(). - sofree() now calls socantsendmore_locked() and re-acquires the socket buffer lock on return. It also now calls sbrelease_locked(). - sorflush() now calls socantrcvmore_locked() and re-acquires the socket buffer lock on return. Clean up/mess up other behavior in sorflush() relating to the temporary stack copy of the socket buffer used with dom_dispose by more properly initializing the temporary copy, and selectively bzeroing/copying more carefully to prevent WITNESS from getting confused by improperly initialized mutexes. Annotate why that's necessary, or at least, needed. - soisconnected() now calls sbdrop_locked() before unlocking the socket buffer to avoid locking overhead. Some parts of this change were: Submitted by: sam Sponsored by: FreeBSD Foundation Obtained from: BSD/OS Notes: svn path=/head/; revision=130831
* Fix the following error:Marcel Moolenaar2004-06-201-0/+2
| | | | | | | | | | | | | | | | | ld: locore.o: non-pic code with imm relocation against dynamic symbol `__gp' With binutils 2.15, ld(1) defines the implicit/automatic symbol __gp as a dynamic symbol and thus will now complain when used in a non-PIC fashion (the immediate relocation used to set the GP register). Resolve this by defining __gp in the linker script. Make sure __gp is aligned on a 16-byte boundary. Note: the 0x200000 magic offset is due to having a 22-bit GP-relative relocation. The GOT will be accessed with negative offsets from GP. Notes: svn path=/head/; revision=130829
* Fill in the values for the ki_tid and ki_numthreads which have beenGarance A Drosehn2004-06-201-0/+2
| | | | | | | | | | added to kproc_info. PR: bin/65803 (a tiny part...) Submitted by: Cyrille Lefevre Notes: svn path=/head/; revision=130826
* Change the architecture-based setting of KINFO_PROC_SIZE and KI_NSPARE soGarance A Drosehn2004-06-201-14/+32
| | | | | | | | | | | | that it is a series of alphabetically-ordered #fidef's, from Bruce Evans. Define two new thread-related values in kproc_info, from Cyrille Lefevre. Also remove a few values from kproc_info that were not needed, and change around a few comments, from me. Changes are combined into a single commit simply because it is a hassle to make sure that alignments and sizes are not changed on any platform when modifying kproc_info. Notes: svn path=/head/; revision=130825
* Include an annotation of NET_{LOCK,UNLOCK}_GIANT() noting that theseRobert Watson2004-06-201-1/+4
| | | | | | | | calls do not have the same recursion semantics as DROP_GIANT and PICKUP_GIANT. Notes: svn path=/head/; revision=130823
* It's now the responsibility of the consumer of soabort() to remove aRobert Watson2004-06-201-1/+12
| | | | | | | | | | socket from its accept queue when aborting it during a new inbound connection. Update spx_input() to acquire the accept lock, assert the condition of the socket on its parent queue, and approriately disconnect it from the queue before calling soabort() on it. Notes: svn path=/head/; revision=130822
* If debug.mpsafenet is set, initialize TCP callouts as CALLOUT_MPSAFE.Robert Watson2004-06-202-10/+24
| | | | Notes: svn path=/head/; revision=130821
* In uipc_rcvd(), lock the socket buffers at either end of the UNIXRobert Watson2004-06-201-0/+4
| | | | | | | | | | domain sokcet when updating fields at both ends. Submitted by: sam Sponsored by: FreeBSD Foundation Notes: svn path=/head/; revision=130820
* Annotate so_state as locked with SOCK_LOCK(so).Robert Watson2004-06-201-1/+4
| | | | | | | Add a commenting indicating that the SB_ constants apply to sb_flags. Notes: svn path=/head/; revision=130818
* Hold SOCK_LOCK(so) when frobbing so_state when disconnecting aRobert Watson2004-06-201-1/+5
| | | | | | | connected UNIX domain datagram socket. Notes: svn path=/head/; revision=130817
* Remove one more unneeded reference to arpcom.ac_netgraph.Bill Paul2004-06-201-10/+34
| | | | | | | | | | | | | | | | | | | Tweak things so that ng_fec has a chance of working with things other than ethernet. Use ifp->if_output of the underlying interfaces and use IF_HANDOFF() rather than depending on ether_output() and ether_output_frame() explicitly. Also, don't insist that underlying devices be IFM_ETHER when checking their link states in the link monitor code. With these changes, I was able to create a two channel bundle consisting of one ethernet interface and one 802.11 wireless device (via ndis). Note that this only works because both devices use the same if_output vector: ng_fec will not let you bundle devices with different output vectors together (it really doesn't make sense to do that). Notes: svn path=/head/; revision=130815
* - Simplify pmap_remove_pages(), eliminating unnecessary indirection.Alan Cox2004-06-202-25/+24
| | | | | | | | - Simplify the locking of pmap_is_modified() by converting control flow to data flow. Notes: svn path=/head/; revision=130814
* Assert the inpcb lock before letting MAC check whether we can deliverRobert Watson2004-06-202-0/+2
| | | | | | | to the inpcb in tcp_input(). Notes: svn path=/head/; revision=130811
* IP multicast code no longer needs to acquire Giant before appendingRobert Watson2004-06-201-3/+0
| | | | | | | | an mbuf onto a socket buffer. This is left over from debug.mpsafenet affecting the forwarding/bridging plane only. Notes: svn path=/head/; revision=130810
* Stash our node context pointer somewhere else within struct ifnet ofBill Paul2004-06-201-2/+18
| | | | | | | | | underlying interfaces rather than using ac_netgraph in struct arpcom. The latter is meant only for use by ng_ether, and using it breaks interoperability with the rest of netgraph. Notes: svn path=/head/; revision=130808
* When retrieving the SO_LINGER socket option for user space, hold theRobert Watson2004-06-201-0/+7
| | | | | | | | | socket lock over pulling so_options and so_linger out of the socket structure in order to retrieve a consistent snapshot. This may be overkill if user space doesn't require a consistent snapshot. Notes: svn path=/head/; revision=130801
* Convert an if->panic in soclose() into a call to KASSERT().Robert Watson2004-06-201-2/+1
| | | | Notes: svn path=/head/; revision=130800
* Give zlib the ability to be a module that can be depended on,Mark Murray2004-06-202-0/+32
| | | | | | | in the MODULE_DEPEND() sense. Notes: svn path=/head/; revision=130799
* Annotate some ordering-related issues in solisten() which are not yetRobert Watson2004-06-201-0/+5
| | | | | | | | | | resolved by socket locking: in particular, that we test the connection state at the socket layer without locking, request that the protocol begin listening, and then set the listen state on the socket non-atomically, resulting in a non-atomic cross-layer test-and-set. Notes: svn path=/head/; revision=130797
* Annotate two intentionally unlocked reads with comments.Robert Watson2004-06-201-0/+6
| | | | | | | | Annotate a potentially inconsistent result returned to user space when performing fstaT() on a socket due to not using socket buffer locking. Notes: svn path=/head/; revision=130796
* Initialize ni_cnd.cn_cred before calling lookup() (this is normally doneThomas Moestl2004-06-201-0/+1
| | | | | | | | | | by namei(), which cannot easily be used here however). This fixes boot time crashes on sparc64 and probably other platforms. Reviewed by: phk Notes: svn path=/head/; revision=130795