]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/log
FreeBSD/FreeBSD.git
12 years agoFix some memory errors in *at() regression tests.
jilles [Tue, 18 Oct 2011 22:51:40 +0000 (22:51 +0000)]
Fix some memory errors in *at() regression tests.

12 years agoAllow to dump on Solaris swap partitions.
marius [Tue, 18 Oct 2011 20:16:02 +0000 (20:16 +0000)]
Allow to dump on Solaris swap partitions.

PR: 161764
Submitted by: Peter Jeremy

12 years agoThe current /etc/dumpdates file restricts device names to 32 characters.
mckusick [Tue, 18 Oct 2011 18:42:26 +0000 (18:42 +0000)]
The current /etc/dumpdates file restricts device names to 32 characters.
With the addition of various GEOM layers some device names now exceed
this length, for example /dev/mirror/encrypted.elig.journal. This
change expands the field to 53 bytes which brings the /etc/dumpdates
lines to 80 characters. Exceeding 80 characters makes the /etc/dumpdates
file much less human readable. A test is added to dump so that it
verifies that the device name will fit in the 53 character field
failing the dump if it is too long.

This change has been checked to verify that its /etc/dumpdates file
is compatible with older versions of dump.

Reported by: Martin Sugioarto <martin@sugioarto.com>
PR:          kern/160678
MFC after:   3 weeks

12 years agoUpdate gcc's __FreeBSD__ and __FreeBSD_cc_version macros for FreeBSD 10.
dim [Tue, 18 Oct 2011 17:38:25 +0000 (17:38 +0000)]
Update gcc's __FreeBSD__ and __FreeBSD_cc_version macros for FreeBSD 10.

12 years agoFix the way clang retrieves the major FreeBSD release number from the
dim [Tue, 18 Oct 2011 17:37:18 +0000 (17:37 +0000)]
Fix the way clang retrieves the major FreeBSD release number from the
target triple, so that the __FreeBSD__ and __FreeBSD_cc_version builtin
macros return the expected results.

Spotted by: nalitoja at gmail.com

12 years agoFix wakeup latency when sleeping with 'wait'
jchandra [Tue, 18 Oct 2011 16:37:28 +0000 (16:37 +0000)]
Fix wakeup latency when sleeping with 'wait'

If we handle an interrupt just before the 'wait' and the interrupt
schedules some work, we need to skip the 'wait' call. The simple solution
of calling sched_runnable() with interrupts disabled immediately before
wait still leaves a window after the call and before 'wait' in which
the same issue can occur.

The solution implemented is to check the EPC in the interrupt handler, and
if it is in a region before the 'wait' call, to fix up the EPC to skip the
wait call.

Reported/analysed by: adrian
Fix suggested by: kib

Reviewed by: jmallett, imp

12 years agoAdd a flush of the current PMC log buffer before displaying the next top.
fabient [Tue, 18 Oct 2011 15:25:43 +0000 (15:25 +0000)]
Add a flush of the current PMC log buffer before displaying the next top.

As the underlying block is 4KB if the PMC throughput is low the measurement
will be reported on the next tick. pmcstat(8) use the modified flush API to
reclaim current buffer before displaying next top.

MFC after: 1 month

12 years agoFix XLP compile failure on n32 abi.
jchandra [Tue, 18 Oct 2011 14:05:18 +0000 (14:05 +0000)]
Fix XLP compile failure on n32 abi.

Reported by: bz@

12 years agoImport fix for Illumos bug #1475 to reduce diff against upstream.
mm [Tue, 18 Oct 2011 13:58:22 +0000 (13:58 +0000)]
Import fix for Illumos bug #1475 to reduce diff against upstream.

Panic caused by this bug was already partially fixed by pjd@
in p4 CH 185940 and 185942.

Reference:
1475 zfs spill block hold can access invalid spill blkptr
https://www.illumos.org/issues/1475

Reviewed by: delphij
Obtained from: Illumos (issue 1475, changeset 13469:b8e89e5c4167)
MFC after: 1 week

12 years agoComment out the sbp(4) driver for architectures that support it.
kensmith [Tue, 18 Oct 2011 13:45:16 +0000 (13:45 +0000)]
Comment out the sbp(4) driver for architectures that support it.

As part of the 8.0-RELEASE cycle this was done in stable/8 (r199112)
but was left alone in head so people could work on fixing an issue that
caused boot failure on some motherboards.  Apparently nobody has worked
on it and we are getting reports of boot failure with the 9.0 test builds.
So this time I'll comment out the driver in head (still hoping someone
will work on it) and MFC to stable/9.

Submitted by: Alberto Villa <avilla at FreeBSD dot org>

