Commit Graph

158997 Commits

Author SHA1 Message Date
Jilles Tjoelker
048f26671a sh: Do IFS splitting on word in ${v+word} and ${v-word}.
The code is inspired by NetBSD sh somewhat, but different because we
preserve the old Almquist/Bourne/Korn ability to have an unquoted part in a
quoted ${v+word}. For example, "${v-"*"}" expands to $v as a single field if
v is set, but generates filenames otherwise.

Note that this is the only place where we split text literally from the
script (the similar ${v=word} assigns to v and then expands $v). The parser
must now add additional markers to allow the expansion code to know whether
arbitrary characters in substitutions are quoted.

Example:
  for i in ${$+a b c}; do echo $i; done

Exp-run done by:	pav (with some other sh(1) changes)
2010-10-29 13:42:18 +00:00
Rick Macklem
0661e0348b Add a call for nfsrpc_close() to ncl_reclaim() in the experimental
NFSv4 client, since the call in ncl_inactive() might be missed
because VOP_INACTIVE() is not guaranteed to be called before
VOP_RECLAIM().

MFC after:	1 week
2010-10-29 13:34:57 +00:00
David Xu
b67cc292dc Add sysctl kern.sched.cpusetsize to export the size of kernel cpuset,
also add sysconf() key _SC_CPUSET_SIZE to get sysctl value.

Submitted by: gcooper
2010-10-29 13:31:10 +00:00
Gleb Smirnoff
27bf126d23 Remove meaningless XXXXX, that is a remain of comment, removed in r186200. 2010-10-29 11:13:42 +00:00
Gleb Smirnoff
28e1f17c81 Revert a small part of the r198301, that is entirely unrelated to the
r198301 itself. It also broke the logic of not sending more than one
ARP request per second, that consequently lead to a potential problem
of flooding network with broadcast packets.

MFC after:	1 week
2010-10-29 10:57:18 +00:00
David Xu
6ed79f06f4 Return previous sigaction correctly.
Submitted by:	avg
2010-10-29 09:35:36 +00:00
David Xu
322a8adaa3 Remove local variable 'first', instead check signal number in memory,
because the variable can be in register, second checking the variable
may still return true, however this is unexpected.
2010-10-29 07:04:45 +00:00
Nathan Whitehorn
49939626be Fix the printf() in init_heap so that it can run before the console is up.
Pointed out by:	marius
2010-10-29 00:37:35 +00:00
Nathan Whitehorn
51b1acac58 Fix netboot on some Apple machines on which calling dma-free on the
network device can hang the machine. This causes the loss of 64 KB of
accessible memory on netbooted machines.
2010-10-29 00:36:44 +00:00
Nathan Whitehorn
e60ab831db Fix some memory management issues discovered when trying to boot the PPC
OF loader on systems where address cells and size cells are both 2 (the
Mambo simulator) and fix an error where cons_probe() was called before
init_heap() but used malloc() to set environment variables.

MFC after:	1 month
2010-10-28 23:46:05 +00:00
Jilles Tjoelker
6c38071288 sh: Only accept a '}' inside ${v+-=?...} if double-quote state matches.
If double-quote state does not match, treat the '}' literally.

This ensures double-quote state remains the same before and after a
${v+-=?...} which helps with expand.c.

It makes things like
  ${foo+"\${bar}"}
which I have seen in the wild work as expected.

