Commit Graph

168183 Commits

Author SHA1 Message Date
jilles
2ae15286ba sh: Tweak some string constants to reduce code size.
* Reduce some needless differences.
* Shorten some error messages that should not happen.
2010-10-29 21:44:43 +00:00
rpaulo
f19465b84d Add a ${.CURDIR} reference to the previous commit.
Submitted by:	dim
2010-10-29 21:24:56 +00:00
rpaulo
bd0a652fbe Use pcap's bpf header, not our own copy of it. 2010-10-29 21:23:34 +00:00
jilles
038f244ca5 sh: Reject function names ending in one of !%*+-=?@}~
These do something else in ksh: name=(...) is an array or compound variable
assignment and the others are extended patterns.

This is the last patch of the ones tested in the exp run.

Exp-run done by:	pav (with some other sh(1) changes)
2010-10-29 21:20:56 +00:00
rpaulo
34092e2279 Force include ../../libpcap/config.h since privsep.c groks pcap's
internals.
2010-10-29 21:20:14 +00:00
jilles
f98d5a366d sh: Detect various additional errors in the parser.
Apart from detecting breakage earlier or at all, this also fixes a segfault
in the testsuite. The "handling" of the breakage left an invalid internal
representation in some cases.

Examples:
  echo a; do echo b
  echo `) echo a`
  echo `date; do do do`

Exp-run done by:	pav (with some other sh(1) changes)
2010-10-29 21:06:57 +00:00
rpaulo
c04eb1485e Add print-ipnet.c
Submitted by:	dim
2010-10-29 21:03:59 +00:00
rpaulo
6e03579118 add pcap-common.c.
Submitted by:	dim
2010-10-29 20:54:04 +00:00
marius
92a0242e8e - When resetting pm_active and pm_context of a pmap in pmap_pinit() we
need locking as otherwise we may race against the other parts of the
  MD code which expects a consistent state of these. While at it move
  the resetting of the pmap before entering it in the TSB.
- Spell a 0 as TLB_CTX_KERNEL.
2010-10-29 20:51:30 +00:00
marius
430f89aef8 Partially revert r203829; as it turns out what the PowerPC OFW loader did
was incorrect as further down the road cons_probe() calls malloc() so the
former can't be called before init_heap() has succeed. Instead just exit
to the firmware in case init_heap() fails like OF_init() does when hitting
a problem as we're then likely running in a very broken environment where
hardly anything can be trusted to work.
2010-10-29 20:42:02 +00:00
jilles
b6e7fcf97b sh: Error out on various specials/keywords in the wrong place in backticks.
Example:
  echo `date)`

Exp-run done by:	pav (with some other sh(1) changes)
Obtained from:		NetBSD (Christos Zoulas, NetBSD PR 11317)
2010-10-29 20:23:41 +00:00
jilles
aaa3347e35 sh: Fix some issues with CTL* bytes and ${var#pat}.
subevalvar() incorrectly assumed that CTLESC bytes were present iff the
expansion was quoted. However, they are present iff various processing such
as word splitting is to be done later on.

Example:
  v=@$e@$e@$e@
  y="${v##*"$e"}"
  echo "$y"
failed if $e contained the magic CTLESC byte.

Exp-run done by:	pav (with some other sh(1) changes)
2010-10-29 19:34:57 +00:00
jhb
fb52bdc70d Remove support for creating the 'machine' symlink as well as creating the
extra MACHINE_ARCH symlink for certain platforms (such as pc98).  The
support for creating these symlinks was added to sys/conf/kern.post.mk in
changeset 152964.  The intention of that commit was to remove this code
from config(8), but config(8) was never updated.

Approved by:	imp
2010-10-29 19:17:07 +00:00
trasz
81e925ec28 Fix uninitialized variable.
Found with:	Coverity Prevent(tm)
CID:		8632
2010-10-29 19:07:36 +00:00
rpaulo
e11759c217 Remove more unused files. 2010-10-29 18:56:51 +00:00
rpaulo
e2646b8f68 Remove unused files. 2010-10-29 18:50:38 +00:00
rpaulo
b59caae5ab Update for libpcap-1.1.1. 2010-10-29 18:45:10 +00:00
rpaulo
22f795f2fd Merge libpcap-1.1.1. 2010-10-29 18:43:23 +00:00
rpaulo
2631ae0f3d Sync DLTs with the latest pcap version. 2010-10-29 18:41:09 +00:00
attilio
932f62cd88 Merging mptable under x86 left this option undefined for amd64 case.
Fix that.

Sponsored by:	Sandvine Incorporated
Reported by:	jkim
2010-10-29 18:38:36 +00:00
attilio
62fe941c60 - Merge ram_attach() implementation for i386 and amd64
- Rename RES_BUS_SPACE_* into BUS_SPACE_* for consistency
- Trim out an unnecessary checking condition

Sponsored by:	Sandvine Incorporated
Requested and reviewed by:	jhb
2010-10-29 18:33:43 +00:00
jh
06e9f5ed89 - Note that non-superusers are not allowed to set the SF_ARCHIVED
flag. [1]
- Note that also fchflags(2) will return EPERM for attempts to set or
  unset the SF_SNAPSHOT flag.

Submitted by:	Garrett Cooper [1]
MFC after:	1 week
2010-10-29 15:03:29 +00:00
rmacklem
02fc29905a Modify nfs_open() in the experimental NFS client to be compatible
with the regular NFS client. Also, fix a couple of mutex lock issues.

MFC after:	1 week
2010-10-29 13:46:21 +00:00
jilles
28ad180ab4 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
rmacklem
b6cd17990d 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
davidxu
a5ea18413e 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
glebius
192d172d5b Remove meaningless XXXXX, that is a remain of comment, removed in r186200. 2010-10-29 11:13:42 +00:00
glebius
20ab72ce86 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
davidxu
f8b62a4759 Return previous sigaction correctly.
Submitted by:	avg
2010-10-29 09:35:36 +00:00
davidxu
fa0e722e16 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
nwhitehorn
d508714b76 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
nwhitehorn
9322be1c23 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
nwhitehorn
4da7d606a2 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
6f54496b16 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
uqs
07e9b6a42f Fix another "string" typo.
MFC after:	3 days
2010-10-28 22:28:45 +00:00
jilles
8e66c8e658 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
uqs
14c0facba5 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
rpaulo
0e642ca0cb Remove useless stuff. 2010-10-28 19:10:15 +00:00
rpaulo
4985537637 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
rpaulo
1e8ad3bd80 Merge tcpdump-4.1.1. 2010-10-28 19:06:17 +00:00
attilio
7ab661360c 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
rpaulo
5f4de8e61a 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
rpaulo
724e1a0159 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
jhb
3f3b4d105f 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
jhb
c1f742a56c 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
bz
a63e742296 Correct a typo.
MFC after:	3 days
2010-10-28 11:09:12 +00:00
attilio
0237c602c6 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
imp
745b9bbae7 Turns out we need functions.sh in this file for convert_to_megabytes call. 2010-10-28 06:45:20 +00:00
gibbs
14b10376c4 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
davidxu
a37038ef41 Follow the change made in libthr, add ERANGE error code and more
EINVAL error cases.
2010-10-28 02:59:25 +00:00