12 years agoWhen calculating the width of the blocksize column, ls(1) used 512-byte
des [Tue, 18 Oct 2011 13:10:46 +0000 (13:10 +0000)]
When calculating the width of the blocksize column, ls(1) used 512-byte
units (as returned by stat(2)) instead of BLOCKSIZE units.

Submitted by: Paul Schenkeveld
MFC after: 3 weeks

12 years agoEscape the newline so we get a proper line continuation. Without this
kensmith [Tue, 18 Oct 2011 11:29:10 +0000 (11:29 +0000)]
Escape the newline so we get a proper line continuation.  Without this
the text of the menu selections doesn't get displayed properly and it
makes the installer appear to lock up for no obvious reason.

Reviewed by: nwhitehorn

12 years agoLook for /boot/config in addition to /boot.config, with the former taking
des [Tue, 18 Oct 2011 09:46:52 +0000 (09:46 +0000)]
Look for /boot/config in addition to /boot.config, with the former taking
precedence over the latter if it exists.

MFC after: 3 weeks

12 years agoFix copy-pasto in CAPFAIL_INCREASE case.
des [Tue, 18 Oct 2011 09:39:41 +0000 (09:39 +0000)]
Fix copy-pasto in CAPFAIL_INCREASE case.

Noticed by: pjd

12 years agoMake ktrace(1) build cleanly at WARNS level 6 by completely rethinking the
des [Tue, 18 Oct 2011 08:26:12 +0000 (08:26 +0000)]
Make ktrace(1) build cleanly at WARNS level 6 by completely rethinking the
way in which it handles the -C, -c, -g and -p options.

MFC after: 3 weeks

12 years agoMinor clarification
des [Tue, 18 Oct 2011 08:20:36 +0000 (08:20 +0000)]
Minor clarification

MFC after: 3 weeks

12 years agoSimplify df(1) by factoring out most of the common code:
des [Tue, 18 Oct 2011 08:18:26 +0000 (08:18 +0000)]
Simplify df(1) by factoring out most of the common code:

 - In the argc == 0 case, just populate the mount list as before, but
   do not calculate widths, update totals or print anything.

 - In the argv > 0 case, collect information about the requested file
   systems and store it in the mount list, but do not calculate
   widths, update totals or print anything.

 - In either case, once all the information has been collected,
   iterate once through the mount list to calculate widths and totals,
   then once more to print everything.

This also fixes two bugs: firstly, column widths were not calculated
correctly if more than one file system was specified on the command
line; and secondly, file systems with MNT_IGNORE were included in the
totals even if -a was not specified.

Noticed by: Paul Schenkeveld
MFC after: 3 weeks

12 years agoSupport for booting XLP using FDT.
jchandra [Tue, 18 Oct 2011 08:10:23 +0000 (08:10 +0000)]
Support for booting XLP using FDT.

- update xlp_machdep.c to read arguments from FDT if FDT support is
  compiled in.
- define rmi_uart_bus_space, and use it as fdtbus_bs_tag
- update conf files for FDT support
- add default dts file xlp-basic.dts

12 years agoGet rid of D_PSEUDO.
ed [Tue, 18 Oct 2011 08:09:44 +0000 (08:09 +0000)]
Get rid of D_PSEUDO.

It seems the D_PSEUDO flag was meant to allow make_dev() to return NULL.
Nowadays we have a different interface for that; make_dev_p(). There's
no need to keep it there.

While there, remove an unneeded D_NEEDMINOR from the gpio driver.

Discussed with: gonzo@ (gpio)

12 years agoTrace attempts to call restricted MD syscalls.
des [Tue, 18 Oct 2011 07:39:27 +0000 (07:39 +0000)]
Trace attempts to call restricted MD syscalls.

12 years agoTrace attempts to open a portal device.
des [Tue, 18 Oct 2011 07:31:49 +0000 (07:31 +0000)]
Trace attempts to open a portal device.

Ceterum censeo portalfs esse delendam.

12 years agoFDT support for MIPS.
jchandra [Tue, 18 Oct 2011 07:29:21 +0000 (07:29 +0000)]
FDT support for MIPS.

Add architecture specific files needed to compile MIPS with
flattened device tree support.

12 years agoRevisit the capability failure trace points. The initial implementation
des [Tue, 18 Oct 2011 07:28:58 +0000 (07:28 +0000)]
Revisit the capability failure trace points.  The initial implementation
only logged instances where an operation on a file descriptor required
capabilities which the file descriptor did not have.  By adding a type enum
to struct ktr_cap_fail, we can catch other types of capability failures as
well, such as disallowed system calls or attempts to wrap a file descriptor
with more capabilities than it had to begin with.

12 years agoAdd in a currently-disabled WAR for PCI NICs.
adrian [Tue, 18 Oct 2011 03:32:18 +0000 (03:32 +0000)]
Add in a currently-disabled WAR for PCI NICs.

Some earlier series (~AR5212?) play badly with BIOSes.