Exp-run done by:	pav (with some other sh(1) changes)
2010-10-28 22:34:49 +00:00
Ulrich Spörlein
02ac77f222 Fix another "string" typo.
MFC after:	3 days
2010-10-28 22:28:45 +00:00
Jilles Tjoelker
9cec947f3f sh: Make double-quotes quote a '}' inside ${v#...} and ${v%...}.
Exp-run done by:	pav (with some other sh(1) changes)
PR:			bin/57554
2010-10-28 21:51:14 +00:00
Ulrich Spörlein
ac203a768d Fix CPU load reporting independent of scheduler used.
- Sample CPU usage data from kern.cp_times, this makes for a far more
  accurate and scheduler independent algorithm.
- Rip out the process list scraping that is no longer required.
- Don't update CPU usage sampling on every request, but every 15s
  instead. This makes it impossible for an attacker to hide the CPU load
  by triggering 4 samplings in short succession when the system is idle.
- After reaching the steady-state, the system will always report the
  average CPU load of the last 60 sampled seconds.
- Untangling of call graph.

PR:		kern/130222
Tested by:	Julian Dunn <jdunn@aquezada.com>
		Gustau Pérez <gperez@entel.upc.edu>
		Jürgen Weiß <weiss@uni-mainz.de>
MFC after:	2 weeks

I'm unsure if some MIB standard states this must be the load average
for, eg. 300s, it looks like net-snmp isn't even bothering to implement
the CPU load reporting at all.
2010-10-28 20:18:26 +00:00
Rui Paulo
c2ab553ee5 Remove useless stuff. 2010-10-28 19:10:15 +00:00
Rui Paulo
636720d7bc Update for the new tcpdump 4.1.1. The man page is a result of running
tcpdump's autoconf on FreeBSD.
2010-10-28 19:08:56 +00:00
Rui Paulo
27df3f5ddd Merge tcpdump-4.1.1. 2010-10-28 19:06:17 +00:00
Attilio Rao
ba2a27351b Merge nexus.c from amd64 and i386 to x86 subtree.
Sponsored by:	Sandvine Incorporated
Tested by:	gianni
2010-10-28 16:31:39 +00:00
Rui Paulo
6d59e2f382 Update tcpdump to 4.1.1.
Changes:

Thu.    April 1, 2010.  guy@alum.mit.edu.
  Summary for 4.1.1 tcpdump release
        Fix build on systems with PF, such as FreeBSD and OpenBSD.
        Don't blow up if a zero-length link-layer address is passed to
          linkaddr_string().

Thu.    March 11, 2010.  ken@netfunctional.ca/guy@alum.mit.edu.
  Summary for 4.1.0 tcpdump release
        Fix printing of MAC addresses for VLAN frames with a length
          field
        Add some additional bounds checks and use the EXTRACT_ macros
          more
        Add a -b flag to print the AS number in BGP packets in ASDOT
          notation rather than ASPLAIN notation
        Add ICMPv6 RFC 5006 support
        Decode the access flags in NFS access requests
        Handle the new DLT_ for memory-mapped USB captures on Linux
        Make the default snapshot (-s) the maximum
        Print name of device (when -L is used)
        Support for OpenSolaris (and SXCE build 125 and later)
        Print new TCP flags
        Add support for RPL DIO
        Add support for TCP User Timeout (UTO)
        Add support for non-standard Ethertypes used by 3com PPPoE gear
        Add support for 802.11n and 802.11s
        Add support for Transparent Ethernet Bridge ethertype in GRE
        Add 4 byte AS support for BGP printer
        Add support for the MDT SAFI 66 BG printer
        Add basic IPv6 support to print-olsr
        Add USB printer
        Add printer for ForCES
        Handle frames with an FCS
        Handle 802.11n Control Wrapper, Block Acq Req and Block Ack frames
        Fix TCP sequence number printing
        Report 802.2 packets as 802.2 instead of 802.3
        Don't include -L/usr/lib in LDFLAGS
        On x86_64 Linux, look in lib64 directory too
        Lots of code clean ups
        Autoconf clean ups
        Update testcases to make output changes
        Fix compiling with/out smi (--with{,out}-smi)
        Fix compiling without IPv6 support (--disable-ipv6)
2010-10-28 16:23:25 +00:00
Rui Paulo
e89167f07a Update libpcap to 1.1.1.
Changes:

Thu.    April 1, 2010.  guy@alum.mit.edu.
Summary for 1.1.1 libpcap release
        Update CHANGES to reflect more of the changes in 1.1.0.
        Fix build on RHEL5.
        Fix shared library build on AIX.

Thu.    March 11, 2010.  ken@netfunctional.ca/guy@alum.mit.edu.
Summary for 1.1.0 libpcap release
        Add SocketCAN capture support
        Add Myricom SNF API support
        Update Endace DAG and ERF support
        Add support for shared libraries on Solaris, HP-UX, and AIX
        Build, install, and un-install shared libraries by default;
          don't build/install shared libraries on platforms we don't support
        Fix building from a directory other than the source directory
        Fix compiler warnings and builds on some platforms
        Update config.guess and config.sub
        Support monitor mode on mac80211 devices on Linux
        Fix USB memory-mapped capturing on Linux; it requires a new DLT_
          value
        On Linux, scan /sys/class/net for devices if we have it; scan
          it, or /proc/net/dev if we don't have /sys/class/net, even if
          we have getifaddrs(), as it'll find interfaces with no
          addresses
        Add limited support for reading pcap-ng files
        Fix BPF driver-loading error handling on AIX
        Support getting the full-length interface description on FreeBSD
        In the lexical analyzer, free up any addrinfo structure we got back
          from getaddrinfo().
        Add support for BPF and libdlpi in OpenSolaris (and SXCE)
        Hyphenate "link-layer" everywhere
        Add /sys/kernel/debug/usb/usbmon to the list of usbmon locations
        In pcap_read_linux_mmap(), if there are no frames available, call
          poll() even if we're in non-blocking mode, so we pick up
          errors, and check for the errors in question.
        Note that poll() works on BPF devices is Snow Leopard
        If an ENXIO or ENETDOWN is received, it may mean the device has
          gone away.  Deal with it.
        For BPF, raise the default capture buffer size to from 32k to 512k
        Support ps_ifdrop on Linux
        Added a bunch of #ifdef directives to make wpcap.dll (WinPcap) compile
         under cygwin.
        Changes to Linux mmapped captures.
        Fix bug where create_ring would fail for particular snaplen and
          buffer size combinations
        Update pcap-config so that it handles libpcap requiring
          additional libraries
        Add workaround for threadsafeness on Windows
        Add missing mapping for DLT_ENC <-> LINKTYPE_ENC
        DLT: Add DLT_CAN_SOCKETCAN
        DLT: Add Solaris ipnet
        Don't check for DLT_IPNET if it's not defined
        Add link-layer types for Fibre Channel FC-2
        Add link-layer types for Wireless HART
        Add link-layer types for AOS
        Add link-layer types for DECT
        Autoconf fixes (AIX, HP-UX, OSF/1, Tru64 cleanups)
        Install headers unconditionally, and include vlan.h/bluetooth.h if
          enabled
        Autoconf fixes+cleanup
        Support enabling/disabling bluetooth (--{en,dis}able-bluetooth)
        Support disabling SITA support (--without-sita)
        Return -1 on failure to create packet ring (if supported but
          creation failed)
        Fix handling of 'any' device, so that it can be opened, and no longer
          attempt to open it in Monitor mode
        Add support for snapshot length for USB Memory-Mapped Interface
        Fix configure and build on recent Linux kernels
        Fix memory-mapped Linux capture to support pcap_next() and
          pcap_next_ex()
        Fixes for Linux USB capture
        DLT: Add DLT_LINUX_EVDEV
        DLT: Add DLT_GSMTAP_UM
        DLT: Add DLT_GSMTAP_ABIS
2010-10-28 16:22:13 +00:00
John Baldwin
b94e6f0ef6 Set bootverbose directly in mi_startup() rather than via a SYSINIT. This
ensures 'bootverbose' is in a valid state for all SYSINITs.

Reported by:	avg
MFC after:	1 week
2010-10-28 14:17:06 +00:00
John Baldwin
89d84a4055 Use 'PCPU_GET(apic_id)' to determine the BSP's APIC ID on a UP machine
when routing interrupts instead of cpu_apic_ids[0] since cpu_apic_ids[]
is only populated for multiple-CPU machines.  This also matches what the
code does when SMP is not enabled.

PR:		bin/151616
Tested by:	"Damian S. Kolodziejczyk"  damkol | gmail
Submitted by:	avg
MFC after:	1 week
2010-10-28 13:44:19 +00:00
Bjoern A. Zeeb
9398643636 Correct a typo.
MFC after:	3 days
2010-10-28 11:09:12 +00:00
Attilio Rao
a3da97926d Merge the mptable support from MD bits to x86 subtree.
Sponsored by:	Sandvine Incorporated
Discussed with:	jhb
2010-10-28 07:58:06 +00:00
Warner Losh
1adaedf5cd Turns out we need functions.sh in this file for convert_to_megabytes call. 2010-10-28 06:45:20 +00:00
Justin T. Gibbs
8f1382d1f2 sys/dev/xen/blkback/blkback.c:
In xbb_detach() only perform cleanup of our taskqueue and
	device statistics structures if they have been initialized.
	This avoids a panic when xbb_detach() is called on a partially
	initialized device instance, due to an early failure in
	attach.

Sponsored by:	Spectra Logic Corporation
2010-10-28 04:14:28 +00:00
David Xu
1200ef56b5 Follow the change made in libthr, add ERANGE error code and more
EINVAL error cases.
2010-10-28 02:59:25 +00:00
Jack F Vogel
35928b338e In the data setup code for doing offloads the
ip and tcp pointers were not reset after some
pullups. In practice this led to an NFS mount
failure when using UDP reported by Kevin Lo,
thanks Kevin. Fix from yongari, thank you!
2010-10-28 00:16:54 +00:00
Jamie Gritton
b81422ef7f Find a jail's type as part of jailparam_init rather than waiting until
it's absolutely necessary.

MFC after:	1 week
2010-10-27 21:01:53 +00:00
Pyun YongHyeon
36fe384754 Use shorten model name and add RTL8168, RTL8111 to the list of
supported device. re(4) had been supported all variants of RTL8168,
RTL8111 and RTL810x. I think this change will cover all controllers
supported by re(4).

MFC after:	1 week
2010-10-27 19:01:09 +00:00
Dag-Erling Smørgrav
1f9d174116 Language cleanup. 2010-10-27 18:48:23 +00:00
Rui Paulo
8399e5f307 Use ${PICFLAG} instead of -fpic. 2010-10-27 18:46:56 +00:00
Hans Petter Selasky
8427ed847d Add support for setting per-interface PnP information.
Submitted by:	Nick Hibma
Approved by:	thompsa (mentor)
2010-10-27 17:38:05 +00:00
Pyun YongHyeon
1108273af4 Add initial BCM5718 family support. The BCM5718 family includes
the dual port BCM5717 and BCM5718 devices which are intended for
mainstream workstation and entry-level server designs and
represents the twelfth generation of NetXtreme Ethernet controllers.
This family is the successor to the BCM5714/BCM5715 family and
supports IPv4/IPv6 checksum offloading, TSO, VLAN hardware tagging,
jumbo frames, MSI/MSIX, IOV, RSS and TSS.

This change set supports all hardware features except IOV and
RSS/TSS. Unlike its predecessors, only extended RX buffer
descriptors can be posted to the jumbo producer ring. Single RX
buffer descriptors for jumbo frame are not supported. RSS requires
a more substantial set of changes and will apply to a larger set
of NetXtreme devices so RSS/TSS multi-queue support will be
implemented in a future releases.

Special thanks to Broadcom who kindly sent a sample board to me
and to davidch who gave provided the initial support code.

Submitted by:	davidch (initial version)
HW donated by:	Broadcom
2010-10-27 17:20:19 +00:00
Pyun YongHyeon
f8d8720ebc Add BCM5717C 10/100/1000TX PHY id. 2010-10-27 17:16:40 +00:00
Xin LI
49727e098f Add a short note about kernel modules in FIXIT mode.
MFC after:	1 month
2010-10-27 17:13:38 +00:00
Alan Cox
92ababa777 [1] According to the x86 architectural specifications, no virtual-to-
physical page mapping should span two or more MTRRs of different types.
Add a pmap function, pmap_demote_DMAP(), by which the MTRR module can
ensure that the direct map region doesn't have such a mapping.

[2] Fix a couple of nearby style errors in amd64_mrset().

[3] Re-enable the use of 1GB page mappings for implementing the direct
map.  (See also r197580 and r213897.)

Tested by:	kib@ on a Westmere-family processor [3]
MFC after:	3 weeks
2010-10-27 16:46:37 +00:00
Jaakko Heinonen
baa0988a1e Correct a typo.
PR:		151321
Submitted by:	Simon Walton
MFC after:	3 days
2010-10-27 14:11:11 +00:00
Jaakko Heinonen
843ab5514d Add missing "readahead" to the nfs_opts list.
PR:		151321
Tested by:	Simon Walton
MFC after:	2 weeks
2010-10-27 14:08:37 +00:00
Baptiste Daroussin
f631a04d26 Add attachement to my mentors
Reporter by: wxs (on irc)
2010-10-27 12:51:36 +00:00
David Xu
67753965a8 Check small set and reject it, this is how kernel did. Always use the
size kernel is using.
2010-10-27 09:59:43 +00:00
David Xu
4a5478709b - Revert r214409.
- Use long word to figure out sizeof kernel cpuset, hope it works.
2010-10-27 09:29:03 +00:00
Edwin Groothuis
f8768d2a1a Sync code with tzcode2010m
asctime.c:
* Set errno to EINVAL and return "??? ??? ?? ??:??:?? ????\n" if
  asctime_r is called with a NULL struct tm pointer.  (Note that
  asctime_r is called by ctime_r and asctime; asctime is called by
  ctime.)

localtime.c:
* Set errno to EINVAL and return WRONG if time1 is called with a
  NULL struct tm pointer; avoid dereference if a NULL struct tm
  pointer is passed to timelocal, timegm, or timeoff.  (Note that
  time1 is called by mktime, timegm, and timeoff; mktime is called
  by timelocal.)
* more core-avoidance work
* Change to set timezone and altzone based on time types with
  greatest transition times (for the benefit of Asia/Seoul).

zic.8:
* Warning about case-sensitivity of names, but not of abbrevations

zic.c:
* Conditionally output extra types with most-recently-use offsets
  last (for use by systems with pre-2011 versions of localtime.c,
  helping to ensure that globals "altzone and "timezone" get set
  correctly).

The code has been running for nearly four weeks on my laptop running
FreeBSD 8.1 without a problem.

MFC after:	1 month
2010-10-27 07:14:46 +00:00
David Xu
e96b4de80e Remove locking and unlock in pthread_mutex_destroy, because
it can not fix race condition in application code, as a result,
the problem described in PR threads/151767 is avoided.
2010-10-27 04:19:07 +00:00
David Xu
1676b42546 If input parameter cpusetsize is zero, give userland size of cpuset mask
kernel is using.
2010-10-27 02:32:54 +00:00
Rick Macklem
c5dd9d8c37 Add a flag to the experimental NFSv4 client to indicate when
delegations are being returned for reasons other than a Recall.
Also, re-organize nfscl_recalldeleg() slightly, so that it leaves
clearing NMODIFIED to the ncl_flush() call and invalidates the
attribute cache after flushing. It is hoped that these changes
might fix the problem others have seen when using the NFSv4
client with delegations enabled, since I can't reliably reproduce
the problem. These changes only affect the client when doing NFSv4
mounts with delegations enabled.

MFC after:	10 days
2010-10-26 23:18:37 +00:00
Pawel Jakub Dawidek
240dd5b5aa Use fprintf(stderr) instead of gctl_error() to print a warning about too
big sector size. When gctl error is set gctl_has_param() always returns
'false', which prevents geli(8) from finding some arguments and also masks
an error, which is generates in such case.

MFC after:	3 days
2010-10-26 22:46:15 +00:00
Jung-uk Kim
66f369d023 Document newly added loader tunables "hw.acpi.install_interface" and
"hw.acpi.remove_interface".
2010-10-26 21:22:55 +00:00
John Baldwin
c02999d982 - Save errno values before calling warn(3) so that errors are correctly
reported.
- Use powerof2() from <sys/param.h> rather than a copy and paste version.

Submitted by:	gcooper
MFC after:	1 week
2010-10-26 19:11:09 +00:00
Rebecca Cran
827f816c80 Fix formatting.
Reported by: yongari
2010-10-26 19:10:59 +00:00