In these instances, they may require a forced reset (by transitioning
the NIC through D0 -> D3 -> D0) before they probe/attach correctly.

This is currently disabled because:

* I haven't figured out the "right" code to ensure this only happens
  for PCI NICs (not PCIe or Cardbus);
* I haven't at all done wide scale testing for this, and I'm not yet
  ready for said wide-scale testing.

I'm documenting this primarily so users with misbehaving NICs have
something to tinker with.

Obtained from: Atheros

12 years agoAdd a WAR from the reference code - clear the PCI error status
adrian [Tue, 18 Oct 2011 03:24:17 +0000 (03:24 +0000)]
Add a WAR from the reference code - clear the PCI error status
upon detach.

Obtained from: Atheros

12 years agoPort over some missing code from the ar5212 reference driver reset path.
adrian [Tue, 18 Oct 2011 03:17:06 +0000 (03:17 +0000)]
Port over some missing code from the ar5212 reference driver reset path.

The final missing bit here is enabling the PCI configuration register
read, but there's currently no glue available for the HAL to read (and
write) PCI configuration space registers.

Obtained from: Atheros

12 years agoImplement the first part of the BB read workaround.
adrian [Tue, 18 Oct 2011 03:01:41 +0000 (03:01 +0000)]
Implement the first part of the BB read workaround.

The AR5008/AR9001 series NICs have a bug where BB register reads
will occasionally be corrupted. This could cause issues with things
such as ANI, which adjust operational parameters based on the
BB radio register reads. This was introduced in the AR5008 chip
and fixed with the first released AR9002 series NIC (AR9280v2.)

A followup commit will implement the acutal WAR when reading
BB registers. I'm still not sure how I'll implement it - whether
it should be done in the osdep layer, or whether it should just
live in the AR5416 HAL. Either way, they can use this capability
bit to determine whether to implement the WAR or not.

Thankyou to various sources inside Atheros who have helped me track
down what this particular issue is.

Obtained from: Atheros

12 years agoAdd in OS_REG_BIT_SET, a macro which does what it says it does.
adrian [Tue, 18 Oct 2011 02:46:26 +0000 (02:46 +0000)]
Add in OS_REG_BIT_SET, a macro which does what it says it does.

This will be used in an upcoming commit to the ar5212 HAL.

12 years agoInclude opt_ah.h when compiling the driver.
adrian [Tue, 18 Oct 2011 02:43:59 +0000 (02:43 +0000)]
Include opt_ah.h when compiling the driver.

There are HAL methods which are actually direct register
access, rather than simply HAL calls. Because of this, these
register accesses would use the non-debug path in ah_osdep.h
as opt_ah.h isn't included.

With this, the correct register access methods are used,
so debugging traces show things such as TXDP checking and
TSF32 access.

12 years agoFix a bug in sa_find_sizes() which could lead to panic:
delphij [Mon, 17 Oct 2011 22:23:27 +0000 (22:23 +0000)]
Fix a bug in sa_find_sizes() which could lead to panic:

When calculating space needed for SA_BONUS buffers,
hdrsize is always rounded up to next 8-aligned boundary.
However, in two places the round up was done against
sum of 'total' plus hdrsize.  On the other hand,
hdrsize increments by 4 each time, which means in
certain conditions, we would end up returning with
will_spill == 0 and (total + hdrsize) larger than
full_space, leading to a failed assertion because
it's invalid for dmu_set_bonus.

Sponsored by: iXsystems, Inc.
Reviewed by: mm
MFC after: 3 days

12 years ago- remove device keyword from makefs manpage
eadler [Mon, 17 Oct 2011 21:31:03 +0000 (21:31 +0000)]
- remove device keyword from makefs manpage

PR: docs/144408
Submitted by: gcooper
Approved by: gjb
Approved by: sahil (mentor)
MFC after: 1 week

12 years agoMake sure to report media change status to caller. Previously it
yongari [Mon, 17 Oct 2011 20:03:38 +0000 (20:03 +0000)]
Make sure to report media change status to caller. Previously it
always reported success.

12 years agoAdd missing driver lock in media status handler.
yongari [Mon, 17 Oct 2011 19:58:34 +0000 (19:58 +0000)]
Add missing driver lock in media status handler.

12 years agoClose a race where SIOCGIFMEDIA ioctl get inconsistent link status.
yongari [Mon, 17 Oct 2011 19:51:38 +0000 (19:51 +0000)]
Close a race where SIOCGIFMEDIA ioctl get inconsistent link status.
Because driver is accessing a common MII structure in
mii_pollstat(), updating user supplied structure should be done
before dropping a driver lock.

Reported by: Karim (fodillemlinkarimi <> gmail dot com)

12 years agoClose a race where SIOCGIFMEDIA ioctl get inconsistent link status.
yongari [Mon, 17 Oct 2011 19:49:00 +0000 (19:49 +0000)]
Close a race where SIOCGIFMEDIA ioctl get inconsistent link status.
Because driver is accessing a common MII structure in
mii_pollstat(), updating user supplied structure should be done
before dropping a driver lock.

Reported by: Karim (fodillemlinkarimi <> gmail dot com)

12 years agoFix whitespace.
ed [Mon, 17 Oct 2011 19:40:26 +0000 (19:40 +0000)]
Fix whitespace.

12 years agoReturn BUS_PROBE_DEFAULT instead of 0 (BUS_PROBE_SPECIFIC), allowing
delphij [Mon, 17 Oct 2011 19:21:42 +0000 (19:21 +0000)]
Return BUS_PROBE_DEFAULT instead of 0 (BUS_PROBE_SPECIFIC), allowing
vendor provided driver to override in kernel driver.

MFC after: 3 days

12 years agoUpdate llvm/clang's target triple (confusingly named LLVM_HOSTTRIPLE) to
dim [Mon, 17 Oct 2011 18:30:18 +0000 (18:30 +0000)]
Update llvm/clang's target triple (confusingly named LLVM_HOSTTRIPLE) to
$arch-unknown-freebsd10.0.

12 years agoMake the usbdump utility work again by using the correct BPF structures.
hselasky [Mon, 17 Oct 2011 15:54:20 +0000 (15:54 +0000)]
Make the usbdump utility work again by using the correct BPF structures.

MFC after: 3 days

12 years agoAdd missing default values for daily/800.scrub-zfs for documentation
se [Mon, 17 Oct 2011 14:37:24 +0000 (14:37 +0000)]
Add missing default values for daily/800.scrub-zfs for documentation
purposes. No functional change, since all parameters are set to their
default values.
MFC after: 1 week

12 years agoFix error message in case the backup storage directory does not exist and
se [Mon, 17 Oct 2011 14:33:41 +0000 (14:33 +0000)]
Fix error message in case the backup storage directory does not exist and
cannot be created ($daily_backup_pkgdb_dbdir -> $daily_backup_pkgdb_dir).
MFC after: 1 week

12 years agoDon't enable the PHY radar errors in calcrxfilter.
adrian [Mon, 17 Oct 2011 14:17:37 +0000 (14:17 +0000)]
Don't enable the PHY radar errors in calcrxfilter.
That way the radar errors aren't enabled prematurely.

A DFS tester has reported that radar events are reported
during channel scanning, before DFS is actually enabled.

12 years agoSort header file names.
ed [Mon, 17 Oct 2011 13:54:55 +0000 (13:54 +0000)]
Sort header file names.

Spotted by: des

12 years agoFix build after r226465.
bz [Mon, 17 Oct 2011 13:51:00 +0000 (13:51 +0000)]
Fix build after r226465.
Cast void * to char * for arithmetics and make function return "no error".

MFC after: 3 days

12 years agoFDT changes for 64 bit kernel
jchandra [Mon, 17 Oct 2011 13:44:33 +0000 (13:44 +0000)]
FDT changes for 64 bit kernel

Use the offset into the device tree from fdtp as the phandle instead
of using pointer into the device tree.  This will make sure that the
phandle fits into a uint32_t type, even when compiled for 64bit.

Reviewed by: raj, nathanw, marcel

12 years agoFix an issue with 11g beacon frames which looks to be a limitation
adrian [Mon, 17 Oct 2011 13:12:47 +0000 (13:12 +0000)]
Fix an issue with 11g beacon frames which looks to be a limitation
on the largest multi-write size.

From the submitter:

==
I looked further into the magic 88-byte threshold after which the bug
occurs.  It turns out that figure included the 24-byte tx_desc, and up
to 64 bytes of beacon frame (header+data).

rum_write_multi doesn't seem happy with writing >64 bytes at a time to
the MAC register.  If I break it up into separate calls (e.g. bytes
0-63, then bytes 64-65, written at the appropriate offset) I see the
proper beacon frames being transmitted now.
==

Submitted by: Steven Chamberlain <steven@pyro.eu.org>
MFC after: 3 days

12 years agoThe rc_force test was inverted in the previous commit, so that dhclient ran
des [Mon, 17 Oct 2011 13:05:57 +0000 (13:05 +0000)]
The rc_force test was inverted in the previous commit, so that dhclient ran
for interfaces which were not configured for DHCP *unless* rc_force was set;
the correct logic is to run dhclient for those interfaces *only if* rc_force
is set.

Broken by: des@
Noticed by: everybody and his dog
Submitted by: rea@
PR: bin/161733

12 years agoAllow to specify pidfile in HAST configuration file.
pjd [Mon, 17 Oct 2011 12:22:09 +0000 (12:22 +0000)]
Allow to specify pidfile in HAST configuration file.

MFC after: 1 week

12 years agoRemove redundant space.
pjd [Mon, 17 Oct 2011 09:59:04 +0000 (09:59 +0000)]
Remove redundant space.

MFC after: 1 week

12 years agoWhen path to the configuration file is relative, obtain full path,
pjd [Mon, 17 Oct 2011 09:54:07 +0000 (09:54 +0000)]
When path to the configuration file is relative, obtain full path,
so we can always find the file, even after daemonizing and changing
working directory to /.

MFC after: 1 week

12 years agoIt's no longer accurate to say that math.h "constitute[s] the C math
das [Mon, 17 Oct 2011 06:10:32 +0000 (06:10 +0000)]
It's no longer accurate to say that math.h "constitute[s] the C math
library," since complex.h, tgmath.h, and fenv.h are also part of the
math library.  Replace the outdated sentence with some references to
the other parts.

12 years agoFix for crash on MIPS /dev/mem read.
jchandra [Mon, 17 Oct 2011 05:42:53 +0000 (05:42 +0000)]
Fix for crash on MIPS /dev/mem read.

Reading /dev/mem in 64 bit kernel crashes.  This is because the page
used to call uiomove_fromphys() from memrw() does not have md.pv_list
initialized correctly.

The fix is to call pmap_page_init() on the page to initialize it.

12 years agoAdd c{cos,sin,tan}{,h}{,f} functions. This is joint work with
das [Mon, 17 Oct 2011 05:41:03 +0000 (05:41 +0000)]
Add c{cos,sin,tan}{,h}{,f} functions.  This is joint work with
bde and kargl.

12 years agoAdd syntactic sugar missed in r226437 and then not added either when moving
bz [Mon, 17 Oct 2011 00:05:31 +0000 (00:05 +0000)]
Add syntactic sugar missed in r226437 and then not added either when moving
things around in r226448 but desperately needed to always make things
compile successfully.

MFC after: 1 week

12 years agoThe code change made in r226040 was incomplete and resulted in
qingli [Sun, 16 Oct 2011 22:24:04 +0000 (22:24 +0000)]
The code change made in r226040 was incomplete and resulted in
routes such as fe80::1%lo0 no being installed. This patch completes
the original intended fix.

Reviewed by: hrs, bz
MFC after: 3 days

12 years agoDefine dtrace_cmpset_long in terms of atomic_cmpset_long
marcel [Sun, 16 Oct 2011 22:18:08 +0000 (22:18 +0000)]
Define dtrace_cmpset_long in terms of atomic_cmpset_long
and not by virtue of inline assembly. Now this file
compiles on all supported architectures.

12 years agoThe IPv6 code was influx at the time of r196865 due to the L2/L3
qingli [Sun, 16 Oct 2011 22:15:13 +0000 (22:15 +0000)]
The IPv6 code was influx at the time of r196865 due to the L2/L3
separation rewrite changes. r196865 was committed to fix a scope
violation problem in the following test scenario:

  box-1# ifconfig em0 inet6 2001:db8:1:: prefixlen 64 anycast
  box-1# ifconfig em1 inet6 2001:db8:2::1 prefixlen 64

  box-2# ifconfig re0 inet6 2001:db8:1::6 prefixlen 64

  em0 and re0 are on the same link.

  box-2# ping6 2001:db8:1::
  PING6(56=40+8+8 bytes) 2001:db8:1::6 --> 2001:db8:1::

the ICMPv6 response should have a source address of em1, which
is 2001:db8:2::1, not the link-local address of em0.

That code is no longer necessary and breaks the IPv6-Ready logo
testing, so revert it now.

Reviewed by: hrs
MFC after: 3 days

12 years agoIn pidfile_open(), if the pidfile is locked, but empty (PID is not stored yet)
pjd [Sun, 16 Oct 2011 21:30:15 +0000 (21:30 +0000)]
In pidfile_open(), if the pidfile is locked, but empty (PID is not stored yet)
and the caller requested other process' PID by passing non-NULL pidptr
argument, we will wait at most 100ms for the PID to show up in the file and if
it won't, we will store -1 in *pidptr.

From now on, pidfile_open() function never sets errno to EAGAIN on failure.

In collaboration with: des
MFC after: 1 week

12 years agoAdd support for special keys (volume/brightness/eject) on Apple laptops with
nwhitehorn [Sun, 16 Oct 2011 21:01:42 +0000 (21:01 +0000)]
Add support for special keys (volume/brightness/eject) on Apple laptops with
ADB keyboards.

Submitted by: Justin Hibbits <jrh29 at alumni dot cwru dot edu>
MFC after: 9.0-RELEASE

12 years agoMove the tcp_sendspace and tcp_recvspace sysctl's from
andre [Sun, 16 Oct 2011 20:18:39 +0000 (20:18 +0000)]
Move the tcp_sendspace and tcp_recvspace sysctl's from
the middle of tcp_usrreq.c to the top of tcp_output.c
and tcp_input.c respectively next to the socket buffer
autosizing controls.

MFC after: 1 week

12 years agoRemove the ss_fltsz and ss_fltsz_local sysctl's which have
andre [Sun, 16 Oct 2011 20:06:44 +0000 (20:06 +0000)]
Remove the ss_fltsz and ss_fltsz_local sysctl's which have
long been superseded by the RFC3390 initial CWND sizing.

Also remove the remnants of TCP_METRICS_CWND which used the
TCP hostcache to set the initial CWND in a non-RFC compliant
way.

MFC after: 1 week

12 years agoFix a problem that an interface unexpectedly becomes IFF_UP by
hrs [Sun, 16 Oct 2011 19:46:52 +0000 (19:46 +0000)]
Fix a problem that an interface unexpectedly becomes IFF_UP by
just doing "ifconfing inet6 -ifdisabled" when the interface has
ND6_IFF_AUTO_LINKLOCAL flag and no link-local address.

12 years agoAdd missing #include.
ed [Sun, 16 Oct 2011 19:23:43 +0000 (19:23 +0000)]
Add missing #include.

Note to myself: don't write patches while watching a movie.

12 years agoDon't cast SIZE_T_MAX to off_t.
ed [Sun, 16 Oct 2011 19:15:25 +0000 (19:15 +0000)]
Don't cast SIZE_T_MAX to off_t.

I focused so much on the 32-bits case where we have to cast SIZE_T_MAX
up in size, that I forgot about the 64-bits case, where off_t and size_t
are equal in size. Simply cast both numbers to uintmax_t, as we can
assume st_size is never negative.

Reported by: cperciva

12 years agoFix 2 bugs :
cognet [Sun, 16 Oct 2011 17:59:28 +0000 (17:59 +0000)]
Fix 2 bugs :

- A race condition could happen if two threads were using RAS at the same time
as the code didn't reset RAS_END, the RAS code could believe we were not in
a RAS, when we were in fact.
- Using signed value logic to compare addresses wasn't such a good idea.

Many thanks to Ian to investigate on these issues.

Pointy hat to:  cognet
PR: arm/161498
Submitted by: Ian Lepore <freebsd At damnhippie DOT dyndns dot org
MFC after: 1 week

12 years agoRevert r226398 and instead move the allocation of usrbufs after the error check.
brueffer [Sun, 16 Oct 2011 17:38:20 +0000 (17:38 +0000)]
Revert r226398 and instead move the allocation of usrbufs after the error check.

Suggested by: pjd
MFC after: 1 week

12 years agoExplicitely set ARM_RAS_START and ARM_RAS_END once the cacheline or the
cognet [Sun, 16 Oct 2011 17:37:54 +0000 (17:37 +0000)]
Explicitely set ARM_RAS_START and ARM_RAS_END once the cacheline or the
page has been allocated, or we could end up using random values, and bad things
could happen.

PR: arm/161492
Submitted by: Ian Lepore <freebsd AT damnhippie dot dyndns DOT org>
MFC after: 1 week

12 years agoUnbreak NO_DYNAMICROOT by explicitely linking to libcrypto if MK_OPENSSL isn't
cognet [Sun, 16 Oct 2011 16:58:28 +0000 (16:58 +0000)]
Unbreak NO_DYNAMICROOT by explicitely linking to libcrypto if MK_OPENSSL isn't
set to no, as libbsnmp needs it.

12 years agoPlace quotes around the output of kbdmap(1), designed to be pasted into
nwhitehorn [Sun, 16 Oct 2011 16:05:23 +0000 (16:05 +0000)]
Place quotes around the output of kbdmap(1), designed to be pasted into
/etc/rc.conf.

PR: bin/161711
Submitted by: manolis
MFC after: 1 week

12 years agoVNET virtualize tcp_sendspace/tcp_recvspace and change the
andre [Sun, 16 Oct 2011 15:08:43 +0000 (15:08 +0000)]
VNET virtualize tcp_sendspace/tcp_recvspace and change the
type to INT.  A long is not necessary as the TCP window is
limited to 2**30.  A larger initial window isn't useful.

MFC after: 1 week

12 years ago- change "is is" to "is" or "it is"
eadler [Sun, 16 Oct 2011 14:30:28 +0000 (14:30 +0000)]
- change "is is" to "is" or "it is"
- change "the the" to "the"

Approved by: lstewart
Approved by: sahil (mentor)
MFC after: 3 days

12 years agoFix double vision syndrome (read: double output) when in the
marcel [Sun, 16 Oct 2011 14:16:46 +0000 (14:16 +0000)]
Fix double vision syndrome (read: double output) when in the
debugger without a panic.

12 years agoo Use C99 designated initializer to properly handle ELFOSABI_STANDALONE.
marcel [Sun, 16 Oct 2011 14:11:05 +0000 (14:11 +0000)]
o  Use C99 designated initializer to properly handle ELFOSABI_STANDALONE.
o  In elf_get_byte(), cast through uint8_t and not char to avoid sign
   extension.

12 years agoUpdate the comment and description of tcp_sendspace and tcp_recvspace
andre [Sun, 16 Oct 2011 13:54:46 +0000 (13:54 +0000)]
Update the comment and description of tcp_sendspace and tcp_recvspace
to better reflect their purpose.
MFC after: 1 week

12 years agoForward declare mbuf and inpcb.
ed [Sun, 16 Oct 2011 10:58:00 +0000 (10:58 +0000)]
Forward declare mbuf and inpcb.

This fixes a compiler warning at WARNS=6 when including the header files
as follows:

#include <sys/types.h>
#include <netinet/in.h>
#include <netinet/ip_var.h>
#include <netinet/udp.h>
#include <netinet/udp_var.h>

12 years agoAdjust posix_memalign() prototype to match what we define in stdlib.h for
stefanf [Sun, 16 Oct 2011 10:14:33 +0000 (10:14 +0000)]
Adjust posix_memalign() prototype to match what we define in stdlib.h for
C++ compilation.

PR: standards/147210

12 years agoFix ncplist to build with WARNS=6.
ed [Sun, 16 Oct 2011 10:00:28 +0000 (10:00 +0000)]
Fix ncplist to build with WARNS=6.

Add some const and static keywords to get it all to build. Also add
missing #includes.

12 years agoUndo r226423.
ed [Sun, 16 Oct 2011 09:09:33 +0000 (09:09 +0000)]
Undo r226423.

It seems su does build without warnings, but it requires a small fix to
libbsm headers, which I have not committed to SVN yet.

12 years agoBuild rwho(1) with WARNS=6.
ed [Sun, 16 Oct 2011 08:54:41 +0000 (08:54 +0000)]
Build rwho(1) with WARNS=6.

The only reason why it didn't build with WARNS=6, is because of some
simple to fix string formatting bugs.

MFC after: 3 months

12 years agoChange the SDP_GET* macros to cast to a const buffer.
ed [Sun, 16 Oct 2011 08:45:16 +0000 (08:45 +0000)]
Change the SDP_GET* macros to cast to a const buffer.

This fixes a compiler warning when passing a const buffer to them.

12 years agoChange ncp_scan_bindery_object() to pass a constant search string.
ed [Sun, 16 Oct 2011 08:44:03 +0000 (08:44 +0000)]
Change ncp_scan_bindery_object() to pass a constant search string.

The ncp_scan_bindery_object() function does not modify search_string
internally, so there is no need to declare it as `char *'.

12 years agoUse integer to store the result of getch().
ed [Sun, 16 Oct 2011 08:36:10 +0000 (08:36 +0000)]
Use integer to store the result of getch().

We need to use an integer to make the comparison against ERR work.

MFC after: 3 months

12 years agoRemove WARNS line. This tool builds with WARNS=6 properly.
ed [Sun, 16 Oct 2011 08:14:12 +0000 (08:14 +0000)]
Remove WARNS line. This tool builds with WARNS=6 properly.

12 years agoFix build of m4 with WARNS=6.
ed [Sun, 16 Oct 2011 08:09:17 +0000 (08:09 +0000)]
Fix build of m4 with WARNS=6.

Change the parser; rename `exp' to `exponent' not to collide with exp(3).

12 years agoRemove unneeded WARNS=3 lines.
ed [Sun, 16 Oct 2011 08:04:43 +0000 (08:04 +0000)]
Remove unneeded WARNS=3 lines.

It seems these two tools can be built properly with WARNS=6, even on
architectures that are stricter about alignment.

12 years agoBuild at(1) with NO_WFORMAT instead of WARNS=1.
ed [Sun, 16 Oct 2011 07:57:01 +0000 (07:57 +0000)]
Build at(1) with NO_WFORMAT instead of WARNS=1.

12 years agoMake some internal fixes to ruptime(1):
ed [Sun, 16 Oct 2011 07:36:27 +0000 (07:36 +0000)]
Make some internal fixes to ruptime(1):

- Prevent possible unaligned access to struct whoent.
- Increase uptime column by one, to properly print hosts with an uptime
  greater than 1000 days.
- Reduce code complexity by storing struct whod inside struct hs.
- Set WARNS to 6.

MFC after: 3 months

12 years agoAccording to the NetBSD foundation [1]:
delphij [Sun, 16 Oct 2011 07:35:26 +0000 (07:35 +0000)]
According to the NetBSD foundation [1]:

Third parties are encouraged to change the license on any files which have
a 4-clause license contributed to the NetBSD Foundation to a 2-clause
license. We would also encourage you to inform us about these files, so
that we can continue to track the many places in which NetBSD is used.

http://www.netbsd.org/about/redistribution.html#why2clause [1]

Requested by: joel@

12 years agoPartially revert r226274, the old code was right.
delphij [Sun, 16 Oct 2011 07:05:43 +0000 (07:05 +0000)]
Partially revert r226274, the old code was right.

12 years agoUse #include "fenv.h" instead of #include <fenv.h>. This makes it
das [Sun, 16 Oct 2011 05:37:56 +0000 (05:37 +0000)]
Use #include "fenv.h" instead of #include <fenv.h>.  This makes it
more convenient to compile the math library by itself.

Requested by: bde

12 years agoFix some non-standard variable declarations.
das [Sun, 16 Oct 2011 05:37:20 +0000 (05:37 +0000)]
Fix some non-standard variable declarations.

12 years agoOptimize the case of pure imaginary arguments. Calls like this are
das [Sun, 16 Oct 2011 05:37:01 +0000 (05:37 +0000)]
Optimize the case of pure imaginary arguments.  Calls like this are
common, e.g., in DFT implementations.

Discussed with: bde, kargl

12 years agoMove the macros GET_LDBL_EXPSIGN() and SET_LDBL_EXPSIGN() into
das [Sun, 16 Oct 2011 05:36:39 +0000 (05:36 +0000)]
Move the macros GET_LDBL_EXPSIGN() and SET_LDBL_EXPSIGN() into
math_private.h, so they can be used elsewhere in the math library.

12 years agoRemove an unused variable.
das [Sun, 16 Oct 2011 05:36:23 +0000 (05:36 +0000)]
Remove an unused variable.

12 years agoEnforce a memory barrier in stream operations, as is done on other
nwhitehorn [Sat, 15 Oct 2011 23:15:55 +0000 (23:15 +0000)]
Enforce a memory barrier in stream operations, as is done on other
bus_space calls. This makes ath(4) work correctly on PowerPC.

Submitted by: adrian
Tested by: andreast
MFC after: 3 days

12 years agoProperly free resources in case of an error.
brueffer [Sat, 15 Oct 2011 22:27:35 +0000 (22:27 +0000)]
Properly free resources in case of an error.

CID: 4222
Found with: Coverity Prevent(tm)
MFC after: 1 week

12 years ago- add support for I-O DATA RSA-PCI2/R
eadler [Sat, 15 Oct 2011 21:06:08 +0000 (21:06 +0000)]
- add support for I-O DATA RSA-PCI2/R

PR: kern/142999
Submitted by: Takefu Kenji <takefu@airport.fm>
Approved by: jhb
Approved by: sahil (mentor)
MFC after: 1 week

12 years agoIn r225809 the intention was to send VEOF only once if STDIN was not a
trociny [Sat, 15 Oct 2011 19:08:22 +0000 (19:08 +0000)]
In r225809 the intention was to send VEOF only once if STDIN was not a
terminal. Unfortunately the fix was incorrect and for flushtime > 0 it
keept sending VEOF.

Sent VEOF generates ^D\b\b echoed by the terminal, which was reported
in bin/161526. Note, we still send VEOF at least once. Otherwise
commands like below would hang forever:

  echo 1 |script /tmp/script.out cat

PR: bin/161526
Reported by: Adrian Wontroba <aw1@stade.co.uk>, Stefan Bethke <stb@lassitu.de>
Tested by: Stefan Bethke <stb@lassitu.de>
MFC after: 3 days

12 years agoAdd support for IPv4 /31 prefixes, as described in RFC3021.
glebius [Sat, 15 Oct 2011 18:41:25 +0000 (18:41 +0000)]
Add support for IPv4 /31 prefixes, as described in RFC3021.

To run a /31 network, participating hosts MUST drop support
for directed broadcasts, and treat the first and last addresses
on subnet as unicast. The broadcast address for the prefix
should be the link local broadcast address, INADDR_BROADCAST.

12 years agoRemove last remnants of classful addressing:
glebius [Sat, 15 Oct 2011 16:28:06 +0000 (16:28 +0000)]
Remove last remnants of classful addressing:

- Remove ia_net, ia_netmask, ia_netbroadcast from struct in_ifaddr.
- Remove net.inet.ip.subnetsarelocal, I bet no one need it in 2011.
- fix bug when we were not forwarding to a host which matches classful
  net address. For example router having 192.168.x.y/16 network attached,
  would not forward traffic to 192.168.*.0, which are legal IPs in
  CIDR world.
- For compatibility, leave autoguessing of mask based on class.

Reviewed by: andre, bz, rwatson