Compare commits

...
Author SHA1 Message Date
Ken Smith a92e32c6e9 Ready for 7.4-RELEASE builds to start.
Approved by:	re (implicit)
2011-02-16 15:24:56 +00:00
Ken Smith d8ebe17147 Guess when all the bits will be in place for announcing 7.4-RELEASE.
Approved by:	re (implicit)
2011-02-16 15:19:31 +00:00
Simon L. B. Nielsen 61f73e3863 MFS 218634:
Fix Incorrectly formatted ClientHello SSL/TLS handshake messages could
cause OpenSSL to parse past the end of the message.

Note: Applications are only affected if they act as a server and call
SSL_CTX_set_tlsext_status_cb on the server's SSL_CTX. This includes
Apache httpd >= 2.3.3, if configured with "SSLUseStapling On".

The very quick merge is done to get this fix into 7.4 / 8.2.

Approved by:	re (bz)
Obtained from:	OpenSSL CVS
Security:	http://www.openssl.org/news/secadv_20110208.txt
Security:	CVE-2011-0014
2011-02-13 11:10:57 +00:00
John Baldwin 578f94cdb9 MFC 218271:
When turning off TCP_NOPUSH, only call tcp_output() to immediately flush
any pending data if the connection is established.

Approved by:	re (kib)
2011-02-11 15:15:08 +00:00
Ken Smith 477e54f8d5 MFC r218134:
Update to reflect the package layout for 7.4-RELEASE.

Approved by:	re (implicit)
2011-01-31 17:03:39 +00:00
Ken Smith 307e8d5d27 Ready for 7.4-RC3 builds.
Approved by:	re (implicit)
2011-01-28 17:10:37 +00:00
Colin Percival 1fc5742dac MFC r217872: Unbreak .Dd line.
Approved by:    re (kib)
2011-01-27 21:39:45 +00:00
Colin Percival dc0a495577 MFC r217869,217870: Fix .Dd lines in re(4) and nfe(4).
Approved by:	re (kib)
2011-01-27 09:33:30 +00:00
Jack F Vogel f69c23b652 MFC stable/7 r217724
Fix to kern/152853, misplaced pullup
	in em_xmit breaks UDP tx, thanks to
	Petr Lampa for the patch.

Approved by: re (bz)
2011-01-25 23:23:45 +00:00
Jack F Vogel 5c210ab5d5 MFC stable/7 r217723
- Pieces of the failure path in em_xmit got
	  mangled, correct it.
	- local_timer had a leftover TX_UNLOCK without
	  a matching TX_LOCK in the error path, remove it.

Approved by: re (bz)
2011-01-25 22:55:50 +00:00
Pyun YongHyeon f9b9d97e2e MFC r217548:
Rework RX filter programming by providing separate handler for
  DP8381[56] and SiS 900/7016 controllers.  After r212119, sis(4) no
  longer reinitializes controller if ALLMULTI/PROMISC was changed.
  However, RX filter handling code assumed some bits of the RX filter
  is programmed by driver initialization. This caused ALLMULTI/PROMISC
  configuration is ignored under certain conditions.
  Fix that issue by reprogramming all bits of RX filter register.
  While I'm here follow recommended RX filter programming steps
  recommended by National DP8381[56] data sheet(RX filter should be
  is disabled before programming).

  Reported by:	Paul Schenkeveld < freebsd () psconsult dot nl >
  Tested by:	Paul Schenkeveld < freebsd () psconsult dot nl >
  Approved by:	re (bz)
2011-01-24 21:04:32 +00:00
Konstantin Belousov 9951a0e1fa MFC r217383:
The (%esp & 0xf) == 0 should be true before the call instruction is
executed, for the properly aligned stack.

Approved by:	re (bz)
2011-01-22 19:15:39 +00:00
Marius Strobl 8be7c6e293 MFC: r217464, r217468, r217475
Add a manual page for rgephy(4) and reference it as appropriate. The
motivation for having rgephy.4 is to document the special media option
added in r217415 (MFC'ed to releng/7.4 in r217667).

Approved by:	re (kib)
2011-01-21 14:07:38 +00:00
Marius Strobl e6a58de485 MFC: r217415
- Allow IFM_FLAG0 to be set indicating that auto-negotiation with manual
  configuration, which is used to work around issues with certain setups
  (see r161237) by default, should not be triggered as it may in turn
  cause harm in some edge cases.
- Even after masking the media with IFM_GMASK the result may have bits
  besides the duplex ones set so just comparing it with IFM_FDX may lead
  to false negatives.
- Announce PAUSE support also for manually selected 1000BASE-T, but for
  all manually selected media types only in full-duplex mode. Announce
  asymmetric PAUSE support only for manually selected 1000BASE-T.
- Simplify setting the manual configuration bits to only once after we
  have figured them all out. This also means we no longer unnecessarily
  update the hardware along the road.
- Remove a stale comment.

Reviewed by:	yongari (plus additional testing)
Approved by:	re (bz)
2011-01-21 00:02:27 +00:00
Pyun YongHyeon 189a84e4fc MFC r217296:
For re(4) controllers that uses new jumbo frame scheme(RTL8168C/D/E),
  limit maximum RX buffer size to RE_RX_DESC_BUFLEN instead of
  blindly configuring it to 16KB. Due to lack of documentation, re(4)
  didn't allow jumbo frame on these controllers. However it seems
  controller is confused with jumbo frame such that it can DMA the
  received frame to wrong address instead of splitting it into
  multiple RX buffers. Of course, this caused panic.

  Since re(4) does not support jumbo frames on these controllers,
  make controller drop frame that is longer than RE_RX_DESC_BUFLEN
  sized frame. Fortunately RTL810x controllers, which do not support
  jumbo frame, have no such issues but this change also limited
  maximum RX buffer size allowed to RTL810x controllers. Allowing
  16KB RX buffer for controllers that have no such capability is
  meaningless.

Approved by:	re (bz)
2011-01-20 17:42:42 +00:00
Simon L. B. Nielsen da25f0a64c MFS7 r217562:
Decrease the libcrypto and libssl shared object version numbers from 6
 to 5. They were accidentally bumped in r215997 (on 2010-11-28) with the
 merge of OpenSSL 0.9.8p, but unfortunately this was not caught until
 now.

 Also add compat links for libcrypto.so.6 / libssl.so.6 (pointing to
 their .5 counterparts) in case any users have compiled any third party
 during the time stable/7 (and releng/7.4) were broken.

 This is deemed the last poor of bad options.  Had the number bump not
 been reverted binary packages for stable/7 would not have worked on the
 still supported 7.3 and 7.1 releases.

Approved by:	re (kensmith)
2011-01-19 07:44:47 +00:00
Ken Smith 9b5abacf88 Ready for 7.4-RC2.
Approved by:	re (implicit)
2011-01-11 04:25:54 +00:00
Pyun YongHyeon a1ffee8468 MFC r217226:
Apply DMA address space restriction to controllers that have 4GB
  DMA boundary bug and runs with PCI-X mode.  watchdog timeout was
  observed on BCM5704 which lives behind certain PCI-X bridge(e.g.
  AMD 8131 PCI-X bridge).  It's still not clear whether the root
  cause came from that PCI-X bridge or not. The watchdog timeout
  indicates the issue is in TX path. If the bridge reorders TX
  mailbox write accesses it would generate all kinds of problems but
  I'm not sure.  This should be revisited.

  Early MFC requested by re@ for inclusion in 8.2-RC2/7.4-RC2.

  Tested by:	Michael L. Squires (mikes <> siralan dot org)
  Approved by:	re (kensmith)
2011-01-10 19:59:20 +00:00
Hiroki Sato 53ceafda2d - Bump version numbers for the upcoming release.
- Clean-up old entries.

Approved by:	re (implicit)
2011-01-10 18:15:34 +00:00
Brian Somers 737e81f11a MFC r216832: Make -S functional
Approved by:	re (kib)
2011-01-07 18:34:09 +00:00
Lawrence Stewart 58047e818c MFC r210144 (originally committed by imp):
Put warnings out to stderr rather than stdout.

Approved by:	re (kib)
2011-01-07 01:50:25 +00:00
Marius Strobl 7b5131a8b3 MFC: r216891
Extend the section in which interrupts are disabled in the TLB demap
functions, otherwise if we get preempted after checking whether a certain
pmap is active on the current CPU but before disabling interrupts we might
operate on an outdated state as the pmap might have been deactivated in
the meantime. As the same issue may arises when the TLB demap function is
interrupted by a TLB demap IPI, just entering a critical section before
the check isn't sufficient so we have to fully disable interrupts instead.

Approved by:	re (kib)
2011-01-05 13:40:40 +00:00
Bjoern A. Zeeb 9ea71eb8bf MFC r216848:
Happy New Year 2011.

  Approved by:	core (kib)

Approved by:	re (kib)
2010-12-31 18:36:07 +00:00
Ken Smith a8894dcd69 Ready for RC1 builds.
Approved by:	re (implicit)
2010-12-22 15:07:40 +00:00
Ken Smith 1729f0f2d8 Add release package directories for upcoming releases, and one past release.
Approved by:	re (implicit)
2010-12-22 05:53:46 +00:00
Ken Smith f543d5a42b Adjust __FreeBSD_version for upcoming FreeBSD 7.4 release.
Approved by:	re (implicit)
2010-12-22 05:51:44 +00:00
Ken Smith 50a9d04af0 Adjust branch tag in example.
Approved by:	re (implicit)
2010-12-22 05:50:22 +00:00
Ken Smith 136e6b4c16 Misc. 7.3 -> 7.4 adjustments for upcoming release.
Approved by:	re (implicit)
2010-12-22 05:49:19 +00:00
Ken Smith a20a6e72b9 Adjust FreeBSD version printed for manual pages.
Approved by:	re (implicit)
2010-12-22 05:47:15 +00:00
Ken Smith f6b898da29 Adjust branch tag for 'make update'.
Approved by:	re (implicit)
2010-12-22 05:44:24 +00:00
Andrew Thompson 46d47d72ad MFC r216371:
Fix race in devfs by using LIST_FIRST() instead of
 LIST_FOREACH_SAFE() when freeing the devfs private
 data entries.

Approved by:	re (kib)
2010-12-21 09:33:06 +00:00
Doug Barton f99a868145 MFC r216187:
Add MAKEDEV.8

Submitted by:   Alex Kozlov <[email protected]>

Approved by:    re (kib)
2010-12-19 20:12:44 +00:00
Doug Barton 58dae595bd MFC r215824:
Add a sync to the shutdown step. In the common case this will be
harmless at worst. On a heavily loaded server it will give the fs a
chance to do its business without the axe hanging over its head.

Submitted by:   ivoras

Approved by:    re (kib)
2010-12-19 20:11:21 +00:00
Max Laier 057c7bb5de MFC r216335:
Fix a long standing (from the original 4.4BSD lite sources) race between
  vmspace_fork and vm_map_wire that would lead to "vm_fault_copy_wired: page
  missing" panics.  While faulting in pages for a map entry that is being
  wired down, mark the containing map as busy.  In vmspace_fork wait until
  the map is unbusy, before we try to copy the entries.

  Sponsored by:	Isilon Systems, Inc.

Approved by:	re (kib)
2010-12-19 06:09:02 +00:00
Jack F Vogel 649b83c468 MFC r216173
Remove the test for a minimum frame size from the IPV6 TX context
descriptor setup, when using VLANs and HW TAGGING the length of
an ICMP6 frame will fail this test and be discarded.

Approved by: re
2010-12-15 22:48:44 +00:00
John Baldwin 49749270a3 When the per-queueset transmit kthread is idle, do not pass a sleep
priority of '1' to tsleep().  This caused the priority of this kthread to
be raised higher than every other thread in the system.  Instead, leave
the priority of the kthread at its existing level.

This is a direct commit to stable/7 as this code is no longer present in
8.x and later.

Reviewed by:	np
Approved by:	re (kib)
2010-12-14 21:33:17 +00:00
Jack F Vogel c181afbca2 MFC r216172, r216176
Correct the RX discard and refresh_mbuf logic to match igb, the old
discard code could cause panics due to a bad pointer, now simply
have discard always free mbufs and depend on refresh. In the refresh
code, make sure the mbuf and soft buf struct are properly reset.

Approved by: re
2010-12-14 20:00:55 +00:00
Tijl Coosemans ebd10f733f MFC r216351:
Add a .note.ABI-tag section to ia64 startup files by linking crtbrand.c
in crt1.o. On other architectures crtbrand.c is included from crt1.c,
but that's not a C source code file on ia64. Instead it is compiled
separately and included in crt1.o using incremental linking.

Approved by:	re (kensmith), kib (mentor)
2010-12-14 15:35:44 +00:00
Bjoern A. Zeeb 8edab182af MFC r216192:
Use correct field to track statistics counting error as bad header length.
  This assimilates the code to what ip_input has been doing since r1.1 in
  this case.

  Submitted by: Rozhuk Ivan (rozhuk.im gmail.com)

Approved by:	re (kib)
2010-12-10 14:07:08 +00:00
Andrey V. Elsukov dd5ecaab44 MFC r206494 by luigi:
fix a buffer overflow with large (100k+) number of input lines.

Approved by:	re (bz)
2010-12-10 05:16:25 +00:00
Xin LI b9ba8e4041 MFC r216040:
Make German formal clause to be consistent with the keymap counterpart.

Submitted by:	arundel
Approved by:	re (kensmith, bz)
2010-12-10 00:53:16 +00:00
Simon L. B. Nielsen d89d6fa94e MFC r216166, r216167:
Merge in OpenSSL 0.9.8q.

Approved by:	re (kib)
Security:	CVE-2010-4180
Security:	http://www.openssl.org/news/secadv_20101202.txt
2010-12-09 22:05:16 +00:00
Doug Barton dde1cb5821 MFV: vendor/bind9/dist-9.4
Update to version 9.4-ESV-R4, the latest from ISC, which addresses
the following security vulnerabilities.

For more information regarding these issues please see:
http://www.isc.org/announcement/guidance-regarding-dec-1st-2010-security-advisories

1. Cache incorrectly allows ncache and rrsig for the same type

   http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-3613

   Affects resolver operators whose servers are open to potential
   attackers. Triggering the bug will cause the server to crash.

   This bug applies even if you do not have DNSSEC enabled.

2. Key algorithm rollover

   http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-3614

   Affects resolver operators who are validating with DNSSEC, and
   querying zones which are in a key rollover period. The bug will
   cause answers to incorrectly be marked as insecure.

Approved by:	re (kib)
2010-12-09 21:11:53 +00:00
Rebecca Cran ed1c12ad7d MFC r216229:
Revert r209469: it causes the rest of the function to be bypassed.

Approved by:	re (kensmith)
2010-12-09 15:28:59 +00:00
Rebecca Cran 3b333684d6 MFC r216243:
Ignore any failures with the "local" distribution since it's not present
on release CDs and so will normally fail.
installCommit() returns a DITEM_ value, not a Boolean.
distExtractAll() returns a Boolean, not a DITEM_ value.

Approved by:	re (kensmith)
2010-12-09 15:27:43 +00:00
Doug Barton 8fbf54f174 MFC r216065:
Update the description of green_saver.ko

Improvements to my suggested text from: jhb

Approved by:	re (kib)
2010-12-08 07:00:53 +00:00
Pyun YongHyeon ff4b8b226f MFC r216111:
If RX lockup workaround is enabled, fxp(4) will periodically reset
  the controller to workaround silicon bug of i82557. Each reset will
  re-establish link which in turn triggers MII status change
  callback. The callback will try to reconfigure controller if the
  controller is not i82557 to enable flow-control. This caused
  endless link UP/DOWN when the workaround was enabled on non-i82557
  controller.

  To fix the issue, apply RX lockup workaround only for i82557.
  Previously it blindly checked undocumented EEPROM location such
  that it sometimes enabled the workaround for other controllers. At
  this time, only i82557 is known to have the silicon bug.
  This fixes a regression introduced in r215906 which enabled flow
  control support for all controllers except i82557.

  Reported by:	Karl Denninger (karl <> denninger dot net)
  Tested by:	Karl Denninger (karl <> denninger dot net)
  Approved by:	re (kensmith)
2010-12-07 19:15:33 +00:00
Jung-uk Kim 163883fbf9 MFC: r216159
Do not change CPU ticker frequency if TSC is P-state invariant.

Approved by:	re (kib)
2010-12-07 18:15:18 +00:00
Colin Percival 47fed1f114 MFC r215105: Uninitialized buffers considered harmful.
Approved by:	re (bz)
2010-12-03 22:48:15 +00:00
Colin Percival 663b9c593e MFC r216077: Teach crashinfo(8) about the kern.bootfile sysctl.
Approved by:	re (bz)
2010-12-03 16:21:39 +00:00
Bjoern A. Zeeb 3800892398 MFC r206989:
Avoid memory access after free. Use the (shortend) copy for the
  ipsec mtu lookup as well.

  Submitted by:	Peter Molnar (peter molnar.cc)
PR:		kern/145736
Approved by:	re (kib)
2010-12-02 16:27:28 +00:00
John Baldwin ae10be2c3e MFC 215820:
Add device IDs for two more ServerWorks Host-PCI bridges so that we can
read their starting PCI bus number for older systems that do not support
ACPI (or have a broken _BBN method).

Approved by:	re (kib)
2010-12-02 15:59:41 +00:00
Rebecca Cran 326ef47d0c MFC r216053:
If no floppy drive is installed kldBrowser() can generate an error
early on. Initialize menu and count so the cleanup code doesn't try
and use their uninitialized values.

PR:	bin/152270
Submitted by:	Remi LAURENT <cloud at madpowah.org>

Approved by:	re (kensmith)
2010-12-02 09:10:45 +00:00
Andrew Gallatin cc4824933c MFC 215686:
Fix a TSO checksum bug on mxge(4):

The Myri10GE NIC will assume all TSO frames contain partial checksum,
and will emit TSO segments with bad TCP checksums if a TSO frame
contains a full checksum.  The mxge driver takes care to make sure
that TSO is disabled when checksum offload is disabled for this
reason.  However, modules that modify packet contents (like pf) may
end up completing a checksum on a TSO frame, leading to the NIC emitting
TSO segments with bad checksums.

To workaround this, restore the partial checksum in the mxge driver
when we're fed a TSO frame with a full checksum.
2010-11-29 13:36:37 +00:00
Simon L. B. Nielsen 6e6d2f6f63 Revert some FreeBSD specific changes (mainly made to fix various
security issues), and bring us back to using vendor versions of the
files.

This was already done on head and stable/8.
2010-11-29 08:44:32 +00:00
Pyun YongHyeon 8cde11f2ec MFC r215328:
Add flow control for 3C905B and newer controllers. Note, these
  controllers support RX pause only.

  Reviewed by:	marius
2010-11-29 01:50:58 +00:00
Pyun YongHyeon b54c265209 MFC r215329:
Add flow control for all re(4) controllers. re(4) controllers do
  not provide any MAC configuration interface for resolved flow
  control parameters. There is even no register that configures water
  mark which will control generation of pause frames.
  However enabling flow control surely enhanced performance a lot.
2010-11-29 01:43:17 +00:00
Pyun YongHyeon ec6260ff8c MFC r215849:
Enable ethernet flow-control on all jme(4) controllers.
2010-11-29 01:39:46 +00:00
Pyun YongHyeon 70f653493f MFC r215848:
Allocate 1 MSI/MSI-X vector. Originally jme(4) was designed to
  support multi-queue but the hardware limitation made it hard to
  implement supporting multi-queue. Allocating more than necessary
  vectors is resource waste and it can be added back when we
  implement multi-queue support.
2010-11-29 01:37:27 +00:00
Pyun YongHyeon a58a621a65 MFC r215847:
Disable retrying RX descriptor loading. The counter is used to set
  number of retry to be performed whenever controller found RX
  descriptor was empty. RX empty interrupt is generated only when the
  retry counter is over. Experimentation shows retrying RX descriptor
  loading increased number of dropped frames under flow-control
  enabled environments so disable it and have controller generate RX
  empty interrupt as fast as it can.
  While I'm here fix RXCSR_DESC_RT_CNT macro.
2010-11-29 01:34:43 +00:00
Pyun YongHyeon 6c3d99ad21 MFC r215850:
Enable ethernet flow-control on all alc(4) controllers. This change
  should reduce a lot of dropped frames under high network load.
2010-11-29 01:30:49 +00:00
Marius Strobl 49d99dc72d MFC: r215923
Allow pause support advertisement to be turned off again.

Submitted by:	yongari (ip1000phy(4))
2010-11-28 16:09:40 +00:00
Marius Strobl bd0ea1126a MFC: r215907
Remove the description of the dev.fxp.%d.noflow tunable as it was removed
in r215906 (MFC'ed to stable/7 in r216003) and the flowcontrol media option
now should be set as desired via ifconfig(8) instead.
2010-11-28 16:03:03 +00:00
Marius Strobl 1ab442be78 MFC: r215906
Fix and implement missing parts of flow control support. This also removes
the dev.fxp.%d.noflow tunable as the same effect can now be achieved with
ifconfig(8) by setting the flowcontrol media option as desired (besides
the tunable never having a chance to actually enable flow control support
so far).
In joint forces with:	yongari
2010-11-28 15:59:45 +00:00
Marius Strobl 8ac424ed08 MFC: r215905
Ensure Bay flow control is disabled as we're going to use IEEE 802.3 annex
31B full duplex flow control instead.
2010-11-28 15:57:26 +00:00
Bjoern A. Zeeb 84345413ac Make stable/7 LINT compile again unbreaking the if_lem polling interface
implementation (returning void rather than int).
2010-11-28 14:55:00 +00:00
Simon L. B. Nielsen f518f1a9d5 Merge OpenSSL 0.9.8p into stable/7.
This merges up to and including head/crypto/openssl/ r215697; and
head/secure/lib/libcrypto/, head/secure/lib/libssl/,
head/secure/usr.bin/openssl/ r215698.

To make the merge simpler, a hack was added to set MACHINE_CPUARCH.

A few old OpenSSL security fixes are still the stable/7 tree - these
will be backed out to the vendor version shortly.

Security:	CVE-2010-2939, CVE-2010-3864
Security:	http://www.openssl.org/news/secadv_20101116.txt
Security:	FreeBSD-SA-10:10.openssl
Approved by:	re (implicitly - they did not object of the general idea
		of OpenSSL update)
2010-11-28 13:45:51 +00:00
Bjoern A. Zeeb b19efb41b3 MFC r215559:
In case of an early return from the function there is no need to zero
  the route upfront, so defer as long as we can.
2010-11-28 13:01:10 +00:00
Martin Matuska 84c23723b4 MFC r213634, r213673:
MFC r213634:
Change FAPPEND to IO_APPEND as this is a ioflag and not a fflag.
This corrects writing to append-only files on ZFS.

MFC r213673 (pjd):
Provide internal ioflags() function that converts ioflag provided by FreeBSD's
VFS to OpenSolaris-specific ioflag expected by ZFS. Use it for read and write
operations.

PR:		kern/149495 [1], kern/151082 [2]
Submitted by:	Daniel Zhelev <[email protected]> [1], Michael Naef <[email protected]> [2]
Reviewed by:	mm (r213673)
Approved by:	delphij (mentor)
2010-11-28 10:05:26 +00:00
Brian Somers d56204f48f MFC r21584: Don't zero 'Info' after setting it up in the ASR_IOCTL_COMPAT case. 2010-11-27 21:20:51 +00:00
Jack F Vogel 553ab7d812 Correct em_poll type for stable/7 2010-11-27 18:18:09 +00:00
Xin LI 2cc6890dbc MFC r215236:
Sync with OpenBSD, primarily better signal and terminal handling.

Obtained from:	OpenBSD
2010-11-27 06:35:15 +00:00
Jack F Vogel 8fbcda7c04 Add missing shared code files. 2010-11-27 04:46:16 +00:00
Lawrence Stewart a40526ec06 MFC r215553:
Fix a minor code redundancy nit.
2010-11-27 03:46:32 +00:00
Lawrence Stewart d2aa905bc8 Partially MFC r215166:
Disable priming the congestion window from the host cache. The current method
interacts poorly with delayed ack amongst other things, resulting in undesired
delay during a connection's opening slow start.  Even if we did fix the issues,
the current method is still dubious at best and needs to be thought through
thoroughly.

Due to a mistake on my behalf, the change described above was committed to head
as part of a larger patch in revision 215166. Instead of waiting for the MFC of
215166, I'm merging just this small portion for the upcoming release without
bringing the mergeinfo for r215166 along. The mergeinfo will sort itself out
when r215166 is eventually merged.

This is an intentional direct commit to the 7-STABLE branch.

Reported by:    Maxim Dounin <mdounin at mdounin ru> and others
Submitted by:   andre
2010-11-27 03:12:39 +00:00
Jack F Vogel 560747b628 MFC: r214646, r215781, r215789, 215808
Brings 7.4 e1000 drivers to the same level as 8.2
2010-11-27 01:09:54 +00:00
Andriy Gapon c3b293be20 add UPDATING entry for amd64 minidump version 2
This is a direct commit.
2010-11-26 22:31:56 +00:00
Marius Strobl e42b691dcf MFC: r215780
Remove the description of the link0 link option, since r215297 (merged to
stable/7 in r215879) the master media option generally should be used
instead.

This is MFC'ed in order to discourage the use of the link0 link option,
although it's still available in stable/7).
2010-11-26 21:32:21 +00:00
Marius Strobl cecbb68f25 MFC: r215721
- Fix and enable support for flow control.
- Fix compilation with CAS_DEBUG defined.
2010-11-26 21:07:20 +00:00
Marius Strobl 2a73789642 MFC: r215768
- Sprinkle const on tables.
- Remove an alpha remnant.
- Minor comment and style fixes.
2010-11-26 21:02:54 +00:00
Marius Strobl 03e0f1cecf MFC: r215722
- Fix and enable support for flow control.
- Partially revert r172334; as it turns out the DELAYs in gem_reset_{r,t}x()
  are actually necessary although bus space barriers and gem_bitwait() are
  used, otherwise the controller may trigger an IOMMU errors on at least
  sparc64. This is in line with what Linux and OpenSolaris do.
2010-11-26 21:01:21 +00:00
Marius Strobl 30b098ec63 MFC: r215720
- Also probe BCM5214 and BCM5222.
- Add some DSP init code for BCM5221. The values derived from Apple's GMAC
  driver and the same init code also exists in Linux's sungem_phy driver.
- Only read media status bits when they are valid.

Obtained from:	NetBSD, OpenBSD
2010-11-26 20:59:43 +00:00
Marius Strobl 2236b9902a MFC: r215711
Add missing newlines.
2010-11-26 20:57:48 +00:00
Marius Strobl 21deedda73 MFC: r215302
Move the limiting of the PHY to 10/100 modes of operation due to limitations
of certain MAC models from brgphy(4) to bge(4) where it belongs. While at it,
update the list of models having that restriction to what OpenBSD uses, which
in turn seems to have obtained that information from the Linux tg3 driver.
2010-11-26 20:55:59 +00:00
Marius Strobl c4ca8f2bc9 MFC: r215298, r215459, r215714, r215716
- Change these drivers to take advantage and use the generic IEEE 802.3
  annex 31B full duplex flow control as well as the IFM_1000_T master
  support committed in r215297 (merged to stable/7 in r215879). For
  atphy(4) and jmphy(4) this includes changing these PHY drivers to no
  longer unconditionally advertise support for flow control but only if
  the selected media has IFM_FLOW set (or MIIF_FORCEPAUSE is set).
- Rename {atphy,jmphy}_auto() to {atphy,jmphy}_setmedia() as these handle
  other media types as well.

Reviewed by:	yongari (plus additional testing)
Obtained from:	NetBSD (partially), OpenBSD (partially)
2010-11-26 20:45:52 +00:00
Marius Strobl 277197cd7e MFC: r214608, r215297(partial), r215713
o Flesh out the generic IEEE 802.3 annex 31B full duplex flow control
  support in mii(4):
  - Merge generic flow control advertisement (which can be enabled by
    passing by MIIF_DOPAUSE to mii_attach(9)) and parsing support from
    NetBSD into mii_physubr.c and ukphy_subr.c. Unlike as in NetBSD,
    IFM_FLOW isn't implemented as a global option via the "don't care
    mask" but instead as a media specific option this. This has the
    following advantages:
    o allows flow control advertisement with autonegotiation to be
      turned on and off via ifconfig(8) with the default typically
      being off (though MIIF_FORCEPAUSE has been added causing flow
      control to be always advertised, allowing to easily MFC this
      changes for drivers that previously used home-grown support for
      flow control that behaved that way without breaking POLA)
    o allows to deal with PHY drivers where flow control advertisement
      with manual selection doesn't work or at least isn't implemented,
      like it's the case with brgphy(4), e1000phy(4) and ip1000phy(4),
      by setting MIIF_NOMANPAUSE
    o the available combinations of media options are readily available
      from the `ifconfig -m` output
  - Add IFM_FLOW to IFM_SHARED_OPTION_DESCRIPTIONS and IFM_ETH_RXPAUSE
    and IFM_ETH_TXPAUSE to IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS so
    these are understood by ifconfig(8).
o Make the master/slave support in mii(4) actually usable:
  - Change IFM_ETH_MASTER from being implemented as a global option via
    the "don't care mask" to a media specific one as it actually is only
    applicable to IFM_1000_T to date.
  - Let mii_phy_setmedia() set GTCR_MAN_MS in IFM_1000_T slave mode to
    actually configure manually selected slave mode (like we also do in
    the PHY specific implementations).
  - Add IFM_ETH_MASTER to IFM_SUBTYPE_ETHERNET_OPTION_DESCRIPTIONS so it
    is understood by ifconfig(8).
o Switch bge(4), bce(4), msk(4), nfe(4) and stge(4) along with brgphy(4),
  e1000phy(4) and ip1000phy(4) to use the generic flow control support
  instead of home-grown solutions via IFM_FLAGs. This includes changing
  these PHY drivers and smcphy(4) to no longer unconditionally advertise
  support for flow control but only if the selected media has IFM_FLOW
  set (or MIIF_FORCEPAUSE is set) and implemented for these media variants,
  i.e. typically only for copper.
o Switch brgphy(4), ciphy(4), e1000phy(4) and ip1000phy(4) to report and
  set IFM_1000_T master mode via IFM_ETH_MASTER instead of via IFF_LINK0
  and some IFM_FLAGn.
o Switch brgphy(4) to add at least the the supported copper media based on
  the contents of the BMSR via mii_phy_add_media() instead of hardcoding
  them. The latter approach seems to have developed historically, besides
  causing unnecessary code duplication it was also undesirable because
  brgphy_mii_phy_auto() already based the capability advertisement on the
  contents of the BMSR though.
o Let brgphy(4) set IFM_1000_T master mode on all supported PHY and not
  just BCM5701. Apparently this was a misinterpretation of a workaround
  in the Linux tg3 driver; BCM5701 seem to require RGPHY_1000CTL_MSE and
  BRGPHY_1000CTL_MSC to be set when configuring autonegotiation but
  this doesn't mean we can't set these as well on other PHYs for manual
  media selection.
o Let ukphy_status() report IFM_1000_T master mode via IFM_ETH_MASTER so
  IFM_1000_T master mode support now is generally available with all PHY
  drivers.
o Don't let e1000phy(4) set master/slave bits for IFM_1000_SX as it's
  not applicable there.

Reviewed by:	yongari (plus additional testing)
Obtained from:	NetBSD (partially), OpenBSD (partially)

Unlike as in head, bge(4), bce(4), msk(4), nfe(4) and stge(4) are changed
to set MIIF_FORCEPAUSE in stable/7 so they continue to always advertise
support of flow control and brgphy(4), ciphy(4), e1000phy(4) as well as
ip1000phy(4) are changed to still also accept IFF_LINK0 in addition to
the master media option for setting master mode, both in order to not
violate POLA.
2010-11-26 19:48:27 +00:00
Andriy Gapon 09aca770f4 MFC r215131: make it possible to actually enable hwpstate_verbose 2010-11-26 17:14:38 +00:00
Andriy Gapon 6dbe22e4f9 MFC r215133: amd64: introduce minidump version 2
This should reduce size of the minidump.
Compatibility with version 1 should be preserved in libkvm.
2010-11-26 16:24:55 +00:00
Xin LI f65c740bd0 MFC r214426: Add a short note about kernel modules in FIXIT mode. 2010-11-26 02:18:52 +00:00
Brian Somers 7d436656a9 MF8: Don't abend if we get ENOMEM from sysctl(3). The data returned
is sufficient
2010-11-25 21:42:36 +00:00
Xin LI a19bc4f888 MFC r215234:
Update to vendor release 1.20.00.19.

Bug fixes:
  * Fixed "inquiry data fails comparion at DV1 step"
  * Fixed bad range input in bus_alloc_resource for ADAPTER_TYPE_B
  * Fixed arcmsr driver prevent arcsas support for Areca SAS HBA ARC13x0

Many thanks to Areca for continuing to support FreeBSD.

MFC r215280:

Workaround build for PAE case for now - revert the PHYS
case to previous panic behavior.
2010-11-25 20:09:56 +00:00
Marius Strobl a06edd9992 MFC: r215259, r215272
- When printing media with more than one media option set aggregate these
  in a comma delimited list instead of repeating "mediaopt" for each one.
  This matches how the options of the active media are printed with
  print_media_word() and brings us in line what NetBSD does.
- When setting a media with no sub-type specified also reset the type
  specific options along with the global ones so these options don't
  stick when f.e. switching to IFM_AUTO.
2010-11-25 18:33:44 +00:00
Rebecca Cran 53f781b8db MFC r215637:
dispatch_add_command:
Modify the logic so there's only one exit point instead of two.
Only insert valid (non-NULL) values into the queue.

dispatch_free_command:
Ensure that item is not NULL before removing it from the queue and
dereferencing the pointer.
NULL out free'd pointers to catch any use-after-free bugs.

PR:	bin/146855
Submitted by:	gcooper
2010-11-24 21:58:15 +00:00
Kirk McKusick 5b005392d3 MFC of 215576
Delete /sys/ufs/ffs/README.snapshot as it is no longer relevant.
Drop reference to it in mount(8).

Reported by: Bruce Cran <[email protected]>
PR: docs/128325
2010-11-24 00:00:32 +00:00
Brian Somers 12f2da46bc MFC r197763, r198236, r212839 and r212886:
Handle extending a filesystem into unzeroed storage.
2010-11-23 21:45:14 +00:00
Ulrich Spörlein 9f9a8cc187 MFC r214237,214489:
Remove mention of non-existant -o flag for debugging options.

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.
2010-11-23 21:36:53 +00:00
Pyun YongHyeon 7093903a73 MFC r215353,215355:
r215353:
  Plug memory leakage introduced in r204989.

  Reported by:	yongari
r215355:
  Restore the previous behaviour of substring match.
2010-11-23 19:23:47 +00:00
Pyun YongHyeon 2e523ca9f1 MFC r215327,215350:
r215327:
  P5N32-SLI PREMIUM from ASUSTeK is known to have MSI/MSI-X issue
  such that nfe(4) does not work with MSI-X. When MSI-X support was
  introduced, I remember MCP55 controller worked without problems so
  the issue could be either PCI bridge or BIOS issue. But I also
  noticed snd_hda(4) disabled MSI on all MCP55 chipset so I'm still
  not sure this is generic issue of MCP55 chipset. If this was PCI
  bridge issue we would have added it to a system wide black-list
  table but it's not clear to me at this moment whether it was caused
  by either broken BIOS or silicon bug of MCP55 chipset.

  To workaround the issue, maintain a MSI/MSI-X black-list table in
  driver and lookup base board manufacturer and product name from the
  table before attempting to use MSI-X. If driver find an matching
  entry, nfe(4) will not use MSI/MSI-X and fall back on traditional
  INTx mode. This approach should be the last resort since it relies
  on smbios and if another instance of MSI/MSI-X breakage is reported
  with different maker/product, we may have to get the PCI bridge
  black-listed instead of adding an new entry.

  PR:	kern/152150

r215350:
  Plug memory leakage introduced in r215327.

  Submitted by:	jkim
2010-11-23 19:14:17 +00:00
Ulrich Spörlein d91b4b7bb1 MFC r215237: Fix bug in jn(3) and jnf(3) that led to -inf results 2010-11-23 18:48:57 +00:00
Sergey Kandaurov bb02cd0159 MFC r215176:
Stop documenting vgonel() after its converting to the static function:
  svn r147332 (by jeff): "Don't make vgonel() globally visible".
 While here, specify the vnode locking scheme for vgone().

MFC r176604 (by davidc):

 Minor grammar fixup.

Approved by:	avg (mentor), kib (mentor)
2010-11-23 11:41:40 +00:00
Fabien Thomas 1fe3daaa18 MFC 200669:
Recognize Intel CPUs with Family 0x6, Models 0x1E and 0x1F.
2010-11-23 09:17:00 +00:00
Kirk McKusick d0fa027d5a MFC of 213119
Reported problem:
Large (60GB) filesystems created using "newfs -U -O 1 -b 65536 -f 8192"
show incorrect results from "df" for free and used space when mounted
immediately after creation. fsck on the new filesystem (before ever
mounting it once) gives a "SUMMARY INFORMATION BAD" error in phase 5.

This error hasn't occurred in any runs of fsck immediately after
"newfs -U -b 65536 -f 8192" (leaving out the "-O 1" option).

Solution:
The default UFS1 superblock is located at offset 8K in the filesystem
partition; the default UFS2 superblock is located at offset 64K in
the filesystem partition. For UFS1 filesystems with a blocksize of
64K, the first alternate superblock resides at 64K which is the the
location used for the default UFS2 superblock. By default, the
system first checks for a valid superblock at the default location
for a UFS2 filoesystem. For a UFS1 filesystem with a blocksize of
64K, there is a valid UFS1 superblock at this location. Thus, even
though it is expected to be a backup superblock, the system will
use it as its default superblock. So, we have to ensure that all the
statistcs on usage are correct in this first alternate superblock
as it is the superblock that will actually be used.

While tracking down this problem, another limitation of UFS1 became
evident. For UFS1, the number of inodes per cylinder group is stored
in an int16_t. Thus the maximum number of inodes per cylinder group
is limited to 2^15 - 1. This limit can easily be exceeded for block
sizes of 32K and above. Thus when building UFS1 filesystems, newfs
must limit the number of inodes per cylinder group to 2^15 - 1.

Reported by: Guy Helmer<[email protected]>
Followup by: Bruce Cran <[email protected]>
PR: 107692
2010-11-23 01:32:44 +00:00
Max Laier ecb82ac830 MFH r215508:
Off by one page in vm_reserv_reclaim_contig(): reclaim reservations with
  only a single free page as well.

  Reviewed by:	alc
2010-11-22 21:22:08 +00:00
Ken Smith 3f677f374f We're a bit under a week from Code Freeze for the upcoming 7.4-RELEASE
cycle.  Warn people tracking stable/7 that the branch may be more
active than usual.
2010-11-22 16:10:54 +00:00
Brian Somers 4e89abacba MFC r212247 & r212724 from head:
Handle geli-encrypted root disk devices.
    Add support for identifying a journaled root filesystem.
    Fix support for identifying the given /dev/vinum/root example.
2010-11-22 09:34:38 +00:00
Alan Cox 4804cc4e6d MFC r204415, r204416, r209669
Improve the comment and man page for vm_page_alloc().
2010-11-22 07:17:27 +00:00
Doug Barton a37804137c MFC 215334:
Remove references to MAKEDEV(8)
2010-11-22 00:44:43 +00:00
Doug Barton cfdd22c17c MFC 215250:
Remove references to the long-gone ramdisk

Submitted by:	Garrett Cooper <[email protected]>
2010-11-22 00:12:24 +00:00
Jilles Tjoelker 9cbdf40ca3 MFC r215211: echo(1): Clarify portability and mention literal "--" handling. 2010-11-21 17:14:22 +00:00
Jilles Tjoelker 9360e116c9 MFC r215184: sh: Remove unused man page for echo builtin.
The information in sh(1) about the echo builtin is equivalent, though less
extensive.

The echo(1) man page (bin/echo/echo.1) is different.

Unfortunately, sh's echo builtin and /bin/echo have gone out of sync and
this probably cannot be fixed any more.
2010-11-21 17:12:27 +00:00
Rebecca Cran d6921b2b1b MFC r215286:
Connect to ftp2.tr.freebsd.org when the Turkey #2 mirror is selected.

PR:	bin/128587
Submitted by: 	Mehmet Kose <mehmet.kose at gmail.com>

MFC r215287:

"Web" should not be all upper-case because it's not an acronym.

PR:	bin/130366
Submitted by:	Royce Williams <royce at alaska.net>

MFC r215290:

ntpdate(8) hosts are now configured in rc.conf via ntpdate_hosts.

PR:	bin/148350
Submitted by: Joel FAEDI <joel.faedi at gmail.com>

MFC r215296:

Fix use of CD_VERSION=any in cdrom.inf by calling strcmp instead of
variable_cmp.

PR:	bin/142960
Submitted by: G. Paul Ziemba <p-fbsd-bugs at ziemba.us>
2010-11-21 13:22:05 +00:00
Rebecca Cran 0b53196b80 MFC r215284, r215285:
When rebooting the machine jump to 0xf000:0xfff0 instead of 0xffff:0x0.
This is the same change that was made in rev 1.33 of boot/i386/btx/btx.S.

PR:	i386/91871
Submitted by:	Bjorn Konig <bkoenig at cs.tu-berlin.de>
2010-11-21 13:11:50 +00:00
Bernhard Schmidt bb7c70be7a Revert r215619, ABI breakage ahead.
Pointy hat to:	me
2010-11-21 12:33:11 +00:00
Bernhard Schmidt 84dccc3ede MFC r199076:
The isr_intval in ieee80211req_scan_result structure should be 16 bit.
This makes ifconfig list scan display the correct beacon interval
(previously it would int overflow). As a side effect, this makes the
ieee80211req_scan_result word aligned.

Submitted by:	Paul B Mahol <onemda at gmail.com>
Committed by:	rpaulo
2010-11-21 10:58:37 +00:00
Bernhard Schmidt b7a903fd28 MFC r200242:
Fix typo in comment

Submitted by:	Paul B Mahol <onemda at gmail.com>
Committed by:	rpaulo
2010-11-21 10:56:04 +00:00
Bernhard Schmidt 5e32fcbfc7 MFC r207322:
Fix typo. No functional change.

Obtained from:	DragonFlyBSD
Committed by:	rpaulo
2010-11-21 10:52:47 +00:00
Marius Strobl 82960f324a MFC: r215325
Use the correct variable for determining the verbosity level in mpt_lprtc().
While at it, fix the whitespace of that macro.

PR:		149502
Submitted by:	Andrew Boyer
2010-11-21 00:53:27 +00:00
Marius Strobl 331a8a3146 MFC: r215295
Let cryptosoft(4) add its pseudo-device with a specific unit number and its
probe method return BUS_PROBE_NOWILDCARD so it doesn't get attached to real
devices hanging off of nexus(4) with no specific devclass set. Actually, the
more desirable fix for this would be to get rid of the newbus interface of
cryptosoft(4) altogether but apparently crypto(9) was written with support
for cryptographic hardware in mind so that approach would require some KPI
breaking changes which don't seem worth it.
2010-11-21 00:50:31 +00:00
Marius Strobl fb390151e4 MFC: r215093
Enable reservation-based physical memory allocation.  Even without the
creation of large page mappings in the pmap, it can provide modest
performance benefits.  In particular, for a "buildworld" on a 2x 1GHz
Ultrasparc IIIi it reduced the wall clock time by 2.2% and the system
time by 12.6%.

Tested by:	marius@
2010-11-21 00:45:24 +00:00
Jilles Tjoelker c6627208f2 MFC r215022: test: Move tests to tools/regression/bin/test.
Convert the tests to the perl prove format.
Remove obsolete TEST.README (results of an old TEST.sh for some old Unices)
and TEST.csh (old tests without correct values, far less complete than
TEST.sh).
2010-11-20 16:56:39 +00:00
Bernhard Schmidt cc79e1cfe5 MFC r201793:
Fix #ifdefs so that GCC 4.4 doesn't complain about it.

Committed by:	trasz
2010-11-20 13:30:48 +00:00
Bernhard Schmidt fff20a1483 MFC r203673:
Ensure that tkip_mixing_phase1() is called after a rekeying event when
using plain s/w crypto.
2010-11-19 18:59:35 +00:00
Marius Strobl ce967f9abb MFC: r176965
Any driver that relies on its parent to set the devclass has no way to
know if has siblings that need an actual probe.  Introduce a specail
return value called BUS_PROBE_NOOWILDCARD.  If the driver returns
this, the probe is only successful for devices that have had a
specific devclass set for them.

Reviewed by: current@, jhb@, grehan@
2010-11-19 17:24:03 +00:00
John Baldwin 575641b296 MFC 204352, 208028, 209266, 209399, 210723, 213672, 215046:
- Fixed static linkage.
- Document that mptutil/mpt do not support RAID volumes in excess of 2TB.
- Report subcommand handler errors so that tools that invoke mptutil can
  robustly report errors.
- Save errno values before calling warn(3) so that errors are correctly
  reported.
- Check for malloc() failures.
2010-11-19 17:08:29 +00:00
Marius Strobl 589dcb3e20 MFC: r215300
Remove redundant cases and a style(9) bug.
2010-11-19 17:07:33 +00:00
Marius Strobl 1645201dc2 MFC: r214879
Implement pmap_is_prefaultable().

Reviewed by:	alc (with bugfix)
2010-11-19 17:04:57 +00:00
John Baldwin 14a51fa0af MFC 215001:
Only dump the values of the PMC and CMCI local vector table entries on a
local APIC if those LVT entries are valid.  This quiets spurious illegal
register local APIC errors during boot on a CPU that doesn't support those
vectors.
2010-11-19 16:26:51 +00:00
Xin LI 71bd208837 RELENG_7 does not have IP_BINDANY yet so hide it under ifdef.
Reported by:	tinderbox
2010-11-19 09:59:41 +00:00
Jaakko Heinonen 25646695d7 MFC r215235:
Set FD_CLOEXEC for the output file only when the file has been specified
with the -o option. Setting the flag for stderr (the default) could
cause the traced process to redirect stderr to a random file.

PR:		bin/152151
2010-11-18 19:08:56 +00:00
Marius Strobl 0e36ba3353 MFC: r215348
Return from mii_attach() after calling bus_generic_attach(9) on the device_t
of the MAC driver in order to attach miibus(4) on the first pass instead of
falling through to also calling it on the device_t of miibus(4). The latter
code flow was intended to attach the PHY drivers the same way regardless of
whether it's the first or a repeated pass, modulo the bus_generic_attach()
call in miibus_attach() which shouldn't be there. However, it turned out
that these variants cause miibus(4) to be attached twice under certain
conditions when using MAC drivers as modules.

Submitted by:	yongari
2010-11-18 18:05:59 +00:00
Pyun YongHyeon 2febf31c55 MFC r215132,215194:
r215132:
  Add basic WOL support for MCP ethernet controllers. It seems the
  controller does not perform automatic switching from 1000Mbps link
  to 10/100Mbps link when WOL is activated. Implement establishing
  10/100Mps link with auto-negotiation in driver. Link status change
  handler was modified to remove taskqueue based approach since driver
  now needs synchronous handling for link establishment.

  Submitted by:	Yamagi Burmeister (lists <> yamagi.org ) (initial version)
  Tested by:	Yamagi Burmeister (lists <> yamagi.org )

r215194:
  Fix regression introduced in r215132. Caller always holds a driver
  lock before accessing mii, so locking is not needed here.

  Reported by:	Rob Farmer (rfarmer <> predatorlabs dot net)
2010-11-18 17:49:24 +00:00
Xin LI 7ae09a6270 MFC through r214047: nc from OpenBSD 4.8. 2010-11-18 01:21:55 +00:00
Jilles Tjoelker 96bd55f797 MFC r198406: wordexp(3): fix some bugs with signals and long outputs
* retry various system calls on EINTR
* retry the rest after a short read (common if there is more than about 1K
  of output)
* block SIGCHLD like system(3) does (note that this does not and cannot
  work fully in threaded programs, they will need to be careful with wait
  functions)

PR:		90580
2010-11-17 21:45:11 +00:00
Jilles Tjoelker 2ee3cee237 MFC r174692: Fix wordexp() testsuite.
Original commit by das.
2010-11-17 20:21:10 +00:00
Alan Cox 81a94910c3 MFC r209407, r209648, r209650
Introduce and use vm_page_next() and vm_page_prev().  They provide both
  a simpler and faster interface for iterating over the pages of an object.
2010-11-17 18:21:29 +00:00
Sergey Kandaurov ef51946ac8 MFC r215186:
Add 'jid' as a possible sort order to the help screen.

PR:		bin/150992
Submitted by:	Frederic Culot <frederic at culot dot org>
Approved by:	avg (mentor)
2010-11-17 09:49:51 +00:00
Pyun YongHyeon c81956af7e MFC r215018-215020:
r215018:
  Consistently use tab character instead of using space character.
  No functional changes.

r215019:
  Remove trailing white spaces.

r215020:
  Remove standard PCI configuration space register definitions.
2010-11-16 20:38:41 +00:00
Pyun YongHyeon 15cb872d5d MFC r215017,215025:
Follow the lead of vendor's interrupt moderation mechanism.
  It seems RTL8169/RTL8168/RTL810xE has a kind of interrupt
  moderation mechanism but it is not documented at all. The magic
  value dramatically reduced number of interrupts without noticeable
  performance drops so apply it to all RTL8169/RTL8169 controllers.
  Vendor's FreeBSD driver also applies it to RTL810xE controllers but
  their Linux driver explicitly cleared the register, so do not
  enable interrupt moderation for RTL810xE controllers.

  While I'm here sort 8169 specific registers.

  Obtained from:	RealTek FreeBSD driver

MFC r215025:
  Only moderate TX completion interrupts. Relying on taskqueue to
  suppress RX interrupts seems to give better RX performance than
  RX interrupt moderation.
2010-11-16 20:34:00 +00:00
Pyun YongHyeon 633aa0cf82 MFC r214992:
Reduce spin wait time consumed in GMII register access routine.
  There were a couple of attempts in the past to reduce it since it
  took more than 1ms. Because mii_tick() periodically polls link
  status, waiting more than 1ms for each GMII register access was
  overkill. Unfortunately all previous attempts were failed with
  various ways on different controllers.
  This time, add additional 20us dealy at the end of GMII register
  access which seems to requirement of all RealTek controllers to
  issue next GMII register access request. This is the same way what
  Linux does.
2010-11-16 20:27:01 +00:00
Maxim Sobolev a981a16bd2 Fix build problem introduced in r215368 MFC when IPX is enabled.
Submitted by:	des
2010-11-16 15:02:53 +00:00
Rebecca Cran 1077a65977 MFC r214021:
Fix grammar.
2010-11-16 07:39:52 +00:00
Rebecca Cran e0f253fecf MFC r213763:
Use the RFC2606 domain example.com in examples.
2010-11-16 07:35:29 +00:00
Rebecca Cran 846c7bce62 MFC r215239:
Memory stats are reported in bytes, not pages.

PR:	docs/151283
Submitted by:	Bas Smeelen <b.smeelen at ose.nl>
2010-11-16 07:26:49 +00:00
Rebecca Cran f4c8d6b3aa MFC r215263:
Add ftp4.se.freebsd.org to the set of mirrors.

PR:	bin/150552
Submitted by:	Niclas Zeising <zeising at lysator.liu.se>
2010-11-16 07:19:05 +00:00
Alan Cox 9635304928 MFC r213455
Initialize KPTmap in locore so that vm86.c can call vtophys() (or really
  pmap_kextract()) before pmap_bootstrap() is called.

  Document the set of pmap functions that may be called before
  pmap_bootstrap() is called.
2010-11-16 06:20:12 +00:00
Alan Cox 80a33eedbb MFC r214938
Eliminate a possible race between pmap_pinit() and pmap_kenter_pde() on
  superpage promotion or demotion.

  Micro-optimize pmap_kenter_pde().
2010-11-16 05:01:27 +00:00
Alan Cox 1c935031b8 MFC r214953
In case the stack size reaches its limit and its growth must be
  restricted, ensure that grow_amount is a multiple of the page size.
  Otherwise, the kernel may crash in swap_reserve_by_uid() on HEAD and
  FreeBSD 8.x, and produce a core file with a missing stack on FreeBSD
  7.x.
2010-11-16 04:51:07 +00:00
Maxim Sobolev 33277cd93a MFC r207554:
Add new tunable 'net.link.ifqmaxlen' to set default send interface
    queue length. The default value for this parameter is 50, which is
    quite low for many of today's uses and the only way to modify this
    parameter right now is to edit if_var.h file. Also add read-only
    sysctl with the same name, so that it's possible to retrieve the
    current value.
2010-11-16 04:40:03 +00:00
Bjoern A. Zeeb 380e098510 MFC r214565:
Announce IPsec if available for feature_present(3) checks.
2010-11-16 03:20:57 +00:00
Pyun YongHyeon 230b69e24f MFC r214968:
Use shorten model name instead of showing all controller model
  numbers. bge(4) supports too many models such that it's
  unreasonable to list all these controllers in one line description
  of name. While I'm here mention that BCM590x/BCM5779x is Fast
  Ethernet controller.
  bge(4) still lacks support for some controllers but supporting
  these controllers should be easy now and adding new controllers
  do not require touching .Nd any more.

  Obtained from:	OpenBSD
2010-11-16 00:32:45 +00:00
Lawrence Stewart 758540dec0 MFC r215154:
The first releases SIFTR will ship in will be 7.4 and 8.2.
2010-11-16 00:06:19 +00:00
Lawrence Stewart 82ac5ac5d9 MFC r215153:
Standardise all Swinburne related copyright/licence statements throughout the
tree in preparation for another large code import. Swinburne University is the
legal entity that owns copyright and the 2-clause BSD licence is acceptable.
2010-11-16 00:00:31 +00:00
Lawrence Stewart 67f3c58540 MFC r215152:
The university does not require that its CRICOS number be included in source
code. Remove all references from the tree.
2010-11-15 23:57:06 +00:00
Marius Strobl 92db457017 MFC: r214940
Add gpart and glabel to the release CD mfsroot.
2010-11-13 13:46:33 +00:00
Pyun YongHyeon f3aafae4eb MFC r214844:
Add simple MAC statistics counter reading support. Unfortunately
  useful counters like rl_missed_pkts is 16 bits quantity which is
  too small to hold meaningful information happened in a second. This
  means driver should frequently read these counters in order not to
  lose accuracy and that approach is too inefficient in driver's
  view. Moreover it seems there is no way to trigger an interrupt to
  detect counter near-full or wraparound event as well as lacking
  clearing the MAC counters. Another limitation of reading the
  counters from RealTek controllers is lack of interrupt firing at
  the end of DMA cycle of MAC counter read request such that driver
  have to poll the end of the DMA which is a time consuming process
  as well as inefficient. The more severe issue of the MAC counter
  read request is it takes too long to complete the DMA. All these
  limitation made maintaining MAC counters in driver impractical. For
  now, just provide simple sysctl interface to trigger reading the
  MAC counters. These counters could be used to track down driver
  issues. Users can read MAC counters maintained in controller with
  the following command.
  #sysctl dev.re.0.stats=1

  While I'm here add check for validity of dma map and allocated
  memory before unloading/freeing them.

  Tested by:	rmacklem
2010-11-13 01:11:13 +00:00
Pyun YongHyeon 4592d773f1 MFC r214841-214842:
r214841:
  Remove extra white spaces.

r214842:
  style(9).
2010-11-13 01:07:45 +00:00
Pyun YongHyeon ebcfb21d77 MFC r214840:
Enable 64bit DMA addressing for RTL810xE/RTL8168/RTL8111 PCIe
  controllers. Some old PCI controllers may work with DAC but it was
  known to be buggy so 64bit DMA addressing is used only on PCIe
  controllers.
2010-11-13 01:03:33 +00:00
Pyun YongHyeon 8df636c829 MFC r214899:
Fix a long standing bug in programming station address for Yukon
  controllers. sk(4) never reprogrammed station address for Yukon
  controllers so overriding station address with ifconfig(8) was not
  possible.
  Fix the bug by reprogramming all registers that control station
  address, flow-control and virtual station address. Virtual station
  address has no use at this moment since driver does not make use of
  fail over feature.

  Tested by:	"Mikhail T." <mi+thun <> aldan.algebra.com>
2010-11-13 01:00:00 +00:00
Pyun YongHyeon b5a35d64cc MFC r214898:
If we got an invalid station address, generate random address. This
  might be caused by broken BIOS.

  Reported by:	"Mikhail T." <mi+thun <> aldan.algebra.com>
2010-11-13 00:55:16 +00:00
Matthew D Fleming d540aa917b MFC r213813. This is a direct commit because the diff is against
several non-MFC'd changes.

Use a safer mechanism for determining if a task is currently running,
that does not rely on the lifetime of pointers being the same. This
also restores the task KBI.
2010-11-12 18:10:27 +00:00
Xin LI d85a770dbe MFC r214854:
Validate whether the zfs_cmd_t submitted from userland is not smaller than
what we have.  Without the check the kernel could accessing memory that
does not belong to the request struct.

Note that we do not test if the struct equals in size at this time, which
may faciliate forward compatibility with newer binaries.
2010-11-12 01:45:29 +00:00
Marius Strobl e59d324c61 MFC: r208459, r208511, r214873
- Move Sun Fire V240 to the list of known working machines.
- For the parallel stable/7 and stable/8 branches mention both releases that
  first supported a particular sparc64 machine and update the sparc64 hardware
  list regarding machines that were supported beginning with 8.1-RELEASE and
  will be supported beginning with 8.1-RELEASE.
2010-11-09 21:00:51 +00:00
Jean-Sébastien Pédron db53593b0d MFC r214893:
Fix a segmentation fault in argument processing.

The crash was caused by a command line such as this one:
# fold -b1

PR:		bin/151592
Reported by:	Marcus Reid <[email protected]>
Tested by:	Marcus Reid <[email protected]>
2010-11-09 20:56:55 +00:00
Ulrich Spörlein a9a4cf3f00 MFC r173289,174783,175454,191681,191698,191834,195044,197304,198210,199858-199859,201348,205578,208327,208336,210871,214628:
Sync bsd-family-tree with head.
2010-11-08 20:21:24 +00:00
Pyun YongHyeon 87f107bf30 MFC r214542:
Don't bother to enable ASPM L1 to save more power. Even though I am
  not able to trigger the issue with sample boards, some users seems
  to suffer from freeze/lockup when system is booted without UTP cable
  plugged in. I'm not sure whether this is BIOS issue or controller
  bug. This change fixes AR8132 lockup issue seen on EEE PC.

  Reported by:	kmoore
  Tested by:	kmoore
2010-11-08 20:16:42 +00:00
Pyun YongHyeon b897327cfe MFC r214428:
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-11-08 19:54:44 +00:00
Pyun YongHyeon d6c0f14923 MFC r213486:
Remove bge_tx_buf_ratio, unused member of softc.
2010-11-08 19:33:13 +00:00
Pyun YongHyeon 5164ef8d4b MFC r214427:
Add BCM5717C 10/100/1000TX PHY id.
2010-11-08 19:25:47 +00:00
Konstantin Belousov c9de83702b MFC r203072 (by rmacklem, to be reverted by MFC of r214026):
Fix a race that can occur when nfs nfsiod threads are being created.

MFC r212506:
Do not fork nfsiod directly from the vop methods.

MFC r214026:
Do not synchronously start the nfsiod threads at all.

Tested by:	jhb
2010-11-08 15:22:20 +00:00
Jilles Tjoelker d8ae88c811 MFC r214609: sh(1): Correct synopsis and make precise how $0 is set.
In particular, the extra argument to set $0 with -c was not documented.
2010-11-07 20:33:36 +00:00
Alan Cox 8aa65a37c4 MFC r214564
Correct some format strings used by sysctls.
2010-11-07 20:20:19 +00:00
Marius Strobl a60a82103b MFC: r214606
Try to make the style consistent (including regarding NetBSD bits not yet
merged) and adhere style(9).
2010-11-07 17:54:43 +00:00
Marius Strobl ae0c5ac79a MFC: r214528
- 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-11-07 17:50:55 +00:00
Marius Strobl 79bd758baf MFC: r214264
- Add IFM_10_2 and IFM_10_5 media via tlphy(4) only in case the respective
  interface also has such connectors.
- In tl_attach() unify three different ways of obtaining the device and
  vendor IDs and remove the now obsolete tl_dinfo from tl_softc.
- Given that tlphy(4) only handles the integrated PHYs of NICs driven by
  tl(4) make it only probe on the latter.
- Switch mlphy(4) and tlphy(4) to use mii_phy_add_media()/mii_phy_setmedia().
- Simplify looking for the respective companion PHY in mlphy(4) and tlphy(4)
  by ignoring the native one by just comparing the device_t's directly rather
  than the device name.
2010-11-07 17:48:11 +00:00
Marius Strobl 6641474963 MFC: r214263
Take advantage of mii_phy_add_media()/mii_phy_setmedia().
2010-11-07 17:41:09 +00:00
Marius Strobl 5ef253ad32 MFC: r213894, r213896, r214913
Converted the remainder of the NIC drivers to use the mii_attach()
introduced in r213878 (MFC'ed to stable/7 in r214685) instead of
mii_phy_probe(). Unlike r213893 (MFC'ed to stable/7 in r214910)
these are mostly straight forward conversions though.
2010-11-07 17:38:54 +00:00
Marius Strobl 4aec302884 MFC: r213893, r213908, r214566, r214605, r214846
Convert the PHY drivers to honor the mii_flags passed down and convert
the NIC drivers as well as the PHY drivers to take advantage of the
mii_attach() introduced in r213878 (MFC'ed to stable/8 in r214685) to
get rid of certain hacks. For the most part these were:
- Artificially limiting miibus_{read,write}reg methods to certain PHY
  addresses; we now let mii_attach() only probe the PHY at the desired
  address(es) instead.
- PHY drivers setting MIIF_* flags based on the NIC driver they hang
  off from, partly even based on grabbing and using the softc of the
  parent; we now pass these flags down from the NIC to the PHY drivers
  via mii_attach(). This got us rid of all such hacks except those of
  brgphy() in combination with bce(4) and bge(4), which is way beyond
  what can be expressed with simple flags.

While at it, I took the opportunity to change the NIC drivers to pass
up the error returned by mii_attach() (previously by mii_phy_probe())
and unify the error message used in this case where and as appropriate
as mii_attach() actually can fail for a number of reasons, not just
because of no PHY(s) being present at the expected address(es).

Reviewed by:	jhb, yongari
2010-11-07 11:12:30 +00:00
Lawrence Stewart 2347dd66d8 Remove siis.4 from the man4/Makefile. It was incorrectly included in r214875 as
part of the SIFTR MFC and breaks buildworld as siis.4 doesn't exist in stable/7.

This is an intentional direct commit to the 7-STABLE branch.

Pointy hat to:	lstewart
Noticed by:	Michael Butler <imb at protected-networks dot net>
2010-11-07 01:19:40 +00:00
Bjoern A. Zeeb 6263d099cd MFC r214250:
Make the IPsec SADB embedded route cache a union to be able to hold both the
  legacy and IPv6 route destination address.
  Previously in case of IPv6, there was a memory overwrite due to not enough
  space for the IPv6 address.

PR:		kern/122565
2010-11-06 15:56:44 +00:00
Lawrence Stewart cd152b0979 MFC r213913:
Retire the system-wide, per-reassembly queue segment limit. The mechanism is far
too coarse grained to be useful and the default value significantly degrades TCP
performance on moderate to high bandwidth-delay product paths with non-zero loss
(e.g. 5+Mbps connections across the public Internet often suffer).

Replace the outgoing mechanism with an individual per-queue limit based on the
number of MSS segments that fit into the socket's receive buffer.  This should
strike a good balance between performance and the potential for resource
exhaustion when FreeBSD is acting as a TCP receiver. With socket buffer
autotuning (which is enabled by default), the reassembly queue tracks the socket
buffer and benefits too.

As the XXX comment suggests, my testing uncovered some unexpected behaviour
which requires further investigation. By using so->so_rcv.sb_hiwat instead of
sbspace(&so->so_rcv), we allow more segments to be held across both the socket
receive buffer and reassembly queue than we probably should. The tradeoff is
better performance in at least one common scenario, versus a devious sender's
ability to consume more resources on a FreeBSD receiver.

The base code from r213913 was modified as part of this MFC in order to work
correctly on FreeBSD 7.

Sponsored by:	FreeBSD Foundation
Reviewed by:	andre, gnn, rpaulo
2010-11-06 15:49:59 +00:00
Lawrence Stewart 331999b64f MFC r213912:
- Switch the "net.inet.tcp.reass.cursegments" and
  "net.inet.tcp.reass.maxsegments" sysctl variables to be based on UMA zone
  stats. The value returned by the cursegments sysctl is approximate owing to
  the way in which uma_zone_get_cur is implemented.

- Discontinue use of V_tcp_reass_qsize as a global reassembly segment count
  variable in the reassembly implementation. The variable was used without
  proper synchronisation and was duplicating accounting done by UMA already. The
  lack of synchronisation was particularly problematic on SMP systems
  terminating many TCP sessions, resulting in poor TCP performance for
  connections with non-zero packet loss.

The base code from r213912 was modified as part of this MFC in order to work
correctly on FreeBSD 7.

Sponsored by:	FreeBSD Foundation
Reviewed by:	andre, gnn, rpaulo (as part of a larger patch)
2010-11-06 15:40:34 +00:00
Lawrence Stewart 078b8c8551 MFC r213910:
- Simplify implementation of uma_zone_get_max.
- Add uma_zone_get_cur which returns the current approximate occupancy of a
  zone. This is useful for providing stats via sysctl amongst other things.

Sponsored by:	FreeBSD Foundation
Reviewed by:	gnn, jhb
2010-11-06 15:21:46 +00:00
Lawrence Stewart d41da25b6d MFC r209050 (originally committed by jhb):
Add helper macros to iterate over available CPUs in the system.
CPU_FOREACH(i) iterates over the CPU IDs of all available CPUs.  The
CPU_FIRST() and CPU_NEXT(i) macros can also be used to iterate over
available CPU IDs.  CPU_NEXT(i) wraps around to CPU_FIRST() rather than
returning some sort of terminator.

Requested by:	rwatson
Reviewed by:	attilio
2010-11-06 15:10:31 +00:00
Lawrence Stewart 27c744850c MFC r213162:
Log the number of segments currently in the reassembly queue.

Sponsored by:	FreeBSD Foundation
2010-11-06 14:53:22 +00:00
Lawrence Stewart ca3c08e118 MFC r210203:
- Move common code from the hook functions that fills in a packet node struct to
  a separate inline function. This further reduces duplicate code that didn't
  have a good reason to stay as it was.

- Reorder the malloc of a pkt_node struct in the hook functions such that it
  only occurs if we managed to find a usable tcpcb associated with the packet.

- Make the inp_locally_locked variable's type consistent with the prototype of
  siftr_siftdata().

Sponsored by:	FreeBSD Foundation
2010-11-06 14:49:10 +00:00
Lawrence Stewart 9911e5e8c7 MFC r211396 (originally committed by andre):
Add uma_zone_get_max() to obtain the effective limit after a call to
uma_zone_set_max().

The UMA zone limit is not exactly set to the value supplied but rounded up to
completely fill the backing store increment (a page normally).  This can lead to
surprising situations where the number of elements allocated from UMA is higher
than the supplied limit value.  The new get function reads back the effective
value so that the supplied limit value can be adjusted to the real limit.

The base code from r211396 was modified as part of this MFC in order to work
correctly on FreeBSD 7.

Reviewed by:	jeffr
2010-11-06 14:38:57 +00:00
Lawrence Stewart 140c0b07c4 MFC r213158:
Internalise reassembly queue related functionality and variables which should
not be used outside of the reassembly queue implementation. Provide a new
function to flush all segments from a reassembly queue and call it from the
appropriate places instead of manipulating the queue directly.

The base code from r213158 was modified as part of this MFC in order to work
correctly on FreeBSD 7.

Sponsored by:	FreeBSD Foundation
Reviewed by:	andre, gnn, rpaulo
2010-11-06 13:46:58 +00:00
Lawrence Stewart fe9dd40d13 MFC r209662,209665:
Import the Statistical Information For TCP Research (SIFTR) kernel module into
FreeBSD. SIFTR logs a range of statistics on active TCP connections to a log
file, providing the ability to make highly granular measurements of TCP
connection state. The tool is aimed at system administrators, developers and
researchers alike. Please take it for a spin and test it out - the man page
should have all the information required to get you going.

Many thanks go to the Cisco University Research Program Fund at Community
Foundation Silicon Valley and the FreeBSD Foundation. Their support of our work
at the Centre for Advanced Internet Architectures, Swinburne University of
Technology is greatly appreciated.

The base SIFTR code from r209662 was modified as part of this MFC in order to
work correctly on FreeBSD 7.

r209980:

Catch up with the rename of DPCPU_SUM to DPCPU_VARSUM.

r209982:

The SIFTR DPCPU statistics struct was not being zeroed between enable/disable
cycles so the values would accumulate rather than reset for each cycle.

Sponsored by:	Cisco URP (r209662), FreeBSD Foundation
Reviewed by:	dwmalone, gnn, rpaulo (r209662)
Tested by:	Many on freebsd-current@ and elsewhere over the years
2010-11-06 13:03:33 +00:00
Lawrence Stewart 3d6b8b6ae9 The kthread/kproc KPI differs between 7.x and 8.x+ and requires the use of
kthread_exit() in order to get a wakeup delivered to the "struct proc *" which
ALQ relies on.

This is an intentional direct commit to the 7-STABLE branch.
2010-11-06 12:41:47 +00:00
Lawrence Stewart d0e4ee4699 MFC r207223:
- Rework the underlying ALQ storage to be a circular buffer, which amongst other
  things allows variable length messages to be easily supported.

- Extend KPI with alq_writen() and alq_getn() to support variable length
  messages, which is enabled at ALQ creation time depending on the arguments
  passed to alq_open(). Also add variants of alq_open() and alq_post() that
  accept a flags argument. The KPI is still fully backwards compatible and
  shouldn't require any change in ALQ consumers unless they wish to utilise the
  new features.

- Introduce the ALQ_NOACTIVATE and ALQ_ORDERED flags to allow ALQ consumers to
  have more control over IO scheduling and resource acquisition respectively.

- Strengthen invariants checking.

- Document ALQ changes in ALQ(9) man page.

Sponsored by:	FreeBSD Foundation
Reviewed by:	gnn, jeff, rpaulo, rwatson
2010-11-06 11:38:40 +00:00
Lawrence Stewart ff65dac1f4 MFC r206028:
The ALQ should not be considered drained until it has been made inactive.

Sponsored by:	FreeBSD Foundation
Reviewed by:	dwmalone, jeff, rpaulo, rwatson (as part of a larger patch)
2010-11-06 11:23:46 +00:00
Lawrence Stewart f586609039 MFC r206027:
According to SLEEP(9), msleep() is deprecated in favour of mtx_sleep().

Sponsored by:	FreeBSD Foundation
Reviewed by:	dwmalone, jeff, rpaulo, rwatson (as part of a larger patch)
2010-11-06 11:20:20 +00:00
Lawrence Stewart 0a3b5621e9 MFC r206026:
- Factor code to destroy an ALQ out of alq_close() into a private alq_destroy().

- Use the new alq_destroy() to properly handle a failure case in alq_open().

Sponsored by:	FreeBSD Foundation
Reviewed by:	dwmalone, jeff, rpaulo, rwatson (as part of a larger patch)
2010-11-06 11:17:30 +00:00
Lawrence Stewart db596e2c14 MFC r205959:
Add support for ALQ(9) to be compiled and loaded as a kernel module.

Sponsored by:	FreeBSD Foundation
Reviewed by:	dwmalone, jeff, rpaulo, rwatson
2010-11-06 11:09:04 +00:00
John Baldwin 896ebd20bf MFC 214673: Fix a few typos and style nits in the example code. 2010-11-05 13:45:26 +00:00
Doug Barton 58b526a93a MFV version 9.4-ESV-R3
This version contains several fixes for DNSSEC and DLV, as well as
fixes relevant to any resolving name server.
2010-11-04 21:50:19 +00:00
John Baldwin 915db9a062 MFC 214625: Correct the abbreviations for general I/O and signal traces. 2010-11-04 17:25:40 +00:00
John Baldwin 5359876c04 MFC 214449:
Set bootverbose directly in mi_startup() rather than via a SYSINIT.  This
ensures 'bootverbose' is in a valid state for all SYSINITs.
2010-11-04 17:23:06 +00:00
John Baldwin d0b0356e0c MFC 214203:
- Add a new PCI quirk to whitelist an old chipset that doesn't support
  PCI-express or PCI-X capabilities if we are running in a virtual machine.
- Whitelist the Intel 82440 chipset used by QEMU.
2010-11-04 17:13:30 +00:00
John Baldwin a28e78eba6 MFC 211820,211821,212292:
Intel QPI chipsets actually provide extra "non-core" PCI buses that
provide PCI devices for various hardware such as memory controllers,
etc.  for each socket.  These PCI buses are not enumerated via ACPI
however.  Add qpi(4) psuedo bus and Host-PCI bridge drivers to
enumerate these buses.  Currently the driver uses the CPU ID to
determine the bridges' presence.
2010-11-04 17:07:13 +00:00
John Baldwin 5e837fd60f Trim unneeded mergeinfo from a file. 2010-11-03 15:31:10 +00:00
John Baldwin bc23ace1a2 MFC 213672,213674,214396:
- Report subcommand handler errors in mfiutil so that tools that
  invoke the utilities can robustly report errors.
- Fix compile with -DDEBUG by using the correct mfi_pd_ref union definition
  in mfireg.h.
- 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.
2010-11-03 15:25:40 +00:00
Ed Schouten 9770f16cc4 MFC r214105:
Remove setpgid() call before executing child process.

  Using a separate process group here is bad, since (for example) job
  control in the TTY layer prevents interaction with the TTY, causing the
  child process to hang.
2010-11-03 10:24:57 +00:00
Edwin Groothuis 272c35d8b9 MFC of r214002, r214010
- Stylify of uudecode(1)
  Part of PR bin/124739.

- "b64decode -r" did not handle arbitary breaks in base64 encoded
  data. White space should be accepted anywhere in a base64 encoded
  stream, not just after every chunk (4 characters).

  Test-scenario:

  VmVsb2NpdHkgUmV3YXJkcw==

  and

  VmVsb2NpdHkgUmV3YXJkcw
  ==

  should both produce "Velocity Rewards"

PR:             bin/124739
Submitted by:   Mark Andrews <[email protected]>
2010-11-03 10:12:13 +00:00
Edwin Groothuis 6d57fbe734 MFC of r214722, tzdata2010o:
- Fiji goes into DST three weeks earlier in 2011.
2010-11-03 01:32:44 +00:00
Pyun YongHyeon c5af29deb0 MFC r214432:
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).
2010-11-03 01:28:57 +00:00
Pyun YongHyeon 70a755e6ca MFC r214302:
Add TSO support over VLAN for i82550/i82551. Controller requires
  VLAN hardware tagging to make TSO work over VLAN. So if VLAN
  hardware tagging is disabled explicitly clear TSO over VLAN. While
  I'm here allow disabling VLAN TX checksum offloading.

  Tested by:	Liudas < liudasb <> centras dot lt >
2010-11-03 01:26:11 +00:00
Pyun YongHyeon c51a786543 MFC r214087,214219,214251,214292:
r214087:
  Add workaround for BCM5906 controller silicon bug. If device
  receive two back-to-back send BDs with less than or equal to 8
  total bytes then the device may hang. The two back-to-back send
  BDs must be in the same frame for this failure to occur.
  Thanks to davidch for detailed errata information.

  Reviewed by:	davidch

r214219:
  Add workaround for BCM5906 A1 controller silicon bug. When
  auto-negotiation results in half-duplex operation, excess collision
  on the ethernet link may cause internal chip delays that may result
  in subsequent valid frames being dropped due to insufficient
  receive buffer resources. The workaround is to choose de-pipeline
  method as a flow control decision for SDI. De-pipeline method
  allows only 1 data in TxMbuf at a time such that a request to RDMA
  from SDI is made only when TxMbuf is empty. Thanks for david for
  providing detailed errata information.

r214251:
  Apply the same workaround for SDI flow control used on BCM5906 A1
  to BCM6906 A0/A2. This should fix a long standing BCM5906 A2 lockup
  issues. Data sheet explicitly mentions BCM5906 A0, A1 and A2 use
  de-pipelined mode on these revisions.
  Special thanks to Buganini who tried all combinations of
  experimental patches for more than 10 days.

  Tested by:	Buganini <buganini <> gmail dot com >

r214292:
  Use bge_chipid to compare controller ids. r214251 incorrectly used
  bge_chiprev.

  Reported by:	Buganini <buganini <> gmail dot com >
2010-11-03 00:13:22 +00:00
Pyun YongHyeon c6ec8b21d7 MFC r213747,213808,214216:
r213747:
  Protect bge(4) from accessing invalid NIC internal memory regions
  on BCM5906.

  Tested by:	Buganini < buganini <> gmail dot com >

r213808:
  Add more checks for resolved link speed in bge_miibus_statchg().
  Link UP state could be reported first before actual completion of
  auto-negotiation. This change makes bge(4) reprogram BGE_MAC_MODE,
  BGE_TX_MODE and BGE_RX_MODE register only after controller got a
  valid link.

r214216:
  Enable TX MAC state machine lockup fix for both BCM5755 or higher
  and BCM5906. Publicly available data sheet just says it may happen
  due to corrupted TxMbuf.
2010-11-02 23:56:35 +00:00
Pyun YongHyeon 37a0b0b2c0 MFC r213522,213587,213711:
r213522:
  Fix a long standing bug which regarded some revisions of controller
  as 5788. This caused BGE_MISC_LOCAL_CTL register is used to
  generate link state change interrupt for non-5788 controllers. The
  interrupt handler may or may not detect link state attention as
  status block wouldn't be updated when an interrupt was generated
  with BGE_MISC_LOCAL_CTL register. All controllers except 5700 and
  5788 should use host coalescing mode register to trigger an
  interrupt.

r213587:
  Do not blindly UP the interface when interface's MTU is changed. If
  driver is not running there is no need to up the interface. While
  I'm here hold driver lock before modifying MTU as it is referenced
  in RX handler.

r213711:
  The IFF_DRV_RUNNING flag is set at the end of bge_init_locked. But
  before setting the flag, interrupt was already enabled such that
  interrupt handler could be run before setting IFF_DRV_RUNNING flag.
  This can lose initial link state change interrupt which in turn
  make bge(4) think that it still does not have valid link. Fix this
  race by protecting the taskqueue with a driver lock.
  While I'm here move reenabling interrupt code after handling of link
  state chage.

  Reviewed by:	davidch
2010-11-02 23:49:48 +00:00
Pyun YongHyeon 9233214f1a MFC r213495,213742:
r213495:
  Add more comments to rings supported by the controller. Different
  versions of controller support different number of ring control
  blocks such that adjust code a bit to access known number of
  send/receive ring control blocks. Previously bge(4) blindly
  accessed 16 send/receive RCBs. Also move initializing standard
  receive producer ring producer index, jumbo receive producer ring
  producer index and mini receive producer ring producer index to
  the end of each receive producer ring initialization.

  Do not assume mini receive producer ring is available only when
  controller has jumbo frame capability, instead explicitly check
  ASIC version BCM5700 to disable mini receive producer ring.

  Additionally always enable send ring 0 regardless of controller
  versions. Previously bge(4) didn't enable send ring 0 if controller
  is BGE_IS_5705_PLUS. Becase bge(4) need 1 send ring to send frames
  at least, I have no idea how it would have worked so far.

  Submitted by:	davidch

r213742:
  Fix a regression introduced in r213495. r213495 disabled mini
  receive producer ring only for BCM5700. It was believed that
  BCM5700 with external SSRAM is the only controller that supports
  mini ring but it seems all BCM570[0-4] requires to disable mini
  receive producer ring. Otherwise, it caused unexpected RX DMA
  error or watchdog timeouts.

  Reported by:	marius, Steve Kargl <sgk <> troutmask dot apl dot washington dot edu>
  Tested by:	marius, Steve Kargl <sgk <> troutmask dot apl dot washington dot edu>
2010-11-02 23:43:27 +00:00
Pyun YongHyeon a2afaef94b MFC r213485,213710,213812:
r213485:
  Overhaul MII register access routine and remove unnecessary
  BGE_MI_MODE register accesses. Previously bge(4) used to read
  BGE_MI_MODE register to detect whether it needs to disable
  autopolling feature or not. Because we don't touch autopolling in
  other part of driver there is no reason to read BGE_MI_MODE
  register given that we know default value in advance. In order to
  achieve the goal, check whether the controller has CPMU(Central
  Power Mangement Unit) capability. If controller has CPMU feature,
  use 500KHz MII management interface(mdio/mdc) frequency regardless
  core clock frequency. Otherwise use default MII clock. While I'm
  here, add CPMU register definition.

  In bge_miibus_readreg(), rearrange code a bit and remove goto
  statement. In bge_miibus_writereg(), make sure to restore
  autopolling even if MII write failed. The delay time inserted after
  accessing BGE_MI_MODE register increased from 40us to 80us.

  The default PHY address is now stored in softc. All PHYs supported
  by bge(4) currently uses PHY address 1 but it will be changed when
  we add newer controllers. This change will make it easier to change
  default PHY address depending on PHY models.

  Submitted by:	davidch

r213710:
  Remove one last reference of BGE_MI_MODE register for auto polling.
  Previously bge(4) always enabled auto polling for non-BGE_FLAG_TBI
  controllers. With this change, auto polling is not used anymore so
  polling through mii(4) was introduced.

  Reviewed by:	davidch

r213812:
  Fix a regression introduced in r213710. r213710 removed the use of
  auto polling such that it made all controllers obtain link status
  information from the state of the LNKRDY input signal. Broadcom
  recommends disabling auto polling such that driver should rely on
  PHY interrupts for link status change indications. Unfortunately it
  seems some controllers(BCM5703, BCM5704 and BCM5705) have PHY
  related issues so Linux took other approach to workaround it.
  bge(4) didn't follow that and it used to enable auto polling to
  workaround it. Restore this old behavior for BCM5700 family
  controllers and BCM5705 to use auto polling. For BCM5700 and
  BCM5701, it seems it does not need to enable auto polling but I
  restored it for safety.
  Special thanks to marius who tried lots of patches with patience.

  Reported by:	marius
  Tested by:	marius
2010-11-02 23:36:54 +00:00
Pyun YongHyeon 2ad4ef902f MFC r213411,213464-213465,213468:
r213411:
  Enable fix for read DMA FIFO overruns on controllers that have this
  fix. Note, we still need workaround for controllers that lacks this
  fix and it needs more work in RX BD updating.

  Submitted by:	davidch

r213464:
  Separate common flags into controller specific and PHY related
  flags. There should be no functional changes. This change will make
  it easy to add more quirk/flags in future.

  Reviewed by:	davidch

r213465:
  Rearrange code a bit to correctly set PHY flags. This change make
  it easy to add more newer ASICs.

  Obtained from:	OpenBSD

r213468:
  Fix bge(4) build breakage when BGE_REGISTER_DEBUG is defined.
2010-11-02 23:26:07 +00:00
Pyun YongHyeon 85c5e1903c MFC r213316,213333-213334:
r213316:
  Fix IFCAP_TXCSUM/IFCAP_RXCSUM handling. Previously bge(4) used
  IFCAP_HWCSUM to know which capability should be changed such that
  disabling RX checksun offloading resulted in disabling TX checksum
  offloading.

r213333:
  Allow write DMA to request larger DMA burst size to get better
  performance on BCM5785.

  Obtained from:	OpenBSD

r213334:
  Remove extra semicolon.
2010-11-02 23:07:38 +00:00
Pyun YongHyeon 751007f3d3 MFC r213283,213410:
r213283:
  Implement hardware MAC statistics for BCM5705 or newer Broadcom
  controllers. bge(4) exported MAC statistics on controllers that
  maintain the statistics in the NIC's internal memory. Newer
  controllers require register access to fetch these values. These
  counters provide useful information to diagnose driver issues.

r213410:
  Consistently use ifHCOutOctets/ifHCInOctets instead of Octets as
  these names are used in data sheet. Also use UnicastPkts,
  MulticastPkts and BroadcastPkts instead of UcastPkts, McastPkts
  and BcastPkts to clarify its meaning.

  Suggested by:	bde
2010-11-02 22:59:45 +00:00
Pyun YongHyeon de48216b08 MFC r213081,213225,213280:
r213081:
  Always show asic/chip revision in device attach phase. There are
  too many bge(4) controllers there and model name does not
  necessarily match asic/chip revision. Relying on VPD string made
  it hard to identify exact asic/chip revision so the first step to
  debug bge(4) was getting exact asic/chip information with verbose
  boot which may not be available on production server.

r213255:
  Set the number of RX frames to receive after RX MBUF low watermark
  has reached. This reduced number of dropped frames when
  flow-control is enabled. Previously it dropped incoming frames once
  RX MBUF low watermark has reached. The value used in MAC RX MBUF
  low watermark is greater than or equal to 4 so receiving two more
  RX frames should not be a problem.

  Obtained from:	OpenBSD

r213280:
  After r207391, brgphy(4) passes resolved flow-control settings to
  parent driver. Use that information to configure flow-control.
  One drawback is there is no way to disable flow-control as we still
  don't have proper way to not advertise RX/TX pause capability to
  link partner. But I don't think it would cause severe problems and
  users can selectively disable flow-control in switch port.
2010-11-02 22:48:52 +00:00
Marius Strobl f0aedc5361 MFC: r214526
Partially revert r203829 (MFC'ed to stable/7 in r205921); 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-11-02 22:12:12 +00:00
Marius Strobl 2541d746d9 MFC: r201430
Fix card/device names, no functional change

The ADMtek AN985 is the cardbus variant of ADMtek AN983
The Netgear FA511 is just a relabled ADMtek AN985

PR:		kern/50574
2010-11-02 21:01:18 +00:00
Marius Strobl 662cb908fe MFC: r213878
Add a NetBSD-compatible mii_attach(), which is intended to eventually
replace mii_phy_probe() altogether. Compared to the latter the advantages
of mii_attach() are:
- intended to be called multiple times in order to attach PHYs in multiple
  passes (f.e. in order to only use sub-ranges of the 0 to MII_NPHY - 1
  range)
- being able to pass along the capability mask from the NIC to the PHY
  drivers
- being able to specify at which address (phyloc) to probe for a PHY
  (instead of always probing at all addresses from 0 to MII_NPHY - 1)
- being able to specify which PHY instance (offloc) to attach
- being able to pass along MIIF_* flags from the NIC to the PHY drivers
  (f.e. as required to indicated to the PHY drivers that flow control is
  supported by the NIC driver, which actually is the motivation for this
  change).

While at it, I used the opportunity to get rid of some hacks in mii(4)
like miibus_probe() generally doing work besides sheer probing and the
"EVIL HACK" (which will vanish entirely along with mii_phy_probe()) by
passing the struct ifnet pointer via an argument of mii_attach() as well
as to fix some resource leaks in mii(4) in case something fails.
Commits which will update the PHY drivers to honor the MII flags passed
down from the NIC drivers and take advantage of mii_attach() to get rid
of certain types of hacks in NIC and PHY drivers as well as a conversion
of the remaining uses of mii_phy_probe() will follow shortly.

Reviewed by:	jhb, yongari
Obtained from:	NetBSD (partially)
2010-11-02 20:06:49 +00:00
Bernhard Schmidt 381440db1c MFC r214160,214162,214236
r214236 & r214160:
The firmware does pad notifications to an even number of bytes (at least
the association notification), the included information though always
contains an elem block with an odd number of bytes. We handle the last
byte as if it might contain a whole elem block, this of course is not
true as one byte is not enough to hold a block, we therefore discard the
complete frame. The solution here is to subtract one from the actual
notification length, this is also what the Linux driver does. With this
change the frame ends exactly where the last elem block ends.

r214262:
The firmware always sets bit 14 and 15, to get the real associd we need
to clear those bits.
2010-11-01 19:04:16 +00:00
Yoshihiro Takahashi 2ebcfae63b MFC: revision 214258
Rewrite the i386 memory probe:
  - Move the base memory setup into a new basemem_setup() routine.
2010-10-31 08:50:31 +00:00
Bjoern A. Zeeb ec8b1338d4 MFC r214447:
Correct a typo.
2010-10-31 00:35:18 +00:00
Alan Cox f17b0df280 MFC r213408
If vm_map_find() is asked to allocate a superpage-aligned region of
  virtual addresses that is greater than a superpage in size but not a
  multiple of the superpage size, then vm_map_find() is not always
  expanding the kernel pmap to support the last few small pages being
  allocated.  Previously, we grew the kernel page table in
  vm_map_findspace() when we found the first available virtual address.
  Now, instead, we defer the call to pmap_growkernel() until we are
  committed to a range of virtual addresses in vm_map_insert().
2010-10-30 16:09:15 +00:00
Bjoern A. Zeeb bbba58fa26 MFC r214303:
Add initial inet DDB support for show in_ifaddr and show sin commands which
  proved to be useful while debugging address list problems.
2010-10-30 16:02:16 +00:00
Bjoern A. Zeeb e35584ea76 MFC r213930:
Close a race acquiring the IF_ADDR_LOCK() for each entry while iterating
  over all interfaces to make sure the address will neither change nor be
  freed while we are working on it.

  PR:		kern/146250
  Submitted by:	Mikolaj Golub (to.my.trociny gmail.com)
2010-10-30 11:30:49 +00:00
Hajimu UMEMOTO 38a897256c MFC r213453: When no protocol entry is found, getproto*_r(3)
should return zero.
2010-10-30 10:38:23 +00:00
Hajimu UMEMOTO 639315ad9b MFC r213403: Clear errno for each method dispatch. 2010-10-30 10:37:11 +00:00
Sergey Kandaurov 5cccfdc8e0 MFC r214131.
Enable copyback and system PD states.

Approved by:	kib (mentor)
2010-10-28 15:43:14 +00:00
Sergey Kandaurov ec5940cf97 MFC r214130.
Update PD state firmware definitions: add copyback, system.

Approved by:	kib (mentor)
2010-10-28 15:37:58 +00:00
Pyun YongHyeon 45b65c49fe MFC r213796:
Rewrite interrupt handler to give fairness for both RX and TX.
  Previously rl(4) continuously checked whether there are RX events
  or TX completions in forever loop. This caused TX starvation under
  high RX load as well as consuming too much CPU cycles in the
  interrupt handler. If interrupt was shared with other devices which
  may be always true due to USB devices in these days, rl(4) also
  tried to process the interrupt. This means polling(4) was the only
  way to mitigate the these issues.

  To address these issues, rl(4) now disables interrupts when it
  knows the interrupt is ours and limit the number of iteration of
  the loop to 16. The interrupt would be enabled again before exiting
  interrupt handler if the driver is still running. Because RX buffer
  is 64KB in size, the number of iterations in the loop has nothing
  to do with number of RX packets being processed. This change
  ensures sending TX frames under high RX load.

  RX handler drops a driver lock to pass received frames to upper
  stack such that there is a window that user can down the interface.
  So rl(4) now checks whether driver is still running before serving
  RX or TX completion in the loop.

  While I'm here, exit interrupt handler when driver initialized
  controller.

  With this change, now rl(4) can send frames under high RX load even
  though the TX performance is still not good(rl(4) controllers can't
  queue more than 4 frames at a time so low TX performance was one of
  design issue of rl(4) controllers). It's much better than previous
  TX starvation and you should not notice RX performance drop with
  this change. Controller still shows poor performance under high
  network load but for many cases it's now usable without resorting
  to polling(4).
2010-10-27 02:07:25 +00:00
Bernhard Schmidt c56f348311 MFC r213729:
Fix monitor mode which is implemented by doing a firmware scan. This
is a port from stable/6, seems like the code got lost during the
background scan changes in r170530.
2010-10-26 17:31:46 +00:00
Alexander Motin 5ee2647150 MFC r212754:
Add support for dumping kernel to gconcat.
Dumping goes to the component, where dump partition begins.
2010-10-25 08:23:38 +00:00
Andriy Gapon cc71ba4a47 MFC r214097: catch up manual pages with rename of vm_page_sleep_busy to
vm_page_sleep_if_busy
2010-10-25 08:11:51 +00:00
Andriy Gapon 6280c6508e MFC r214096: VOP_GETPAGES.9: clarify and correct description of
parameters and requirements
2010-10-25 08:09:19 +00:00
Andriy Gapon 559bbb5ef9 MFC r214095: PG_BUSY -> VPO_BUSY, PG_WANTED -> VPO_WANTED in manual
pages and comments
2010-10-25 08:07:57 +00:00
David E. O'Brien 5bb3ad6030 MFC r213814: Do not assume in growstackstr() that a "precious" character
will be immediately written into the stack after the call.  Instead let
the caller manage the "space left".
2010-10-24 23:09:00 +00:00
Pyun YongHyeon 467026d2d1 MFC r213844:
Make sure to not use stale ip/tcp header pointers. The ip/tcp
  header parser uses m_pullup(9) to get access to mbuf chain.
  m_pullup(9) can allocate new mbuf chain and free old one if the
  space left in the mbuf chain is not enough to hold requested
  contiguous bytes. Previously drivers can use stale ip/tcp header
  pointer if m_pullup(9) returned new mbuf chain.

  Reported by:	Andrew Boyer (aboyer <> averesystems dot com)
2010-10-24 21:17:23 +00:00
Pyun YongHyeon 21d640266c MFC r213842:
Backout r204230. TX mbuf parser for VLAN is still required to
  enable TX checksum offloading if VLAN hardware tagging is disabled.
2010-10-24 21:09:31 +00:00
Marius Strobl afe353da1e MFC: r213384
Consistently always explicitly set IFM_HDX for half-duplex.

Obtained from:	OpenBSD (mostly)
2010-10-24 13:42:03 +00:00
Marius Strobl 079faf2109 MFC: r213364
- In the spirit of previous simplifications factor out the checks for a
  different PHY instance being selected and isolation out into the wrappers
  around the service methods rather than duplicating them over and over
  again (besides, a PHY driver shouldn't need to care about which instance
  it actually is).
- Centralize the check for the need to isolate a non-zero PHY instance not
  supporting isolation in mii_mediachg() and just ignore it rather than
  panicing, which should sufficient given that a) things are likely to
  just work anyway if one doesn't plug in more than one port at a time and
  b) refusing to attach in this case just leaves us in a unknown but most
  likely also not exactly correct configuration (besides several drivers
  setting MIIF_NOISOLATE didn't care about these anyway, probably due to
  setting this flag for no real reason).
- Minor fixes like removing unnecessary setting of sc->mii_anegticks,
  using sc->mii_anegticks instead of hardcoded values etc.
2010-10-24 13:39:26 +00:00
Jilles Tjoelker 7c992d2cde MFC r213926: sh(1): Clarify subshells/processes for pipelines.
For multi-command pipelines,
1. all commands are direct children of the shell (unlike the original
   Bourne shell)
2. all commands are executed in a subshell (unlike the real Korn shell)
2010-10-23 14:16:33 +00:00
Jilles Tjoelker 3eeb422ca5 MFC r207831: sh(1): Fix "reserved word" vs "keyword" inconsistency.
Use "keyword" everywhere, like the output of the 'type' builtin, and only
mention "reserved word" once to say it is the same thing.
2010-10-23 14:15:10 +00:00
Jilles Tjoelker 5537520013 MFC r211621: sh(1): Add a brief summary of arithmetic expressions. 2010-10-23 14:04:04 +00:00
Jilles Tjoelker aab3358697 MFC r212417: sh(1): Remove xrefs for expr(1) and getopt(1).
expr(1) should usually not be used as various forms of parameter expansion
and arithmetic expansion replicate most of its functionality in an easier
way.

getopt(1) should not be used at all in new code. Instead, getopts(1) or
entirely manual parsing should be used.
2010-10-23 14:00:31 +00:00
Jilles Tjoelker a23ab3d0a8 MFC r197848: Clarify quoting of word in ${v=word} in sh(1). 2010-10-23 13:57:26 +00:00
Pyun YongHyeon aaf6bfb4d8 MFC r214089:
Correct handling of shared interrupt in sis_intr(). r212116 incorrectly
  released a drver lock for shared interrupt case such that it caused
  panic. While I'm here check whether driver is still running before
  serving TX/RX handler.

  Reported by:	Jerahmy Pocott < QUAKENET1 <> optusnet dot com dot au >
  Tested by:	Jerahmy Pocott < QUAKENET1 <> optusnet dot com dot au >
2010-10-23 00:44:16 +00:00
David E. O'Brien 37217529ab MFC
r213738: allow one to regression test 'sh' changes without having to
           install a potentially bad /bin/sh first.
  r213903: default to 'sh' from PATH if 'SH' env is not set.
2010-10-22 23:12:45 +00:00
David E. O'Brien a9e6070e06 MFC
r212243: improve comments in expand.c
  r214100: MFC r213815: only need to look as far as '..' to find 'test/'
  r214104:
    r213774: DEBUG_FLAGS should be used to enable extra debugging rather than
             frobbing CFLAGS directly.
    r213798: do not inline static functions if debugging
2010-10-22 17:49:11 +00:00
Matthew D Fleming 9a9404ef90 MFC r214062:
uma_zfree(zone, NULL) should do nothing, to match free(9).

Noticed by:	Ron Steinke <rsteinke at isilon dot com>
2010-10-22 16:00:45 +00:00
Sergey Kandaurov d6b7bbea4e MFC r214020:
Fix typo: Offlaod -> Offload.

PR:		docs/150756
Approved by:	avg (mentor)
2010-10-21 10:13:52 +00:00
Xin LI 8ce94c2765 MFC r190527,190528,190531:
190527(sam):
fix wired-wireless failover example and remove incorrect
comment about WPA not working

190528(sam):
remove bogus nwid use; that's a compat shim for netbsd

190531(bruffer):
Fix typo.

MFC r212100 (emaste),213632,214066:

Add a new syslog knob, net.link.lagg.failover_rx_all, to control
whether to accept input packets on any link in a failover lagg,
and add the corresponding documentation.
2010-10-20 17:58:12 +00:00
Edwin Groothuis 223ef9d219 MFC of r207830
strptime(3) confused July with June with the fr_FR locale.

When parsing the month "juillet" (abbr "jul"), %B recognized it as
"juin" (abbr "jui") because the full name of the month names is
checked at the same time as the abbrevation.

The new behaviour checks the full names first before checking the
abbrevation names.

PR:             kern/141939
Submitted by:   Denis Chatelain <[email protected]>
2010-10-19 21:05:22 +00:00
Sergey Kandaurov 7fae71e92c MFC r213574:
- tcpconnect incorrectly uses err() in usage() with errx() semantics [1]
- 64-bit aware fixes in printf() usage [2]
o   netrate/juggle: time_t has arch-dependent size
o   netrate/tcpconnect: don't assume %ll has always 64bit.

PR:		146088 [1], 146086 [2] (modified)
Approved by:	kib (mentor)
2010-10-19 14:11:50 +00:00
Sergey Kandaurov 7dd5fdf8bd MFC r213514:
Wrap lines for SiS and Promise entries to 80 columns.

PR:		docs/146195
Approved by:	avg (mentor)
2010-10-19 10:56:56 +00:00
Jaakko Heinonen 5760de4f61 MFC r213298:
Fix printing of the "rw" mount option in fstab(5) format (-p option).
fstab(5) format requires that one of "rw", "rq" or "ro" is always
specified.

PR:		bin/123021
2010-10-18 14:40:48 +00:00
Jaakko Heinonen 1fb4f626be Remove incorrectly placed mergeinfo. This is a direct commit to stable/7. 2010-10-18 14:36:51 +00:00
Marius Strobl 16e48ef8d6 MFC: r213868
- In the spirit of r212559 add a comment describing what will eventually
  lower the PIL.
- Just as with the AP ensure that the (S)TICK timer(s) are in a known
  state when starting BSPs.
2010-10-17 14:25:01 +00:00
Marius Strobl 948d865826 MFC: r213578
In the replacement text of the __bswapN_const() macros cast the argument
to the expected type so they work like the corresponding __bswapN_var()
functions and the compiler doesn't complain when arguments of different
width are passed.
2010-10-17 13:41:12 +00:00
Marius Strobl 14ed9b2014 MFC: r213575
Just use the sparc64 version of this header rather than duplicating it.
2010-10-17 13:13:12 +00:00
Marius Strobl e0d754da66 MFC: r185421
Renamed the FRAMELEN macro to TRUEPHY_FRAMELEN as for powerpc
it seems to be possible to collide with FRAMELEN from machine/frame.h.

Found by:	zec
2010-10-17 13:11:46 +00:00
Marius Strobl edae525d2c MFC: r173164
Setting sc->mii_anegticks to MII_ANEGTICKS_GIGE in rgephy_attach()
is redundant. mii_phy_add_media() already takes care of that.

Pointed out by:	marius
2010-10-17 13:10:22 +00:00
Marius Strobl 580f901331 MFC: r182067
Move the code that looks for the companion phy to a subroutine to make
sure we get the error handling right in both places.  This also
simplifies the code somewhat.
2010-10-17 13:07:35 +00:00
Marius Strobl 2cc212ea79 r182037, r182038, r182064
When there's an error, we don't want to free the children, since it
will be stack garbage.
2010-10-17 13:06:18 +00:00
Marius Strobl ea5a27f54b MFC: r182751
Recognize 88E1116R phy variation. This part is found on some embedded devices.

Obtained from:	Semihalf
2010-10-17 12:47:07 +00:00
Marius Strobl f5c9ebc27b MFC: r176773, r178598
Recognize Cicada CS8204 and CS8244 PHYs.
2010-10-17 12:43:15 +00:00
Marius Strobl e829747901 MFC: r175703
Fix a typo in a comment.
2010-10-17 12:34:20 +00:00
Marius Strobl dad9f13618 MFC: r213361
Try to adhere to style(9) and be consistent within this file.
2010-10-17 12:33:15 +00:00
Marius Strobl 127507f415 MFC: r213229
Use the mii_data provided via mii_attach_args and mii_pdata respectively
instead of reaching out for the softc of the parent.
2010-10-17 12:30:01 +00:00
Marius Strobl dc021cae96 MFC: r213188
- Remove clause 3 and 4 from TNF licenses.
- Remove closes 3 & 4 from Manuel Bouyer's license.

Obtained from:	NetBSD
2010-10-17 12:16:38 +00:00
Marius Strobl d2a030ba2f MFC: r204646
The NetBSD Foundation has granted permission to remove clause 3 and 4 from
the software.

Obtained from:	NetBSD
2010-10-17 12:11:43 +00:00
Marius Strobl 7738923e2f MFC: r213104
minor simplifications and cosmetics
2010-10-17 12:05:39 +00:00
Marius Strobl 37e3b113cd MFC: r213873
Explicitly lower the PIL to 0 as part of enabling interrupts, similar to
what is done on other platforms. Unlike as with the sched_throw(NULL)
called on BSPs during their startup apparently there's nothing which will
reliably lower it on APs. I'm unsure why this only came up on V215 though,
breaking these with r207248. My best guess is that these are the only
supported ones so far fast enough to lose some race.

PR:		151404
2010-10-17 11:51:59 +00:00
Bjoern A. Zeeb 9c9fa453b6 MFC r213837:
Remove dead code:
  assignment to a local variable not used anywhere after that.
2010-10-17 08:44:34 +00:00
Edwin Groothuis d051e0f752 Mega-merge of ncal into stable/7:
r186401:
Implement a new feature for the "-m" option: if the month number is
followed by 'f' or 'p', use the following or preceding month of that
number, respectively.  Document this.  Also includes other minor
grammatical and punctuation fixes to the manual page (capitalize
Easter, etc.).

r191330:
Implement highlighting of today in month view of cal/ncal just like
gnu cal does. This is currently disabled for year view because of hard
coded padding in that case. This will hopefully be fixed soon.

r191364:
Couple of changes based on feedback
o       Change mr/me to so/se [1].
o       Introduce a -h option to disable highlighting. [2]
o       Spell STDOUT_FILENO as such and pass NULL to tgetent()
to handle the case of unset TERM. [3]

r191687:
Fixed missing dependency.

r194366:
Fix column width of weekday names for multibyte locales.

r194447:
Since the width is always 2, it is enough to put just one
trailing space is enough.

r204697:
- Implement -3 option (show previous, this and next month) option.
- Add -A option (months after this month).
- Add -B option (months before this month).
- Fix highlighting of today in year overview.
- Fix aligning of "foreign" characters.

r204706:
Remove no-op of WARNS?=

r204849:
- document the -3, -A and -B properly in Synopsis.
- add highlight of current date for non-terminals.
- fix -J option.
- code cleanup.

r204908:
- Fix the highlighting for non-terminals when the last week is not
  7 days long.
- "-m <N> <YYYY>" now prints only the month, not the whole year.

r205071:
- With the introduction of -A, -B and -3, not all combinations of
  arguments makes sense anymore. For example, what would a combination
  of -3 (show three months) and -y (show the whole year) do?
  We will abort on these cases.
- Move the debug option -d to -H (from highlight), while -d is now
  used for setting the day of "today" so that -y and friends can
  be tested.

r205427:
Replace -b with -C and -B (as proposed by Alexander).
Add -3, -A and -B to the usage.
Update regression test for the new parameters.

r212032:
Use basename(3) to determine the name of the program.
2010-10-17 07:11:40 +00:00
Bjoern A. Zeeb 040bb6d0f4 MFC r213836:
Style: make the asterisk go with the variable name, not the type.
2010-10-17 03:13:30 +00:00
Andriy Gapon 112761755a MFC r213648: panic_cpu variable should be volatile 2010-10-16 20:01:41 +00:00
Andriy Gapon 88426b0f47 MFC r213651: add kmem_map_free sysctl: query largest contiguous free range in kmem_map 2010-10-16 11:44:58 +00:00
Andriy Gapon 4fb6831930 MFC r213527: vm.kmem_map_size: a sysctl to query current kmem_map->size 2010-10-16 11:41:20 +00:00
Bjoern A. Zeeb 6463946b4b MFC r186391,186483,186497 (qingli, kmacy 21 months ago):
r186391:
  Provide a condition variable to delay the cloned interface
  destroy operation until the referenced clone device has
  been closed by the process properly. The behavior is now
  consistently with the previous release.

r186483:
  - Close a race during which the open flag could be cleared but the
    tun_softc would still be referenced by adding a separate TUN_CLOSED
    flag that is set after tunclose is done referencing it.
  - drop the tun_mtx after the flag check to avoid holding it across
    if_detach which can recurse in to if_tun.c

r186497:
  The "tun?" dev need not be opened at all. One is allowed to perform
  the following operations, e.g.:
  1) ifconfig tun0 create
  2) ifconfig tun0 10.1.1.1 10.1.1.2
  3) route add -net 192.103.54.0/24 -iface tun0
  4) ifconfig tun0 destroy
  If cv wait on the TUN_CLOSED flag, then the last operation (4) will
  block forever.

  Revert the previous changes and fix the mtx_unlock() leak.

PR:		kern/116837
Submitted by:	Mikolaj Golub (to.my.trociny gmail.com)
		(Not used the patch, just did the MFC)
2010-10-15 15:06:32 +00:00
Bjoern A. Zeeb 81cf2a7df8 MFC r185963 (by csjp in 2008):
Consider processes attaching/detaching from tun(4) devices as being link
  state changes.  This change modifies tunopen and tunclose to call the
  if_link_state_change() function.  Among other things, this will result in
  devd(8) receiving events from devctl(4) for linkup/link down.  This allows
  us to do several useful things, including initializing tunnel parameters
  and adding routes.

  Discussed on:	freebsd-net
2010-10-15 14:33:46 +00:00
Edwin Groothuis c51b8948b9 Remove calendar.judaic from RELENG_7:
- It is out of date.
- It is properly fixed in HEAD and RELENG_8.
2010-10-14 21:51:53 +00:00
Edwin Groothuis d1309284a6 MFC of r206568
Allerheilingen -> Allerheiligen

Submitted by:   Ronald Klop <ronald at realworks dot nl>
2010-10-14 21:29:50 +00:00
Edwin Groothuis 7f577efa78 MFC of r212163
Adding a missing firstname (Monique)

PR:             conf/150049
Submitted by:   Thierry Thomas <[email protected]>
2010-10-14 21:19:04 +00:00
Edwin Groothuis 5d727e48ea MFC of r213032 r213033
Fix location and year of the Battle of the Plains of Abraham

PR:             150504
Submitted by:   Douglas Berry <[email protected]>
2010-10-14 21:17:32 +00:00
Jaakko Heinonen 4a8cd47e2c MFC r200036 by scottl:
Fix several cases where the periph lock was held over malloc.

PR:		kern/130735
2010-10-14 18:02:31 +00:00
David E. O'Brien cfd21e91da MFC r212770 & r212832:
+ Add the SCRIPT environmental variable to the sub-shell.
  + Add the 'command' argument (if supplied on the command line)
    to the typescript file.
2010-10-14 03:13:20 +00:00
David E. O'Brien 9681108efc MFC r212771:
Increase the hostname display width to >12 characters.
2010-10-14 02:19:53 +00:00
George V. Neville-Neil 3bcd71cde4 MFC 213691:
Add code to print the number and type of the CPU that is present in
the system as well has how many PMCs there are per CPU.  In this code
CPU and core are equivalent.
2010-10-12 22:11:31 +00:00
George V. Neville-Neil 5246b89b8f MFC 213409:
Fix two aliases that had the same name but were pointing to different
events.  These are now disamiguated.
2010-10-12 21:45:36 +00:00
George V. Neville-Neil f6621f2f94 MFC 177387,177388,177872,178456,179528,180394,186456,203800,204310,213327:
r177387

A multicast test.  The mctest program acts as both a source and a sink
for multicast packets.  Parameters for the interface, packet size,
number of packets, and interpacket gap may be given on the command line.
The sink records how many packets were missed, and at what time each
packet arrived.

r177388

Add the correct license.

r177872

Add a manual page and a Makefile.

Add code to reflect packets back from the sink so that we can measure
round trip at the source.

r178456

Updated the test to handle multiple sinks.  The sinks cut their
transmissions by the number of them running so that they do not
overwhelm the source.

Added a simple shell script to kick off sinks on multiple hosts as
well as a source on the host where the shell script is run.  The script
also collects the output of all the sinks and the source into files named
for the host on which the tests are run.  A date is appended to each output
file to make it unique per run.

r179528

Update mctest and its associated script to have a base port to listen
on so that multiple copies can be run easily.

Update documentation with group and port arguments which are optional.

r180394

Add a new program to the multicast test suite.  The mcgrab program
is used to grab and hold some number of multicast addresses in order
to test what happens when an interface goes over the number of multicast
addresses it can filter in hardware.

r186456

Fix a bug in the man page where we were not showing the correct flags
in the explanation. Several of the flags were -i, since it was a copy/paste
operation.

r203800

Fixed error checking of pthread(3) functions.

r204310

Moved mcgrab(1) into a separate directory -- our .mk infrastructure
doesn't currently have support for building multiple programs in a
single makefile.

While here, fixed manpages and makefiles (missing dependencies).

r213327

Change the output of mctest to give a summary of the results instead
of printing a long list.

Add a default base port, and default mulitcast address to the
runner script.

Add support for specifying a different local and remote interface
in the runner script.
2010-10-12 21:40:43 +00:00
John Baldwin 1d7872ac4b MFC 213226:
Rewrite the i386 memory probe:
- Check for SMAP data from the loader first.  If it exists, don't bother
  doing any VM86 calls at all.  This will be more friendly for non-BIOS
  boot environments such as EFI, etc.
- Move the base memory setup into a new basemem_setup() routine instead
  of duplicating it.
- Simplify the XEN case by removing all of the VM86/SMAP parsing code rather
  than just jumping over it.
- Adjust some comments to better explain the code flow.
2010-10-12 19:28:33 +00:00
Bernhard Schmidt d7572cb694 When bringing the interface down we clear the command queue but do
not reset the sc_cmd_cur and sc_cmd_next indices. If there are
still pending commands while clearing the queue those two indices
are off by at least one. This leads to no commands being sent
to the firmware until the queue overruns. Fix this by also resetting
the indices.

This is a direct commit as the code does not exist in head.
2010-10-12 17:12:35 +00:00
John Baldwin 0018e66602 MFC 213300:
If an RCS file is truncated, rcsfile_getdelta() will return NULL.  Instead
of faulting, check for NULL.  However, returning an error would cause csup
to just abort the entire update.  Instead, break out of the loop and
return ok.  The attempts to update the file will trigger a MD5 failure which
will cause csup to download the entire file as a fixup.
2010-10-12 17:12:22 +00:00
John Baldwin d33d48ee07 MFC 194070: Remove semicolon that should not have been there. 2010-10-12 17:09:33 +00:00
John Baldwin e34242e75f MFC 213028,213328:
- Expand scope of tun/tap softc locks to cover more softc fields and
  driver-maintained ifnet fields (such as if_drv_flags).
- Use soft locks as the mutex that protects each interface's knote list
  rather than using the global knote list lock.  Also, use the softc
  for kn_hook instead of the cdev.
- Use mtx_sleep() instead of tsleep() when blocking in the read routines.
  This fixes a lost wakeup race.
- Remove D_NEEDGIANT now that the cdevsw routines use the softc lock
  where locking is needed.
- Lock IFQ when calculating the result for FIONREAD in tap(4).  tun(4)
  already did this.
- Remove remaining spl calls.
2010-10-12 16:09:08 +00:00
John Baldwin 52de504a3c MFC 213271:
Account for unlocking a spin mutex in the lock profiling code in the !SMP
case.
2010-10-12 15:48:27 +00:00
John Baldwin 0b42e349f1 MFC 212974:
Comment nit, set TDF_NEEDRESCHED after the comment describing why it is
done rather than before.
2010-10-12 15:26:37 +00:00
George V. Neville-Neil 68b8e6f504 MFC 213402:
Fix punctuation and grammar, mostly by ending sentences with a period.
2010-10-11 16:57:02 +00:00
Jaakko Heinonen 82e41e5739 MFC r200752:
Avoid sharing the file descriptor of the output file with traced
processes by setting the FD_CLOEXEC flag for the output file.

PR:		bin/140493
2010-10-11 13:31:09 +00:00
Xin LI 961c41a252 MFC r213225:
Add a bandaid for a long-standing race condition during route entry
un-expiring.

The previous version of code have no locking when testing rt_refcnt.
The result of the lack of locking may result in a condition where
a routing entry have a reference count but at the same time have
RTPRF_OURS bit set and an expiration timer.  These would eventually
lead to a panic:

	panic: rtqkill route really not free

When the system have ICMP redirects accepted from local gateway
in a moderate frequency, for instance.

Commit this workaround for now until we have some better solution.

PR:		kern/149804
Reviewed by:	bz
Tested by:	Zhao Xin, Pete French
2010-10-11 11:25:37 +00:00
Kai Wang 286b2884f0 MFC r212373:
libelf is overly strict about the type and alignment of Elf_Data
  objects inside one ELF section, which prevents the creation of a ELF
  section with mixed data types. For example, gcc LTO use libelf to
  create a .gnu_lto_XXX section that contains integers and a string
  table, which doesn't work with our libelf implementation.

  The changes made in this commit include:
  * Allow Elf_Data type to be different than section type.
  * Relax Elf_Data alignment check.
  * Align each Elf_Data by their own alignment instead of section alignment.
2010-10-10 12:21:35 +00:00
Konstantin Belousov 166dec4937 MFC r213382:
In makectx(), always use the tf_rsp from trap frame. %rsp is pushed
unconditionally by hardware on the trap.

PR:   amd64/151167
2010-10-10 07:28:56 +00:00
Pyun YongHyeon 0604fc4422 Fix build breakage introducted in r213604. 2010-10-09 20:52:36 +00:00
Gavin Atkinson 083ea70d52 Merge r213061 from head:
Various changes from various sources:

  - Add "children" [1]
  - Add "acknowledgement", "acknowledgment", "Austria" and "haunted" [2]
  - Add "near", "antidisestablishmentarianism" and "Persephone" [2]
  - "Transvaal" should be capitalized [2]
  - Correct spelling of "structurelessness" and "Athena" [2]
  - Add missing atomic elements [3]
  - Add various words from "word of the day" lists [3]

Also, set fbsd:nokeywords on web2, to allow checkin.

PR:		conf/149756 [1]
Submitted by:	Nick Johnson <freebsd spatula.net> [1]
Obtained from:	NetBSD [2], OpenBSD [3]
2010-10-09 13:07:21 +00:00
Andriy Gapon a8829e1dc2 MFC r210782,210837: Update the "desiredvnodes" calculation.
On behalf of:	alc
2010-10-09 09:24:16 +00:00
Xin LI f655196920 MFC r213488:
Use a defined FreeBSD version.
2010-10-09 00:36:32 +00:00
Xin LI 4518a8912f MFC r213487:
Add definition for FreeBSD 7.4, which will be used in a manual page change.
2010-10-09 00:34:58 +00:00
Pyun YongHyeon 1a196a87fd MFC r212167:
Initial WOL support. NS DP8315 was tested but SiS900/SiS7016 was
  not tested.
  While I'm here, clean up SIOCSIFCAP handler.
2010-10-08 23:34:45 +00:00
Pyun YongHyeon ef92ac2492 MFC r188463:
Fix shutdown prototypes.
2010-10-08 23:29:45 +00:00
Pyun YongHyeon 551ef82f43 MFC r212166:
Implement initial device suspend/resume method.
2010-10-08 23:14:21 +00:00
Pyun YongHyeon 69aee01855 MFC r212159,212161:
r212159:
  Document tunable dev.sis.%unit.manual_pad
  While I'm here Xref vlan(4) as sis(4) supports VLAN oversized
  frames.

r212161:
  Better wording.

  Submitted by:	jkim
2010-10-08 20:58:48 +00:00
Pyun YongHyeon 9e573d2af8 MFC r212158:
Enable sis(4). sis(4) should work on all architectures.
2010-10-08 20:55:27 +00:00
Pyun YongHyeon 69cfda8857 MFC r212157:
Unlike most other controllers, NS DP83815/DP83816 controllers seem
  to pad with 0xFF when it encounter short frames.  According to RFC
  1042 the pad bytes should be 0x00.
  Because manual padding consumes extra CPU cycles, introduce a new
  tunable which controls the padding behavior. Turning this tunable
  on will have driver pad manually but it's disabled by default. Users
  can enable software padding by setting the following tunable to
  non-zero value.

  dev.sis.%d.manual_pad="1"

  PR:	kern/35422 (patch not used)
2010-10-08 20:52:47 +00:00
Pyun YongHyeon f84acbf8e9 MFC r212121,212156:
r212121:
  Move sis_reset() to sis_initl(). This ensures driver starts with
  known good state of controller.

r212156:
  Fix the last endianness issue on handling station address which
  prevented driver from working on big-endian machines. Also rewrite
  station address programming to make it work on strict-alignment
  architectures. With this change, sis(4) now works on sparc64 and
  performance number looks good even though sis(4) have to apply
  fixup code to align received frames on 2 bytes boundary on sparc64.
2010-10-08 20:49:44 +00:00
Pyun YongHyeon f0d28c37c2 MFC r212120:
Avoid controller reinitialization which could be triggered by
  dhclient(8) or alias addresses are added.

  PR:	kern/87506
2010-10-08 20:44:35 +00:00
Pyun YongHyeon d66bf03f29 MFC r212117,212119:
rr212117:
  Report result of link state change to caller. Previously it always
  returned success.

r212119:
  Do not reinitialize controller whenever promiscuous mode or
  allmulti is toggled. Controller does not require reinitialization.
  This removes unnecessary controller reinitialization whenever
  tcpdump is used.
  While I'm here remove unnecessary variable reinitialization.
2010-10-08 20:41:15 +00:00
Pyun YongHyeon 3f0f0e7b65 MFC r212116:
Overhaul link state change handling. Previously sis(4) blindly
  configured TX/RX MACs before getting a valid link. After that, when
  link state change callback is called, it called device
  initialization again to reconfigure TX/RX MACs depending on
  resolved link state. This hack created several bad side effects and
  it required more hacks to not collide with sis_tick callback as
  well as disabling switching to currently selected media in device
  initialization. Also it seems sis(4) was used to be a template
  driver for long time so other drivers which was modeled after
  sis(4) also should be changed.

  TX/RX MACs are now reconfigured after getting a valid link. Fix for
  short cable error is also applied after getting a link because it's
  only valid when the resolved speed is 100Mbps.

  While I'm here slightly reorganize interrupt handler such that
  sis(4) always read SIS_ISR register to see whether the interrupt is
  ours or not. This change removes another hack and make it possible
  to nuke sis_stopped variable in softc.
2010-10-08 20:37:13 +00:00
Pyun YongHyeon 676d4fbd2d MFC r212113:
s/u_intXX_t/uintXX_t/g
2010-10-08 20:31:35 +00:00
Pyun YongHyeon 9d7989f124 MFC r212109,212124,212185:
r212109:
  bus_dma(9) cleanup.
   o Enforce TX/RX descriptor ring alignment. NS data sheet says the
     controller needs 4 bytes alignment but use 16 to cover both SiS
     and NS controllers. I don't have SiS data sheet so I'm not sure
     what is alignment restriction of SiS controller but 16 would be
     enough because it's larger than the size of a TX/RX descriptor.
     Previously sis(4) ignored the alignment restriction.
   o Enforce RX buffer alignment, 4.
     Previously sis(4) ignored RX buffer alignment restriction.
   o Limit number of TX DMA segment to be used to 16. It seems
     controller has no restriction on number of DMA segments but
     using more than 16 looks resource waste.
   o Collapse long mbuf chains with m_collapse(9) instead of calling
     expensive m_defrag(9).
   o TX/RX side bus_dmamap_load_mbuf_sg(9) support and remove
     unnecessary callbacks.
   o Initial endianness support.
   o Prefer local alignment fixup code to m_devget(9).
   o Pre-allocate TX/RX mbuf DMA maps instead of creating/destroying
     these maps in fast TX/RX path. On non-x86 architectures, this is
     very expensive operation and there is no need to do that.
   o Add missing bus_dmamap_sync(9) in TX/RX path.
   o watchdog is now unarmed only when there are no pending frames
     on controller. Previously sis(4) blindly unarmed watchdog
     without checking the number of queued frames.
   o For efficiency, loaded DMA map is reused for error frames.
   o DMA map loading failure is now gracefully handled. Previously
     sis(4) ignored any DMA map loading errors.
   o Nuke unused macros which are not appropriate for endianness
     operation.
   o Stop embedding driver maintained structures into descriptor
     rings. Because TX/RX descriptor structures are shared between
     host and controller, frequent bus_dmamap_sync(9) operations are
     required in fast path. Embedding driver structures will increase
     the size of DMA map which in turn will slow down performance.

r212124:
  Fix stupid error in r212109 which didn't swap DMA maps. This caused
  IOMMU panic on sparc64 under high TX load.

r212185:
  Fix another bug introduced in r212109. We should unload DMA maps
  only after sending the last fragment of a frame so the mbuf pointer
  also should be stored in the last descriptor index.
2010-10-08 20:27:51 +00:00
Pyun YongHyeon b2e07ab223 MFC r212103-212105:
r212103:
  Remove leading and trailing white spaces.
  No functional changes.

r212104:
  style(9) - space after keywords.

r212105:
  Nuke unnecessary return at the end of function.
2010-10-08 20:13:42 +00:00
Pyun YongHyeon 8c43d4244c MFC r182065:
There actually were bugs in the original handling that I missed last
  night.

  Free the children after each pci bus that is searched.  Otherwise we
  leak them.  With free in the new place, we also have to free children
  before going to done when we find the device we're looking for.

  Also, if we can't get the children of a device, just ignore that bus.
2010-10-08 20:12:00 +00:00
Pyun YongHyeon f0bf00d962 MFC r212972,21300:
r212972:
  Remove unnecessary controller reinitialization.

  PR:	kern/87506

r213000:
  Fix build breakage introduced in r212972.
2010-10-08 19:34:23 +00:00
Pyun YongHyeon b2f3fb8b14 MFC r212971:
Remove unnecessary controller reinitialization.
  StarFire controller does not require controller reinitialization to
  program perfect filters. While here, make driver immediately exit
  from interrupt/polling handler if driver reinitialized controller.

  PR:	kern/87506
2010-10-08 19:29:17 +00:00
Pyun YongHyeon 38d1bcec10 MFC r212969:
Make sure to clear IFF_DRV_RUNNING to reinitialize controller.
  While I'm here update if_oerrors counter when driver encounters
  watchdog timeout.
2010-10-08 19:25:46 +00:00
Pyun YongHyeon 673ba9762e MFC r212968:
Remove unnecessary controller reinitialization.

  PR:	kern/87506
2010-10-08 19:21:16 +00:00
Pyun YongHyeon 89d01873be MFC r212306-212307,212342:
r212306:
  Remove trailing CR at EOL.

r212307:
  Consistently use tab characters instead of tab + space characters.
  No functional changes.

r212342:
  Correct definition of T2 mode bit of MRBE Message Page 5 Next Page
  Control Register.
2010-10-08 19:00:36 +00:00
Pyun YongHyeon dc93379bf4 MFC r212069,212071:
r212069:
  bge_txeof() already checks whether it has to free transmitted mbufs
  or not by comparing reported TX consumer index with saved index. So
  remove unnecessary check done after freeing transmitted mbufs.
  While I'm here nuke unnecessary variable initializations.

r212071:
  Remove unnecessary atomic operation in bge_poll. bge(4) always
  holds a driver lock in the function entry and
  memory synchronization is handled by bus_dmamap_sync(9).
2010-10-08 18:51:28 +00:00
Pyun YongHyeon 3a9d3553e5 MFC r212061,212065,212302:
r212061:
  Split common parent DMA tag into ring DMA tag and TX/RX mbuf DMA
  tag. All controllers that are not BCM5755 or higher have 4GB
  boundary DMA bug. Previously bge(4) used 32bit DMA address to
  workaround the bug(r199670). However this caused the use of bounce
  buffers such that it resulted in poor performance for systems which
  have more than 4GB memory. Because bus_dma(9) honors boundary
  restriction requirement of DMA tag for dynamic buffers, having a
  separate TX/RX mbuf DMA tag will greatly reduce the possibility of
  using bounce buffers. For DMA buffers allocated with
  bus_dmamem_alloc(9), now bge(4) explicitly checks whether the
  requested memory region crossed the boundary or not.
  With this change, only the DMA buffer that crossed the boundary
  will use 32bit DMA address. Other DMA buffers are not affected as
  separate DMA tag is created for each DMA buffer.
  Even if 32bit DMA address space is used for a buffer, the chance to
  use bounce buffer is still very low as the size of buffer is small.
  This change should eliminate most usage of bounce buffers on
  systems that have more than 4GB memory.

  More correct fix would be teaching bus_dma(9) to honor boundary
  restriction for buffers created with bus_dmamem_alloc(9) but it
  seems that is not easy.

  While I'm here cleanup bge_dma_map_addr() and remove unnecessary
  member variables in bge_dmamap_arg structure.

  Tested by:	marcel

r212065:
  Handle PAE case correctly. You cannot effectively specify a 4GB
  boundary in PAE case so use a 2GB boundary for PAE as suggested by
  jhb.

  Pointed out by:	jhb
  Reviewed by:	jhb

r212302:
  Make sure to create DMA'able memory for statistics block. This was
  missed in r212061 and it caused crashes for 570x controllers as
  controller DMAed statistics to physical address 0.

  Reported by:	kan
2010-10-08 18:46:02 +00:00
Pyun YongHyeon 558b019652 MFC r188392:
Destroy TX tag outside of loop scope.

  Found with:	Coverity Prevent(tm)
  CID:		3886
2010-10-08 18:31:56 +00:00
Pyun YongHyeon 12191c6347 MFC r213306:
Rename rl_setmulti() to rl_rxfilter() as rl_rxfilter() will handle
  IFF_ALLMULTI/IFF_PROMISC as well as multicast filter configuration.
  Rewrite RX filter logic to reduce number of register accesses and
  make it handle promiscuous/allmulti toggling without controller
  reinitialization.

  Previously rl(4) counted on controller reinitialization to reprogram
  promiscuous configuration but r211767 resulted in avoiding
  controller reinitialization whenever promiscuous mode is toggled.
  To address this, keep track of driver's view of interface state and
  handle IFF_ALLMULTI/IFF_PROMISC changes without reinitializing
  controller. This should fix a regression introduced in r211267.

  While I'm here remove unnecessary variable reassignment in ioctl
  handler.

  PR:	kern/151079
2010-10-08 18:26:14 +00:00
Matthew D Fleming 8d9ecdfa74 MFC r212926:
Use destroy_dev_sched(9) instead of destroy_dev(9) in passcleanup() as
it is indirectly a d_close method.
2010-10-08 18:06:30 +00:00
Andriy Gapon a772717cce MFC r213322: sysctls in kern_shutdown: add twin tunables 2010-10-08 08:14:43 +00:00
Andriy Gapon c7233cddc0 MFC r213305: there must be only one SYSINIT with
SI_SUB_RUN_SCHEDULER+SI_ORDER_ANY order
2010-10-08 08:09:45 +00:00
Andriy Gapon 0039f4ab72 MFC r213304: debug.kdb.stop_cpus sysctl: hint that this is also a
tunable
2010-10-08 07:58:57 +00:00
Andriy Gapon bcd6e153f6 MFC r213303: kmem_size* sysctls: hint that these are also tunables 2010-10-08 07:54:55 +00:00
David Xu d328c917de MFC r213258:
- kern_sched_rr_get_interval should return interval for thread 1 in
      target process.
- eliminate a goto.
2010-10-07 13:13:02 +00:00
David Xu 70c2e4da44 MFC r211833:
Decrease rdlock count only when thread unlocked a reader lock.
2010-10-07 12:57:16 +00:00
Xin LI 6ba5b27ed0 MFC r211059:
Address an edge condition that we found at work, where the carp(4)
interface goes to issue LINK_UP, then LINK_DOWN, then LINK_UP at
cold boot.  This behavior is not observed when carp(4) interface
is created slightly later, when the underlying interface is fully
up.

Before this change what happen at boot is roughly:

 - ifconfig creates em0 interface;
 - ifconfig clones a carp device using em0;
   (em0's link state is DOWN at this point)
 - carp state: INIT -> BACKUP [*]
 - carp state: BACKUP -> MASTER
 - [Some negotiate between em0 and switch]
 - em0 kicks up link state change event
   (em0's link state is now up DOWN at this point)
 - do_link_state_change() -> carp_carpdev_state()
 - carp state: MASTER -> INIT (via carp_set_state(sc, INIT)) [+]
 - carp state: INIT -> BACKUP
 - carp state: BACKUP -> MASTER

At the [*] stage, em0 did not received any broadcast message from other
node, and assume our node is the master, thus carp(4) sets the link
state to "UP" after becoming a master.  At [+], the master status
is forcely set to "INIT", then an election is casted, after which our
node would actually become a master.

We believe that at the [*] stage, the master status should remain as
"INIT" since the underlying parent interface's link state is not up.

Obtained from:  iXsystems, Inc.
Reported by:    jpaetzel
2010-10-07 00:37:40 +00:00
Xin LI 6d10ecfbf2 MFC r210344:
In the past gunzip(1) write()'s after each inflate return.  This is
not optimal from a performance standpoint since the write buffer is
not necessarily be filled up when the inflate rountine reached the
end of input buffer and it's not the end of file.

This problem gets uncovered by trying to pipe gunzip -c output to
a GEOM device directly, which enforces the writes be multiple of
sector size.

Sponsored by: iXsystems, Inc.
Reported by:  jpaetzel
2010-10-07 00:30:29 +00:00
Marius Strobl 6c11915d3f MFC: r213105, r213147
Improve r56796; the reply handler actually may remove the request from
the chain in which case it shouldn't be removed twice.
Reported by:	Staale Kristoffersen
2010-10-04 20:13:21 +00:00
Marius Strobl 698e72fe0f MFC: r213102
Remove the duplicate logging of failed read requests, whose error message
also was inappropriate as it triggered for every EACCESS and ENOTFOUND, not
just the case the -n option is intended to deal with and thus really spammed
us with ~20 messages in the default configuration when booting a diskless
FreeBSD client, introduced with r207608 commited to stable/7 in r213039)
again.
2010-10-04 20:02:54 +00:00
Marius Strobl 2bbbc918b5 MFC: r213099
Make WARNS=6 clean.
2010-10-04 19:59:11 +00:00
Marius Strobl 7568141cb6 MFC: r213075
Try to adhere to style.Makefile(5).
2010-10-04 19:51:16 +00:00
Marius Strobl 302bc3b614 MFC: r213053
Remove an explicit assignment of the CFLAGS variable intended for
debugging purposes only.
2010-10-04 19:40:01 +00:00
Bernhard Schmidt 000150aee2 Create the var/run/wpa_supplicant directory where the wpa_supplicant
RC script wants to save a pidfile for each interface.
2010-10-01 17:20:30 +00:00
Edwin Groothuis 41b6fcf3f3 MFC of 213312, tzdata2010m
- Fix historical data for Hongkong
- Fix location description for Antarctica/Vostok
2010-09-30 22:03:33 +00:00
Andriy Gapon 88aa887704 MFC r212993: acpi_attach: do not explicitly install default handlers for
default address spaces
2010-09-29 09:25:22 +00:00
Mike Silbersack 15f484cd13 MFC rev 198719: Fix sym driver for 64-bit platforms with > 4GB of ram. 2010-09-28 06:08:43 +00:00
Andriy Gapon 0f28cdd3bd MFC r212932,212949: tools/umastat: fix build on amd64 and more
PR:		misc/146119
2010-09-28 05:57:50 +00:00
Pyun YongHyeon 232910c04b MFC r211913:
Do not allocate multicast array memory in multicast filter
  configuration function. For failed memory allocations, em(4)/lem(4)
  called panic(9) which is not acceptable on production box.
  igb(4)/ixgb(4)/ix(4) allocated the required memory in stack which
  consumed 768 bytes of stack memory which looks too big.

  To address these issues, allocate multicast array memory in device
  attach time and make multicast configuration success under any
  conditions. This change also removes the excessive use of memory in
  stack.

  Reviewed by:	jfv
2010-09-27 18:34:04 +00:00
Pyun YongHyeon 7b79cb9e33 MFC r211909:
If em(4) failed to allocate RX buffers, do not call panic(9).
  Just showing some buffer allocation error is more appropriate
  action for drivers. This should fix occasional panic reported on
  em(4) when driver encountered resource shortage.

  Reviewed by:	jfv
2010-09-27 18:22:50 +00:00
Pyun YongHyeon 29648f5378 MFC r211907:
Do not call voluntary panic(9) in case of if_alloc() failure.

  Reviewed by:	jfv
2010-09-27 18:20:04 +00:00
Pyun YongHyeon e11e6fb939 MFC r211400:
Remove unnecessary clean target in em(4), igb(4) and ixgbe(4).
  While here also remove man target in igb(4).

  Reviewed by:	jfv
2010-09-27 17:38:30 +00:00
Pyun YongHyeon dfbbbc9557 MFC r212755:
Fix incorrect RX BD producer updates. The producer index was
  already updated after allocating mbuf so driver had to use the last
  index instead of using next producer index. This should fix driver
  hang which may happen under high network load.

  Reported by:	Igor Sysoev <is <> rambler-co dot ru>, Vlad Galu <dudu <> dudu dot ro>
  Tested by:	Igor Sysoev <is <> rambler-co dot ru>, Vlad Galu <dudu <> dudu dot ro>
2010-09-27 17:12:54 +00:00
John Baldwin 32f0e1ff2d MFC 212902:
Tweak the stats exported by the e1000 drivers:
- Add a single sysctl procedure to all three drivers to read an arbitrary
  register (the register is passed as arg2).  Use it to replace existing
  routines in igb(4) that used a separate routine for each register, and
  to add support for missing stats in em(4) and lem(4).
- Move the 'rx_overruns' and 'watchdog_timeouts' stats out of the MAC stats
  section as they are driver stats, not MAC counters.
- Simplify the code that creates per-queue stats in igb(4) to use a single
  loop and remove duplicated code.
- Properly read all 64 bits of the 'good octets received/transmitted' in
  em(4) and lem(4).
- Actually read the interrupt count registers in em(4), and drop the
  'host to card' sysctl stats from em(4) as they are not implemented in
  any of the hardware this driver supports.
- Restore several stats to em(4) that were lost in the earlier stats
  conversion including per-queue stats.
- Export several MAC stats in em(4) that were exported in igb(4) but not
  in em(4).
- Export stats in lem(4) using individual sysctls as in em(4) and igb(4).
2010-09-27 16:29:46 +00:00
Andriy Gapon aa648ec706 MFC r212544: bus_add_child: add specialized default implementation that
calls panic
2010-09-27 06:04:17 +00:00
Xin LI d3991b56da MFC r211393 (by des):
In setusercontext(), do not apply user settings unless running as the
user in question (usually but not necessarily because we were called
with LOGIN_SETUSER).  This plugs a hole where users could raise their
resource limits and expand their CPU mask.

Approved by:	des
2010-09-24 23:48:29 +00:00
Pyun YongHyeon 02791da0e9 MFC r191609:
remove dead code with reference to IFQ_HANDOFF
2010-09-24 20:08:59 +00:00
Pyun YongHyeon afe4048d1a MFC r195484:
Make xl(4) build with Tx checksum offload.

  PR:	kern/136409
2010-09-24 20:04:23 +00:00
Pyun YongHyeon 8db488f21b MFC r211768:
Remove unnecessary controller reinitialization.

  PR:	kern/87506
2010-09-24 19:31:53 +00:00
Pyun YongHyeon 2e7fdcbcff MFC r211767:
Remove unnecessary controller reinitialization.

  PR:	kern/87506
2010-09-24 19:29:01 +00:00
Pyun YongHyeon 1459ed3ef1 MFC r211766:
vr_init_locked() will stop and reset the controller. Remove
  unnecessary vr_stop()/vr_reset() calls.
2010-09-24 19:26:27 +00:00
Pyun YongHyeon 04dafe97c3 MFC r211765:
Remove unnecessary controller reinitialization.
  CAM filter handling was rewritten long time ago so it should not
  require controller reinitialization.

  PR:	kern/87506
2010-09-24 19:22:41 +00:00
Pyun YongHyeon cb35fa1c75 MFC r211764:
Add PNP id for Compex RL2000.
  I'm not sure whether adding this logical id is correct or not
  because Compex RL2000 is in the list of supported hardware list.
  I guess the Compex RL2000 could be PCI variant while the controller
  in question is ISA controller. It seems PNP compat id didn't match
  or it had multiple compat ids so isa_pnp_probe() seemed to return
  ENOENT.

  PR:	kern/80853
2010-09-24 19:18:03 +00:00
Pyun YongHyeon 3095edd178 MFC r211721:
Fix a possible unaligned access to savebyte array.

  PR:	kern/122195
2010-09-24 19:14:59 +00:00
Pyun YongHyeon 09f2d99033 MFC r211717:
Implement basic WOL support. Note, not all xl(4) controllers
  support WOL. Some controllers require additional 3-wire auxiliary
  remote wakeup connector to draw power. More recent xl(4)
  controllers may not need the wakeup connector though.
2010-09-24 19:11:22 +00:00
Pyun YongHyeon 05b87548ce MFC r211716:
Move xl_reset() to xl_init_locked(). This will make driver
  initialize controller from a known good state. Previously driver
  used to issue controller reset while TX/RX DMA are in progress.
  I guess resetting controller in active TX/RX DMA cycle is to ensure
  stopping I/Os in xl_shutdown(). I remember some buggy controllers
  didn't respond with stop command if controller is under high
  network load at the time of shutdown so resetting controller was
  the only safe way to stop the I/Os. However, from my experiments,
  controller always responded with stop command under high network
  load so I think it's okay to remove the xl_reset() in
  device_shutdown handler.
  Resetting controller also will clear configured RX filter which
  in turn will make WOL support hard because driver have to reprogram
  RX filter in WOL handler as well as setting station address.
2010-09-24 19:07:14 +00:00
Pyun YongHyeon 50ff7133bc MFC r211671:
Remove unnecessary controller reinitialization by checking
  IFF_DRV_RUNNING flag.
2010-09-24 19:00:15 +00:00
Pyun YongHyeon 81f8e1a6f4 MFC r211670:
Clean up SIOCSIFCAP handler and allow RX checksum offloading could
  be controlled by user.
2010-09-24 18:54:06 +00:00
Pyun YongHyeon 5a22df0123 MFC r211597:
Document newly introduced tunable dev.bge.%d.forced_udpcsum.
  While I'm here also mention tunable dev.bge.%d.forced_collapse.
2010-09-24 18:14:22 +00:00
Pyun YongHyeon 672b0ce0ff MFC r211596:
It seems all Broadcom controllers have a bug that can generate UDP
  datagrams with checksum value 0 when TX UDP checksum offloading is
  enabled.  Generating UDP checksum value 0 is RFC 768 violation.
  Even though the probability of generating such UDP datagrams is
  low, I don't want to see FreeBSD boxes to inject such datagrams
  into network so disable UDP checksum offloading by default.  Users
  still override this behavior by setting a sysctl variable or loader
  tunable, dev.bge.%d.forced_udpcsum.

  I have no idea why this issue was not reported so far given that
  bge(4) is one of the most commonly used controller on high-end
  server class systems. Thanks to andre@ who passed the PR to me.

  PR:	kern/104826
2010-09-24 18:01:43 +00:00
Pyun YongHyeon 08c1f2d587 MFC r211594:
Load tunable from loader.conf(5) instead of device.hints(5).
2010-09-24 17:56:12 +00:00
Andriy Gapon 31da5ef5c2 MFC r212789: nextboot: warn about limitations of /boot/nextboot.conf on ZFS 2010-09-24 07:29:29 +00:00
Jilles Tjoelker de5dc86fa5 MFC r212419: test(1): Fix markup, ( and ) must be separate arguments
so leave spaces.
2010-09-23 19:38:08 +00:00
Jilles Tjoelker 4ceaee9197 MFC r212418: test(1): Clarify grammar ambiguity and -a/-o vs shell &&/||. 2010-09-23 19:36:34 +00:00
Jilles Tjoelker d56787f4a6 MFC r212390: expr(1): Add sh(1) versions of examples, remove an incorrect
example.

The three examples are better done using sh(1) itself these days.

The example
  expr -- "$a" : ".*"
is incorrect in the general case, as "$a" may be an operator.
2010-09-23 19:21:49 +00:00
Xin LI ddf8f59359 MFC r212764:
status bits should be &'ed against status to be really functional.

Reported by:	Jike Song
Reviewed by:	yongari
2010-09-23 01:38:52 +00:00
Jung-uk Kim 39b243432c MFC: r212806
Rework r210248.  Although it fixed most of problems, it did not fix one
particular edge case where X-axis resolution is not multiple of font width.
Now we just advance enough scan lines, then deduct a partial scan line.
It is more intuitive than the previous code.  Apply the same wisdom to EGA
and VGA planar renderers for consistency.
2010-09-22 22:17:39 +00:00
Marius Strobl f7b1827a3c MFC: r207608, r207614, r212651, r212665
Go ahead and merge the work edwin@ on tftpd into the tree.  It is a
lot better than what's in the tree now.  Edwin tested it at a prior
employer, but can't test it today.  I've found that it works a lot
better with the various uboot versions that I've used in my embedded
work.  Here's the pkg-descr from the port that describes the changes:

It all started when we got some new routers, which told me the
following when trying to upload configuration or download images
from it: The TFTP server doesn't support the blocksize option.

My curiousity was triggered, it took me some reading of RFCs and
other documentation to find out what was possible and what could
be done. Was plain TFTP very simple in its handshake, TFTP with
options was kind of messy because of its backwards capability: The
first packet returned could either be an acknowledgement of options,
or the first data packet.

Going through the source code of src/libexec/tftpd and going through
the code of src/usr.bin/tftp showed that there was a lot of duplicate
code, and the addition of options would only increase the amount
of duplicate code. After all, both the client and the server can
act as a sender and receiver.

At the end, it ended up with a nearly complete rewrite of the tftp
client and server. It has been tested against the following TFTP
clients and servers:

- Itself (yay!)
- The standard FreeBSD tftp client and server
- The Fedora Core 6 tftp client and server
- Cisco router tftp client
- Extreme Networks tftp client

It supports the following RFCs:

RFC1350 - THE TFTP PROTOCOL (REVISION 2)
RFC2347 - TFTP Option Extension
RFC2348 - TFTP Blocksize Option
RFC2349 - TFTP Timeout Interval and Transfer Size Options
RFC3617 - Uniform Resource Identifier (URI) Scheme and Applicability
          Statement for the Trivial File Transfer Protocol (TFTP)

It supports the following unofficial TFTP Options as described at
http://www.compuphase.com/tftp.htm:

blksize2 - Block size restricted to powers of 2, excluding protocol headers
rollover - Block counter roll-over (roll back to zero or to one)

From the tftp program point of view the following things are changed:

- New commands: "blocksize", "blocksize2", "rollover" and "options"
- Development features: "debug" and "packetdrop"

If you try this tftp/tftpd implementation, please let me know if
it works (or doesn't work) and against which implementaion so I can
get a list of confirmed working systems.

Author: Edwin Groothuis <[email protected]>
2010-09-22 21:54:34 +00:00
Marius Strobl 77d9124d23 MFC: r207607, r207621, r209112, r209550, r209551
Go ahead and merge the work edwin@ on tftpd into the tree.  It is a
lot better than what's in the tree now.  Edwin tested it at a prior
employer, but can't test it today.  I've found that it works a lot
better with the various uboot versions that I've used in my embedded
work.  Here's the pkg-descr from the port that describes the changes:

It all started when we got some new routers, which told me the
following when trying to upload configuration or download images
from it: The TFTP server doesn't support the blocksize option.

My curiousity was triggered, it took me some reading of RFCs and
other documentation to find out what was possible and what could
be done. Was plain TFTP very simple in its handshake, TFTP with
options was kind of messy because of its backwards capability: The
first packet returned could either be an acknowledgement of options,
or the first data packet.

Going through the source code of src/libexec/tftpd and going through
the code of src/usr.bin/tftp showed that there was a lot of duplicate
code, and the addition of options would only increase the amount
of duplicate code. After all, both the client and the server can
act as a sender and receiver.

At the end, it ended up with a nearly complete rewrite of the tftp
client and server. It has been tested against the following TFTP
clients and servers:

- Itself (yay!)
- The standard FreeBSD tftp client and server
- The Fedora Core 6 tftp client and server
- Cisco router tftp client
- Extreme Networks tftp client

It supports the following RFCs:

RFC1350 - THE TFTP PROTOCOL (REVISION 2)
RFC2347 - TFTP Option Extension
RFC2348 - TFTP Blocksize Option
RFC2349 - TFTP Timeout Interval and Transfer Size Options
RFC3617 - Uniform Resource Identifier (URI) Scheme and Applicability
          Statement for the Trivial File Transfer Protocol (TFTP)

It supports the following unofficial TFTP Options as described at
http://www.compuphase.com/tftp.htm:

blksize2 - Block size restricted to powers of 2, excluding protocol headers
rollover - Block counter roll-over (roll back to zero or to one)

From the tftp program point of view the following things are changed:

- New commands: "blocksize", "blocksize2", "rollover" and "options"
- Development features: "debug" and "packetdrop"

If you try this tftp/tftpd implementation, please let me know if
it works (or doesn't work) and against which implementaion so I can
get a list of confirmed working systems.

Author: Edwin Groothuis <[email protected]>
2010-09-22 21:54:16 +00:00
Marius Strobl 283adc1c32 MFC: r183858
ANSIfy, plus constify interfaces where possible.
2010-09-22 21:44:55 +00:00
Marius Strobl df33d23f18 MFC: r183857
Use strlcpy() instead of strncpy() when we want the string to be
NUL-terminated.
2010-09-22 21:43:48 +00:00
Marius Strobl 64cce1724f MFC: r205076 (partial)
Fix several typos in macros or macro misusage.

Found by:	make manlint
Reviewed by:	ru
Approved by:	philip (mentor)
2010-09-22 21:06:43 +00:00
Marius Strobl fe6e81459a MFC: r173854
Add "with" to make the line go smoother.
2010-09-22 21:02:51 +00:00
Marius Strobl a52a51aebb MFC: r173852
Add the -W options, which acts the same as -w but will generate
unique names based on the submitted filename, a strftime(3) format
string and a two digit sequence number.

By default the strftime(3) format string is %Y%m%d (YYYYMMDD), but
this can be changed by the -F option.

PR:		bin/106049 (based on patch in that PR)
Approved by:	grog@ (mentor)
2010-09-22 20:27:59 +00:00
Marius Strobl 6db7da145b MFC: r212729
Merge from powerpc:
- Change putc_func_t to use a char instead of an int for the character.
- Make functions and variables not used outside of this source file static.
- Remove unused prototypes and variables.
- The OFW read and seek methods take 3 and not 4 input arguments.
2010-09-22 20:17:34 +00:00
Marius Strobl 67b651041b MFC: r212725
Merge r207585 (MFC'ed to stable/7 in r208087) from cas(4):
- Don't probe for PHYs if we already know to use a SERDES. Unlike as with
  cas(4) this only serves to speed up the the device attach though and can
  only be determined via the OFW device tree but not from the VPD.
- Don't touch the MIF when using a SERDES.
- Add some missing bus space barriers, mainly in the PCS code path.
2010-09-22 20:15:38 +00:00
Marius Strobl 433ff30e69 MFC: rr212709, r212730
Add a VIS-based block copy function for SPARC64 V and later, which
additionally takes advantage of the prefetch cache of these CPUs.
Unlike the uncommitted US-III version, which provide no measurable
speedup or even resulted in a slight slowdown on certain CPUs models
compared to using the US-I version with these, the SPARC64 version
actually results in a slight improvement.
2010-09-22 20:04:03 +00:00
Marius Strobl f2d112e2b1 MFC: r212705
Add macros for alternate entry points.
2010-09-22 20:01:35 +00:00
Marius Strobl 7cb93c2eac MFC: r212676
Sync with other platforms:
- make dflt_lock() always panic,
- add kludge to use contigmalloc() when the alignment is larger than the size
  and print a diagnostic when we didn't satisfy the alignment.
2010-09-22 19:59:11 +00:00
Marius Strobl 80db58621d MFC: r212663
- Update the comment in swi_vm() regarding busdma bounce buffers; it's
  unlikely that support for these ever will be implemented on sparc64 as
  the IOMMUs are able to translate to up to the maximum physical address
  supported by the respective machine, bypassing the IOMMU is affected
  by hardware errata and being able to support DMA engines which cannot
  do at least 32-bit DMA does not justify the costs.
- The page zeroing in uma_small_alloc() may use the VIS-based block zero
  function so take advantage of it.
2010-09-22 19:55:40 +00:00
Tijl Coosemans 07fce511c2 MFC r212286:
GCC defines built-ins for atomic instructions found on i486 and higher.
Because FreeBSD no longer supports the 80386 cpu all code targeting
FreeBSD/i386 necessarily runs on i486 or higher so the compiler
built-ins can be used by default inside libstdc++ and in C++ headers.
This allows newly compiled C++ code to inline some atomic operations.
Old binaries continue to use libstdc++ functions.

Approved by:	kib (mentor)
2010-09-21 12:57:43 +00:00
Brian Somers 567e2c8422 MFC r212253: Document how to use dhclient-{enter,exit}-hooks.
PR:		149351
2010-09-21 07:44:40 +00:00
John Baldwin 2033c01df0 MFC 212293:
Store the full timestamp when caching timestamps of files and
directories for purposes of validating name cache entries.  This
closes races where two updates to a file or directory within the same
second could result in stale entries in the name cache.

To preserve the ABI of 'struct nfsnode', the existing timestamp fields
are left with 'n_unusedX' placeholders along with the unused 'n_expiry'
field.  The larger n_ctime and n_dmtime fields are added to the end of
the structure.
2010-09-20 19:59:08 +00:00
John Baldwin 79572a19e2 MFC 209907,212326,212368,212749:
- Provide more defines for PCI-Express device ctrl.
- Add register definitions related to extended capability IDs in
  PCI-express.  I used PCIZ_* for ID constants (plain capability IDs use
  PCIY_*).
- Add register definitions for the Advanced Error Reporting, Virtual
  Channels, and Device Serial Number extended capabilities.
- Teach pciconf -c to list extended as well as plain capabilities for
  PCI-express devices.   Adds more detailed parsing for AER, VC, and
  device serial numbers.
2010-09-20 19:30:20 +00:00
John Baldwin b5e08a2d5a MFC 212369:
- Use 'sta' to hold the PCIR_STATUS register value instead of 'cmd' when
  walking the capability list.
- Use constants for PCI header types instead of magic numbers.
2010-09-20 19:25:27 +00:00
John Baldwin 93f9924bef MFC 212329:
Simplify chkattached().  The PCIOCATTACHED ioctl only needs the pi_sel
field populated, it ignores the rest of the 'pci_io' structure.
2010-09-20 19:17:31 +00:00
John Baldwin 952ba0f36c MFC 212338:
If autoboot_delay is set to -1, boot immediately without checking for
a keypress to match the behavior of the loader.
2010-09-20 18:58:44 +00:00
John Baldwin 88e89261e0 MFC 211888: Simplify the tcp pcblist estimate logic slightly. 2010-09-20 18:41:15 +00:00
Bjoern A. Zeeb a999f89d3b MFC r212403:
When using pf routing options, properly handle IP fragmentation
  for interfaces with TSO enabled, otherwise one would see an extra
  ICMP unreach, frag needed pre matching packet on lo0.
  This syncs pf code to ip_output.c r162084.

  Submitted by: yongari via mlaier

PR:	kern/144311
2010-09-20 18:26:37 +00:00
Colin Percival 4d070b3573 Fix an integer overflow in RLE length parsing when decompressing
corrupt bzip2 data.

Approved by:	so (cperciva)
Security:	FreeBSD-SA-10:08.bzip2
2010-09-20 14:58:08 +00:00
Alexander Motin 8277d029fd MFC r196415:
Fill cpi->transport in XPT_PATH_INQ.
2010-09-20 13:48:07 +00:00
Andriy Gapon a61e893139 MFC r212325: subr_bus: use hexadecimal representation for bit flags 2010-09-20 11:18:20 +00:00
Andriy Gapon 978d8f5950 MFC r212413: bus_add_child: change type of order parameter to u_int 2010-09-20 11:09:31 +00:00
Andriy Gapon 9024613b24 MFC r212213: struct device: widen type of flags and order fields to u_int 2010-09-20 05:58:55 +00:00
Andriy Gapon e398ab4c82 MFC r212549: acpi_cpu: do not apply P_LVLx_LAT rules to latencies
returned by _CST
2010-09-20 05:46:15 +00:00
Navdeep Parhar ee10e8f17e MFC r212710
Fix t3_gate_rx_traffic and t3_open_rx_traffic. Parts of them always operated
on XGMAC0 instead of the specified XGMAC.
2010-09-19 20:38:34 +00:00
Alexander Motin 98c613f608 MFC r201567:
Move wakeup() out of mutex to reduce contention.
2010-09-19 20:08:45 +00:00
Alexander Motin 508e97ef35 MFC r201545:
Slightly optimize XOR calculation.
2010-09-19 20:07:40 +00:00
Alexander Motin aea38f2dc5 MFC r196964:
Do not check proper request alignment here in geom_dev in production.
It will be checked any way later by g_io_check() in g_io_schedule_down().
It is only needed here to not trigger panic from additional check, when
INVARIANTS enabled. So cover it with #ifdef INVARIANTS. It saves two
64bit divisions per request.
2010-09-19 20:02:31 +00:00
Alexander Motin 7c889f99d9 MFC r174669:
Don't limit BIO_DELETE requests to MAXPHYS, they perform no data
transfers, so they are not subject to the VM system limitation.
2010-09-19 19:57:15 +00:00
Alexander Motin 586722648d MFC r205619:
Do not fetch precise time of request start when stats collection disabled.
2010-09-19 19:53:41 +00:00
Alexander Motin 533b588621 MFC r201264:
Call wakeup() only for the first request on the queue.
2010-09-19 19:52:26 +00:00
Alexander Motin 69e9b70a59 MFC r196904:
Remove msleep() timeout from g_io_schedule_up/down(). It works fine
without it, saving few percents of CPU on high request rates without
need to rearm callout twice per request.
2010-09-19 19:51:14 +00:00
Alexander Motin 687c2cc9bc MFC r201566:
Move wakeup() out of mutex to reduce contention.
2010-09-19 19:43:05 +00:00
Alexander Motin ee63929f1e MFC r199644:
Add some missing WDMA/UDMA modes.
2010-09-19 19:18:35 +00:00
Alexander Motin 0cd81532de MFC r194902, r197540, r198587, r198865:
Define some ATA IDENTIFY fields and bits.
2010-09-19 19:02:14 +00:00
Alexander Motin f20d2644ba MFC r209340:
Report transport type in XPT_PATH_INQ.
2010-09-19 13:49:02 +00:00
Alexander Motin f468001b99 MFC r209341:
Report transport type in XPT_PATH_INQ.
2010-09-19 13:44:46 +00:00
Alexander Motin 32038185d8 MFC r194900:
Remove unused ATAPI definitions, conflicting with ata.h.
2010-09-19 13:42:05 +00:00
Brian Somers bc82f106bb MFC r211864,211963,211964,211965, don't mis-handle path names of
101 characters beginning with '/'.
2010-09-19 11:22:22 +00:00
Marius Strobl c1c56ea31e MFC: r212620
Remove a KASSERT which will also trigger for perfectly valid combinations
of small maxsize and "large" (including BUS_SPACE_UNRESTRICTED) nsegments
parameters. Generally using a presz of 0 (which indeed might indicate the
use of bogus parameters for DMA tag creation) is not fatal, it just means
that no additional DVMA space will be preallocated.
2010-09-18 08:20:39 +00:00
Marius Strobl e1b1978615 MFC: r212619
Remove redundant raising of the PIL to PIL_TICK as the respective locore
code already did that.
2010-09-18 08:18:56 +00:00
Xin LI 635c0b2f17 MFC r211475:
Check return value of dup(), it could be -1 when the system is running
out of file descriptors for instance.

Found with:	Coverity Prevent(tm)
CID:		6084
2010-09-18 00:46:05 +00:00
Matthew D Fleming d30f607802 MFC r212153: Fix UP build. 2010-09-16 15:42:56 +00:00
Fabien Thomas a2f085a7e7 MFC r212176:
When an asm location cannot be resolved to a function the cost
will be spread as small value and then filtered by the threshold.
As a first step solution display the number of event that cannot
be resolved as a valid function location.
2010-09-16 15:22:30 +00:00
Fabien Thomas 9f96f67c5a MFC r212224:
Fix invalid class removal when IAF is not the last class.
Keep IAF class with 0 PMC and change the alias in libpmc to IAP.
2010-09-16 15:19:39 +00:00
Fabien Thomas bb00f4b601 MFC r212224:
Fix invalid class removal when IAF is not the last class.
 Keep IAF class with 0 PMC and change the alias in libpmc to IAP.
2010-09-16 15:18:46 +00:00
Marius Strobl bd046448b8 MFC: r208459
Use real atomic operations for sparc64.
2010-09-15 20:40:29 +00:00
Marius Strobl de7065aedd MFC: r210601 (partial), r211071, r211073
- As it is not possible for sched_bind(9) to context switch with
  td_critnest > 1 when not already running on the desired CPU read the
  TICK counter of the BSP via a direct cross trap request in that case
  instead.
- Provide a STICK based timecounter.
2010-09-15 20:17:20 +00:00
Marius Strobl 8d26d8c308 MFC: r211050 (partial)
- Introduce a cpu_ipi_single() function pointer in order to send IPIs
  to single CPUs more efficiently with Cheetah(-class) and Jalapeno CPUs.
- Factor out the Jalapeno support from the Cheetah IPI send functions
  in order to be able to more easily and efficiently implement support
  for more than 32 target CPUs as well as a workaround for Cheetah+
  erratum 25 for the latter.
2010-09-15 19:28:06 +00:00
Marius Strobl b21762295e MFC: r211049, r211568
For CPUs which ignore TD_CV and support hardware unaliasing don't
bother doing page coloring. This results in a small but measurable
performance improvement in buildworld times.
2010-09-15 18:51:15 +00:00
Marius Strobl 5c4ad679dd MFC: r210176
Allocate proper amount of memory for interrupt names on sparc64 and
sun4v, same as done on other architectures. This removes garbage from
`vmstat -ia` output.
2010-09-15 18:09:15 +00:00
Marius Strobl 8e726074c4 MFC: r208515
Fix some whitespace nits.
2010-09-15 17:39:15 +00:00
Xin LI baa677ddfe MFC r212008,212028,212210 the updated twa(4) driver minus maxio change
which depends on cam(4) revision r195534.

The change have been tested on stable/7 with 3ware 9650SE at iXsystems.
2010-09-15 17:25:51 +00:00
Matthew D Fleming 60e28f7825 MFC r212115:
Fix a bug with sched_affinity() where it checks td_pinned of another
thread in a racy manner, which can lead to attempting to migrate a
thread that is pinned to a CPU.  Instead, have sched_switch() determine
which CPU a thread should run on if the current one is not allowed.

KASSERT in sched_bind() that the thread is not yet pinned to a CPU.

KASSERT in sched_switch() that only migratable threads or those moving
due to a sched_bind() are changing CPUs.

Note that this is direct commit as ipi_cpu() only exists in CURRENT.
2010-09-15 15:55:58 +00:00
Matthew D Fleming 8558d01e13 Revert r212563, which was a MFC of r209053, as it introduced an unlocked
read/modify/write of b_vflags.  The unlocked access is fixed in CURRENT
and stable/8 by r211213 and its MFC, r212583.

Rather than MFC to stable/7, reverting the injecting code seems
preferable.
2010-09-15 15:33:51 +00:00
Andre Oppermann 84f6b5e5be MFC r211874:
Use timestamp modulo comparison macro for automatic receive buffer
  scaling to correctly handle wrapping of ticks value.
2010-09-15 09:38:42 +00:00
Andriy Gapon d9fe885b3b MFC r211762: zfs arc_reclaim_thread: no need to call arc_reclaim_needed
when resetting needfree
2010-09-15 08:07:58 +00:00
Glen Barber f1f6eec2d8 MFC 212269.
Add ECONNRESET to connect(2).

Approved by:	keramida (mentor)
2010-09-13 17:28:35 +00:00
Matthew D Fleming 15c9a9682c MFC r209053:
Add INVARIANTS checking that numfreebufs values are sane.  Also add a
per-buf flag to catch if a buf is double-counted in the free count.
This code was useful to debug an instance where a local patch at Isilon
was incorrectly managing numfreebufs for a new buf state.
2010-09-13 17:23:18 +00:00
Glen Barber 2c847dc294 MFC 212241.
Note that jail_list should contain alphanumeric characters only.

PR:		150098
Approved by:	keramida (mentor)
2010-09-12 18:50:57 +00:00
Rebecca Cran 6b922d9427 MFC r182194:
Add geom_journal

PR:		conf/126829
Approved by:	rrs (mentor)
2010-09-11 14:46:19 +00:00
Rebecca Cran bb1cd9f0c4 MFC r211415:
Add -m and -M options to control the minimum and maximum frequency.

PR:		bin/145063
Submitted by:	Boris Kochergin <spawk at acm.poly.edu>
Approved by:	rrs (mentor)
2010-09-11 14:39:53 +00:00
Rebecca Cran 1356f82cdc MFC r211419:
Since top displays the uptime including seconds, there is no need to add 30
onto it, which may have been used for rounding purposes in other utilities.

PR:		bin/147934
Submitted by:	Janne Snabb <snabb at epipe.com>
Approved by:	rrs (mentor)
2010-09-11 14:29:31 +00:00
Rebecca Cran 6cb42d2e86 MFC r206909:
It's not necessary to reset the chip every time an input overflow event
occurs. In addition, the delay when programming the short cable fix
should be 100us, not 100ms.

PR:		kern/64556
Submitted by:	Thomas Hurst <tom at hur.st>
Approved by:	rrs (mentor)
2010-09-11 14:21:02 +00:00
Matthew D Fleming c721f4c877 MFC r211194, r211229, r212058, r212063: memguard(9) rewrite
r211194:

Rework memguard(9) to reserve significantly more KVA to detect
use-after-free over a longer time.  Also release the backing pages of
a guarded allocation at free(9) time to reduce the overhead of using
memguard(9).  Allow setting and varying the malloc type at run-time.
Add knobs to allow:

 - randomly guarding memory
 - adding un-backed KVA guard pages to detect underflow and overflow
 - a lower limit on the size of allocations that are guarded

r211229:

Fix compile.  It seemed better to have memguard.c include opt_vm.h in
case future compile-time knobs were added that it wants to use.
Also add include guards and forward declarations to vm/memguard.h.

r212058:

The realloc case for memguard(9) will copy too many bytes when
reallocating to a smaller-sized allocation.  Fix this issue.

r212063:

Have memguard(9) crash with an easier-to-debug message on double-free.
2010-09-10 21:53:47 +00:00
Bjoern A. Zeeb 8b2b9d0522 MFC r212155:
MFp4 CH=183052 183053 183258:

    In protosw we define pr_protocol as short, while on the wire
    it is an uint8_t.  That way we can have "internal" protocols
    like DIVERT, SEND or gaps for modules (PROTO_SPACER).
    Switch ipproto_{un,}register to accept a short protocol number(*)
    and do an upfront check for valid boundries. With this we
    also consistently report EPROTONOSUPPORT for out of bounds
    protocols, as we did for proto == 0.  This allows a caller
    to not error for this case, which is especially important
    if we want to automatically call these from domain handling.

    (*) the functions have been without any in-tree consumer
    since the initial introducation, so this is considered save.

    Implement ip6proto_{un,}register() similarly to their legacy IP
    counter parts to allow modules to hook up dynamically.

  Reviewed by:  philip, will
2010-09-09 06:44:22 +00:00
Jaakko Heinonen 1b012d4f50 MFC r208612: Fixes from NetBSD for nvi visual mode
PR:		bin/21089, bin/136393
2010-09-08 18:06:05 +00:00
Jaakko Heinonen 37aa58ed3a MFC r208611: Fix misspelling of "substitution".
PR:		bin/130874
2010-09-08 18:03:40 +00:00
Xin LI bb033ab503 MFC r205662 + r212066 (except efi part):
Our boot loader is capable of booting both i386 and amd64 kernels so
call it "x86" instead of "i386".
2010-09-07 18:14:50 +00:00
Jaakko Heinonen edd9ef08f0 MFC r211342:
- Check that strtoul(3) succeeds to convert the entire string in a few
  places.
- In getasciilabel(), set the disk type only when a valid type is given.

PR:		bin/86765
2010-09-06 15:48:06 +00:00
Kai Wang d6e055cdf6 MFC r210351-r210353,r211192.
r210351:
  * Note that ar(1) archives may also be opened using `elf_memory(3)`.
  * Ignore the passed in value of the `fd` argument for ar(1) archives
    opened with elf_memory(3).

r210352:
  Add a cross-reference to `elf_rawfile(3)`.

r210353:
  * Remove a superfluous error description.
  * Document an additional error that may be returned: `ELF_E_ARCHIVE`.

r211192:
  Add translation support for section type SHT_SUNW_dof.
2010-09-04 13:00:28 +00:00
Kai Wang aa6412a09b MFC r210344,r210345,r210348.
r210344:
  Avoid switching between "unsigned char" and "char" in the C code
  generated from "libelf_convert.m4".

r210345:
  * Deprecate `elf_getshnum()`, `elf_getphnum()` and `elf_getshstrndx()` in
    favour of `elf_getshdrnum()`, `elf_getphdrnum()` and `elf_getshdrstrndx()`
    respectively.
  * Add new manual pages for `elf_getshdrstrndx()`, `elf_getphdrnum()` and
    `elf_getshdrnum()`.
  * Add a deprecation warning for `elf_getshstrndx()`, `elf_getphnum()` and
    `elf_getshnum()`.

r210348:
  Move helper functions `_libelf_ar_get_{name,number,string}()` and
  `_libelf_ar_open()` to a new compilation unit "libelf_ar_util.c"
  to break the circular dependency between "elf_memory.o" and
  "libelf_ar.o".
2010-09-04 12:52:51 +00:00
Kai Wang 70d3c34710 MFC r210329,r210330,r210347.
r210329:
  Use <unistd.h> to declare the prototype for ftruncate().

r210330:
  Allow an application that updates only the ELF Ehdr to work.

r210347:
  Fix a memory leak.
2010-09-04 12:40:16 +00:00
Kai Wang 3f416ccbed MFC r210325,r210326,r210328,r210349
r210325:
  Bug fix: when updating headers using the gelf_update_*() functions,
  the appropriate `dirty' bit needs to be set for both the Elf32 and
  Elf64 case.

r210326:
  Improve compatibility with other implementations of the ELF(3) API:
  when an output file has no program headers, set the 'e_phentsize'
  field of the ELF executable header to zero.

r210328:
  Bug fix: permit the creation of zero-sized sections.

r210349:
  Remove a redundant word.
2010-09-04 12:19:25 +00:00
Kai Wang f639b9496e MFC r210324, r210438.
r210324:
  - Correctly handle sections of type SHT_NOBITS.  For these sections:
    - elf_getdata() and elf_rawdata() should return an "Elf_Data" structure
      that has its "d_buf" member set to NULL and "d_size" member set to
      the nominal 'size' of the section.
    - Update the manual page for these functions.
  - Fix a memory leak in an error handling path inside elf_getdata().
  - Use _libelf_allocate_data() in elf_newdata() for consistency.

r210438: (np)
  Catch up with r210324.  d_buf will be NULL for SHT_NOBITS sections, do not
  attempt to copy from it in that case.
2010-09-04 12:06:09 +00:00
Kai Wang 2ae10a93c5 MFC r210321:
Remove a superfluous comment.
2010-09-04 11:50:23 +00:00
John Baldwin 3afd1b1f87 MFC: Use VN_LOCK_* macros to manipulate vnode lock flags. 2010-09-03 21:16:16 +00:00
Jilles Tjoelker aeb519b298 MFC r211155: sh: Fix heap-based buffer overflow in pathname generation.
The buffer for generated pathnames could be too small in some cases. It
happened to be always at least PATH_MAX long, so there was never an overflow
if the resulting pathnames would be usable.

This bug may be abused if a script subjects input from an untrusted source
to pathname generation, which a bad idea anyhow. Most shell scripts do not
work on untrusted data. secteam@ says no advisory is necessary.

PR:		bin/148733
Reported by:	Changming Sun snnn119 at gmail com
2010-09-01 21:51:29 +00:00
John Baldwin ca8a2caf3f Fix the build with DEVICE_POLLING enabled. Poll handlers return void
instead of int on 7.x and earlier.

Pointy hat to:	jhb
2010-09-01 14:31:05 +00:00
John Baldwin 836d2c8b73 MFC 206429:
Sync em(4) and igb(4) drivers with 8 except for VF support:
- Remove unneeded rxtx handler, make que handler generic in igb.
- Do not allocate header mbufs in rx ring if not doing hdr split in igb.
- Release the lock in rxeof call to stack.
- Change rxeof api for poll friendliness, and eliminate unnecessary link
  tasklet use.
- Move statistics for em into sysctl tree.
- Reenable hardware checksum offload for VLAN frames in igb.
- Fix for a panic when TX checksum offload is done and a packet has only
  a header in the first mbuf in em.

Approved by:	jfv
2010-08-31 19:26:29 +00:00
Pyun YongHyeon b5d0e0bef5 MFC r211650,211667:
r211650:
  Document tunable dev.rl.%unit.prefer_iomap

r211667:
  Better wording and fix wrong explanation.

  Submitted by:	Ben Kaduk ( minimarmot <> gmail dot com )
2010-08-31 00:20:10 +00:00
Pyun YongHyeon acff7a8800 MFC r211648:
It seems some newer RTL8139 controllers provides only memory space
  register mapping. I'm not sure whether it comes from the fact that
  controllers live behind certain PCI brdge(PLX PCI 6152 33BC) and
  the bridge has some issues in handling I/O space register mapping.
  Unfortunately it's not possible to narrow down to an exact
  controller that shows this issue because RealTek used the same PCI
  device/revision id again. In theory, it's possible to check parent
  PCI bridge device and change rl(4) to use memory space register
  mapping if the parent PCI bridge is PLX PCI 6152. But I didn't try
  to do that and we wouldn't get much benefit with added complexity.

  Blindly switching to use memory space register mapping for rl(4)
  may make most old controllers not to work. At least, I don't want
  to take potential risk from such change. So use I/O space register
  mapping by default but give users chance to override it via a
  tunable. The tunable to use memory space register mapping would be
  given by adding the following line to /boot/loader.conf file.

  dev.rl.%d.prefer_iomap="0"

  This change makes P811B quad-port work with this tunable.
2010-08-31 00:16:30 +00:00
Pyun YongHyeon a05a4a2dec MFC r184560:
Document dev.rl.%unit.twister_enable sysctl/tunable.
2010-08-30 22:19:41 +00:00
Pyun YongHyeon 7264eb6d50 MFC r184515,184524,184559:
r184515:
  Add RL_TWISTER_ENABLE option.  This enables the magic bits to do long
  cable tuning.  This has helped in some installations for hardware
  deployed by a former employer.  Made optional because the lists aren't
  full of complaints about these cards... even when they were wildly
  popular.

r184524:
  Fix a few typos/spelling errors in my comments from the last commit,
  plus a few others that had lingered in this driver...

  Submitted by: "b." bf2006a att yahoo KIBO com

r184559:
  Make RL_TWISTER_ENABLE a tunable/sysctl.  Eliminate it as an option.
  Fix module build.
2010-08-30 22:17:06 +00:00
Pyun YongHyeon 2233b5ff50 MFC r211106:
Document newly added controller AR8151 and AR8152.
2010-08-30 21:18:57 +00:00
Pyun YongHyeon 442fa92151 MFC r211105:
Add support for Atheros AR8151/AR8152 PCIe gigabit/fast ethernet
  controller. These controllers are known as L1D(AR8151) and
  L2CB/B2(AR8152). This change adds supports for the following
  controllers.
   o AR8151 v1.0(L1D) gigabit ethernet controller
   o AR8151 v2.0(L1D) gigabit ethernet controller
   o AR8152 v1.1(L2CB) fast ethernet controller
   o AR8152 v2.0(L2CB2) fast ethernet controller
  These controllers have the same feature of AR8131/AR8132 and
  support improved power saving control. The user visible change at
  this moment is reduced jumbo frame size from 9KB to 6KB. Many
  thanks to Atheros for continuing to support FreeBSD.

  HW donated by:	Atheros Communications, Inc.
2010-08-30 21:17:11 +00:00
Pyun YongHyeon 2f68cbe609 MFC r211103:
Add F1 PHY found on Atheros AR8151 v2.0 PCIe gigabit ethernet
  controller.
2010-08-30 21:13:08 +00:00
Pyun YongHyeon bcdfe8e57e MFC r211047-211048,211051-211053,211285:
r211047:
  Controller does not seem to support more than 1024 bytes DMA burst.
  Limit DMA burst size to be less than or equal to 1024 bytes.

r211048:
  Do not touch CMB TX threshold register when CMB is not used.
  Note, alc(4) does not use CMB at all due to silicon bug.

r211051:
  Always disable ASPM L0s and enable L1 before entering into WOL
  suspend state.  Also disable master clock after PHY power down,
  this is supposed to save more power. The master clock should be
  enabled if WOL is active.

r211052:
  Remove unnecessary assignment.

r211053:
  Cache PCIY_PMG and PCIY_EXPRESS capability pointer to softc and use
  it instead of calling pci_find_extcap().

r211285:
  Make sure to disable RX MAC in alc_stop_mac(). Previously there
  was a logic error which it always enabled RX MAC.
2010-08-30 21:09:37 +00:00
Pyun YongHyeon f62fd2083c MFC r211046:
Marvell model number 0x06 is 88E1101 PHY.
2010-08-30 21:00:37 +00:00
Pyun YongHyeon 9b4e4a7b7c MFC r210905:
Reflect default Tx interrupt moderation timer value change(50ms -> 1ms).
2010-08-30 20:56:59 +00:00
Pyun YongHyeon 0ae5f15698 MFC r210904:
Reduce Tx interrupt moderation timer from 50ms to 1ms. The default
  value resulted in poor performance for UDP packets. With this
  change, UDP bulk transfer performance is more than 940Mbps.

  While I'm here fix a wrong register definition.
2010-08-30 20:52:28 +00:00
Xin LI 1f1260c98c MFC r210624 and r210833:
Improve cputemp(4) driver wrt newer Intel processors, especially
Xeon 5500/5600 series:

 - Utilize IA32_TEMPERATURE_TARGET, a.k.a. Tj(target) in place
   of Tj(max) when a sane value is available, as documented
   in Intel whitepaper "CPU Monitoring With DTS/PECI"; (By sane
   value we mean 70C - 100C for now);
 - Print the probe results when booting verbose;
 - Replace cpu_mask with cpu_stepping;
 - Use CPUID_* macros instead of rolling our own.

Catch known CPUs before using IA32_TEMPERATURE_TARGET.
This way we would have an opportunity to hide the
Tj(target) value doesn't seem right stuff if we know
it's not working there.

Add temperature value for Core2 Duo Extreme Mobile that
I have access to.
2010-08-30 18:53:12 +00:00
Xin LI d325720823 MFC r210665:
In rdmsr_safe, use zero extend (by doing a 32-bit movl over
eax to itself) instead of a sign extend.

Discussed with: stas
2010-08-30 18:50:18 +00:00
Hajimu UMEMOTO f14823e3f5 MFC r211340: Correct the return code from _dns_gethostby*()
to correspond with h_errno.
2010-08-29 03:55:39 +00:00
Hajimu UMEMOTO d46c871bd6 MFC r211276:
- When there is no room for returning the result, nss backend
  have to return ERANGE and terminate with NS_RETURN.
- When gethostbyname_r(3) and the friends end with an error,
  set errno to the value nss backend returns, and return errno
  value.

PR:		kern/131623
2010-08-28 17:12:52 +00:00
Jaakko Heinonen 235ed5226c MFC r204636:
In reallocf(3), free the memory only when size != 0. Otherwise, when the
System V compatibility option (malloc "V" flag) is in effect a zero sized
reallocf() could cause a double free.

PR:		bin/141753
2010-08-28 06:33:01 +00:00
Bjoern A. Zeeb 3b00aa65e1 MFC r211451:
When calculating the expected memory size for userspace, also take the
  number of syncache entries into account for the surplus we add to account
  for a possible increase of records in the re-entry window.

  Discussed with:		jhb, silby
2010-08-27 21:52:54 +00:00
John Baldwin 8af3ed3c83 MFC 210774,210935:
- Tweak the logic to disable CLFLUSH in virtual environments to work around
  problems with flushing the local APIC register range so that it checks
  vm_guest directly.
- Add Xen to the list of virtual vendors.  In the non PV (HVM) case this
  fixes the virtualization detection successfully disabling the CLFLUSH
  instruction.
2010-08-27 18:55:48 +00:00
John Baldwin 49542ffbc6 MFC 211433:
Ensure a minimum "slop" of 10 extra pcb structures when providing a
memory size estimate to userland for pcb list sysctls.  The previous
behavior of a "slop" of n/8 does not work well for small values of n
(e.g. no slop at all if you have less than 8 open UDP connections).
2010-08-27 18:50:32 +00:00
Andre Oppermann dfae7417d4 MFC r211464:
If a TCP connection has been idle for one retransmit timeout or more
  it must reset its congestion window back to the initial window.

  RFC3390 has increased the initial window from 1 segment to up to
  4 segments.

  The initial window increase of RFC3390 wasn't reflected into the
  restart window which remained at its original defaults of 4 segments
  for local and 1 segment for all other connections.  Both values are
  controllable through sysctl net.inet.tcp.local_slowstart_flightsize
  and net.inet.tcp.slowstart_flightsize.

  The increase helps TCP's slow start algorithm to open up the congestion
  window much faster.

  Reviewed by:	lstewart
  MFC after:	1 week
2010-08-27 10:16:32 +00:00
Andre Oppermann 350e68d863 MFC r211462:
Untangle the net.inet.tcp.log_in_vain and net.inet.tcp.log_debug
  sysctl's and remove any side effects.
2010-08-27 09:59:51 +00:00
Navdeep Parhar 5fe72d0e12 MFC r209839-209841, r211345-211347
r209839
Fix bufsize calculation so that cxgbtool can display information for the
last I/O queue too.

r209840
Eliminate ext_intr_task.  The "slow" interrupt handler is already
running on the adapter's task queue.  Just do what the task does
instead of enqueueing it.

r209841
Improved link detection.

r211345
wakeup is required if the adapter lock is released anywhere during
init and not just for the may_sleep case.

r211346
Always reset the XGMAC's XAUI PCS on a link up.

r211347
Fix tx pause quanta and timer calculations.
2010-08-27 02:46:21 +00:00
Navdeep Parhar 23284f2ba7 MFC r207643, r207687, r208887, r209115
r207643
T3 hardware filters.

r207687
Do not hold the T3 firmware in memory all the time.

r208887
tunable to control mc5 partition

r209115
make format string a string literal
2010-08-27 02:29:16 +00:00
Navdeep Parhar 3818c41827 MFC r204348, r206109
r204348
Support IFCAP_VLAN_HWTSO capability.

r206109
Bump response queue size to 2K, add statistic for starvation.
2010-08-27 02:14:02 +00:00
Alexander Motin 97f5d6e2ef MFC r211455:
Remove bintime_cmp() function, unused since r200086.
2010-08-25 11:11:14 +00:00
John Baldwin ccdc25d97f MFC 210936,210946:
Ethernet vlan(4) interfaces have valid Ethernet link layer addresses but
use a different interface type (IFT_L2VLAN vs IFT_ETHER).  Treat IFT_L2VLAN
interfaces like IFT_ETHER interfaces when handling link layer addresses.
2010-08-23 20:53:24 +00:00
Maksim Yevmenkin a275d7954e MFC r210783 as requested by Helge Oldach on freebsd-bluetooth@
Fix typo

PR:	kern/140590
2010-08-23 17:48:50 +00:00
Ulrich Spörlein 47dd606578 MFC r205078,208483,211401-211402,211404: mdoc cleanup
- Fix typo in macro name and macro usage.
- Consistently spell our email addresses <[email protected]>
- Wordsmithing of bsnmpd.1; bump .Dd
- Fix two minor typos.
2010-08-23 11:58:45 +00:00
Brian Somers 0f85bd3b91 MFC r210407: Add a -S switch to override syslogd's pidfile. 2010-08-23 09:54:32 +00:00
Christian Brueffer 34a6bacfcb MFC: r148701
Fixed a typo.
2010-08-22 20:25:03 +00:00
Christian Brueffer 456bd08396 MFC: r148681
Fixed a typo and added a comma.
2010-08-22 20:22:56 +00:00
Gavin Atkinson 798235192a Merge r211026 from head:
Add a keymap for the Swiss-German Macbook keyboard.

PR:		conf/139997
Submitted by:	Andreas Tobler <andreast fgznet.ch>
2010-08-22 16:32:59 +00:00
Andriy Gapon 6f38f51684 Fix a mismerge in r211581, MFC of r210427
This is a direct commit.

Reported by:	many
Pointyhat to:	avg
2010-08-22 13:27:33 +00:00
Gavin Atkinson 7f29f06d45 Merge r211066 from head:
Add a termcap entry for rxvt-256color.

PR:		conf/147726
Submitted by:	Sterling (Chip) Camden <sterling camdensoftware.com>
2010-08-22 09:06:55 +00:00
Andre Oppermann 7e2f8ce56d MFC r211333:
Fix the interaction between 'ICMP fragmentation needed' MTU updates,
  path MTU discovery and the tcp_minmss limiter for very small MTU's.
2010-08-22 09:02:38 +00:00
Andre Oppermann 6bdd31058e MFC r211327:
Add more logging points for failures in syncache_socket() to
  report when a new socket couldn't be created because one of
  in_pcbinshash(), in6_pcbconnect() or in_pcbconnect() failed.
2010-08-22 08:47:51 +00:00
Andriy Gapon 84b58dfcdd MFC r210425: dtrace: correctly map sections to addresses in elf object
modules (amd64)
2010-08-21 19:09:34 +00:00
Andriy Gapon aebeab2b00 MFC r210424: kgdb: correctly map sections to addresses in elf object
modules (amd64)
2010-08-21 18:55:28 +00:00
Andriy Gapon d6e69ef4ef MFC r210423: completely ignore zero-sized elf sections in modules of elf
object type (amd64)
2010-08-21 18:51:25 +00:00
Andriy Gapon 23055db156 MFC r210245: binutils/ld: fix incorrect placement of __start_SECNAME in
some cases
2010-08-21 18:40:42 +00:00
Andriy Gapon e21af37945 MFC r210427: zfs arc_memory_throttle: available memory is free + cache 2010-08-21 18:26:55 +00:00
Andriy Gapon 08f94b7218 MFC r210422: cpufreq: allocate long-lived buffer for handling of sysctl
requests
2010-08-21 17:52:33 +00:00
Andriy Gapon c6f10c9d26 MFC r210454: ichwd: correct range check for timeout value 2010-08-21 16:47:41 +00:00
Andre Oppermann ad5757a60b MFC r211317:
Reset the internal tso flag in tcp_output() on every iteration
  of sendalot.
2010-08-21 11:11:32 +00:00
Andre Oppermann d795356ac8 MFC r211316:
Change the messages of the ICMP bad port bandwidth limiter from
  a kernel printf to a log output with the priority of LOG_NOTICE.
2010-08-21 11:02:18 +00:00
Andre Oppermann 9ae498b480 MFC r211315:
Disable TCP inflight limiter by default.
2010-08-21 10:39:51 +00:00
John Baldwin 24532883cf Revert 210173 as it did not properly fix the bug. It assumed that the
VI_LOCK() for a given vnode was used as the internal interlock for that
vnode's v_lock lockmgr lock.  This is not the case.  Instead, add dedicated
routines to toggle the LK_NOSHARE and LK_CANRECURSE flags.  These routines
lock the lockmgr lock's internal interlock to synchronize the updates to
the flags member with other threads attempting to acquire the lock.  The
VN_LOCK_A*() macros now invoke these routines, and the softupdates code
uses these routines to temporarly enable recursion on buffer locks.

Reviewed by:	kib
2010-08-20 20:58:57 +00:00
John Baldwin b7d4d7c225 MFC: Use VN_LOCK_AREC() and VN_LOCK_ASHARE() rather than manipulating
lockmgr lock flags directly.
2010-08-20 20:33:13 +00:00
Bjoern A. Zeeb 4620aaad27 MFC r211115:
MFp4 CH180235:

  Add proto spacers to inet6sw like we have for legacy IP. This allows us
  to dynamically pf_proto_register() for INET6 from modules, needed by
  upcoming CARP changes and SeND.
  MC and SCTP could make use of it as well in theory in the future after
  upcoming VIMAGE vnet teardown work.

  Discussed with:	will, anchie
2010-08-20 12:26:02 +00:00
Gavin Atkinson 443b7fe0de Merge r186427 from head (original commit by remko):
Add support for the MaxSream USB test carrier.

PR:		usb/117546
Submitted by:	Daniel J. O'Connor <darius midget.dons.net.au>
2010-08-19 08:11:07 +00:00
Gavin Atkinson 0bbe6d4e4c Merge r208016 from head:
Add new FTDI USB device ID for the Gamma-Scout radioactivity meter. [1]

Merge r210556 from head:
  Support the Pyramid KBS USB LCD under uftdi(4) [2]

PR:		kern/146483 [1] usb/129758 [2]
Submitted by:	Andre Albsmeier [1]
Submitted by:	joao lima <jlima visionware.pt> [2]
2010-08-19 07:54:15 +00:00
Gavin Atkinson e2db727009 Merge r210571 from head:
Add support for the Corega CG-USBRS232R to uplcom(4)

PR:		usb/129173
Submitted by:	SHIMAOKA Shunsuke <shimaoka.shunsuke gmail.com>
2010-08-18 21:51:05 +00:00
Gavin Atkinson 7449f1efa4 Merge r211077, r211079 from head:
Correct two error messages to match the failure they are reporting.

  Correct the login.conf variable name used for obtaining the login prompt.
2010-08-18 20:39:00 +00:00
Gavin Atkinson 7ab1bcfdd3 Merge 210839 from head:
Do not free sc if attach failed, as it was allocated by the bus
  infrastructure, not us.  This appears to be a leftover from an older
  version of the driver.

Submitted by:	avg
Tested by:	Anton Shterenlikht <mexas bristol.ac.uk>
2010-08-18 20:23:47 +00:00
Jaakko Heinonen d87a670bbf MFC r209614:
- Don't assign the return value from read(2) to a variable of type
  int.
- Use errx(3) instead of err(3) to print the error message on short
  reads in readlabel(). errno won't be set on short reads which can
  easily occur here due to the fixed size read request.

PR:		144307
2010-08-18 14:41:34 +00:00
John Baldwin 1879abaf5f MFC 175682,175683,175686:
Generally, anything that runs rc.d scripts internally should
start using the quiet prefix (i.e. quietstart, quietstop, etc...).
2010-08-17 21:28:40 +00:00
Edwin Groothuis 27c0d84f89 MFC of 211422, tzdata2010l
- Fix start times of DST for Egypt.
- clocks were set back one hour at 2010-08-11 00:00:00 local time
  in Gaza and the West Bank.

Obtained from:  ftp://elsie.nci.nih.gov/pub/
2010-08-17 12:17:32 +00:00
Pyun YongHyeon 6c6e116258 MFC r210271:
Specify BCE_RX_BUF_ALIGN alignment for RX buffers. All bce(4)
  controllers require RX buffers aligned on BCE_RX_BUF_ALIGN bytes.
2010-08-15 23:58:21 +00:00
Pyun YongHyeon 83e7fbbd00 MFC r210263,210267,210269-210270:
r210263:
  Do not report current link state if interface is not UP.

r210267:
  Add KASSERT to check number of returned DMA segments.

r210269:
  Use bus_get_dma_tag() to get parent tag. Also use
  BUS_SPACE_MAXSIZE_32BIT to specify sum of all segment lengths.
  Previously it used MAXBSIZE which was wrong.

r210270:
  Specify BUS_DMA_ZERO flag to bus_dmamem_alloc(9) and remove bzero()
  calls. Also add BUS_DMA_COHERENT flag to bus_dmamem_alloc(9) to
  take advantage of efficient synchronization for architectures that
  support that feature.
2010-08-15 23:48:58 +00:00
Pyun YongHyeon e2edff6f7a MFC r210257,210259-210261:
r210257:
  When we didn't find a matching flash device, do not touch flash
  config data. While I'm here, use return code of bce_init_nvram()
  to set error instead of directly setting ENODEV.

r210259:
  Have bce_init_ctx() return error code and make caller check the
  return code. If context was not setup correctly give up
  initialization. While I'm here move variable declarations to the
  beginning of the function.

r210260:
  Don't change current media in bce_stop(). There is no need to do
  this here.

r210261:
  Correctly check the result of media selection. Previously it always
  returned success.
2010-08-15 23:40:44 +00:00
Pyun YongHyeon ef7b34f1d7 MFC r207411:
- Enable flow control.
  - Print device details only when verbose boot is enabled.
  - Add debug output for shared memory access.
  - Add debug statistics (checksum offload & VLAN frame counters).
  - Modify TX path to update consumer index for each frame completed
    rather than updating the consumer index only once for a group of
    frames to improve small packet performance.
  - Print driver/firmware pulse messages only when verbose boot
    is enabled.
  - Add debug sysctl to clear statistics.
  - Fix more style(9) violations.
2010-08-15 23:32:23 +00:00
Pyun YongHyeon b6caca9240 MFC r207391:
- Pass flow control settings back to bce(4).
2010-08-15 23:28:11 +00:00
Pyun YongHyeon 2160213f85 MFC r210244:
Implement WOL. WOL is supported on RTL8139B or newer controllers.

  PR:	kern/148013
2010-08-15 23:13:09 +00:00
Pyun YongHyeon 5210affe49 MFC r205651:
Use pci_get_max_read_req() and pci_set_max_read_req() to set maximim
  read request size.
2010-08-15 23:07:06 +00:00
Pyun YongHyeon e7053419e2 MFC r210083,210152:
r210083:
  Remove enabling Data FIFO protection with indirect memory access.
  r165114 added that code and that change ignored the same logic
  committed in r135772. In addition, data FIFO protection should be
  selectively enabled instead of applying to all PCIe devices.
  While I'm here add BCM5785 to devices that do not require this
  fix.

r210152:
  Use Miscellaneous Configuration Register bit definition instead of
  magic number.
2010-08-15 22:59:35 +00:00
Pyun YongHyeon 522af745ef MFC r210011,210013-210015:
r210011:
  Make bge_stop_fw() static.
  While I'm here use ANSI function definitions.

r210013:
  style.

r210014:
  Fix error message for jumbo buffer allocation failure.

r210015:
  Prefer PCIR_BAR macro over BGE_PCI_BAR0.
2010-08-15 22:53:46 +00:00
Pyun YongHyeon d63c706ddf MFC r209741:
Zero entire status block and add missing bus_dmamap_sync(9).
2010-08-15 22:45:40 +00:00
Pyun YongHyeon 748e316616 MFC r209714:
It seems read DMA mode register requires both IPv4 TSO and IPv6 TSO
  configuration to get IPv4 TSO work on BCM57780. While I'm here
  apply the same fix to BCM5785 which shares similar hardware feature
  of BCM57780. This change makes TSO work on BCM57780.

  Tested by:	Tong Liu <nemoliu <> gmail dot com>
2010-08-15 22:42:15 +00:00
Pyun YongHyeon d29a105cbd MFC r208917:
Remove unused macros.
2010-08-15 22:37:32 +00:00
Pyun YongHyeon 6d5e75e701 MFC r209818:
Remove enabling RX checksum offloading in RX filter setup. RX
  checksum is enabled in sge_init_locked().
  While I'm here do not set RX checksum bits in RX descriptor
  initialization. It is controller's job to set these bits.

  Tested by:	xclin <xclin <> cs dot nctu dot edu dot tw >
2010-08-15 21:58:05 +00:00
Pyun YongHyeon 05cdae3a85 MFC r209865:
Some revision of Yukon controller generates corrupted frame when TX
  checksum offloading is enabled.  The frame has a valid checksum
  value so payload might be modified during TX checksum calculation.
  Disable TX checksum offloading but give users chance to enable it
  when they know their controller works without problems with TX
  checksum offloading.

  Reported by:	Andrzej Tobola <ato <> iem dot pw dot edu dot pl>
2010-08-15 21:53:07 +00:00
Pyun YongHyeon 6e02442a65 MFC r211089:
It seems some old Sundace(now IC Plus Corp.) controllers do not
  like memory mapped register access. Typical problem from the issue
  was MII access returned unreliable values. I'm not sure this comes
  from lack of register flushing in MII access after accessing
  STE_PHYCTL register though.
  To address the issue, read hints data that controls which type of
  memory mapping should be used in driver. ste(4) still prefers
  memory mapping to io mapping but honor hints entered by user except
  for controllers that have problems with memory mapping.
  The hint to use iomapping could be given by adding the following
  line to /boot/device.hints file.

  hint.ste.0.prefer_iomap="1"

  PR:	kern/149285
2010-08-15 21:46:23 +00:00
Andre Oppermann 3162d75c8b MFC r210666:
Fix a bug in syncache where the initial CWND for new incoming connections
  was limited to one segment under the faulty assumption of a retransmit.
  Due to this the opportunity to initialize the increased congestion window
  according to RFC3390 was missed.
2010-08-14 20:03:32 +00:00
Bjoern A. Zeeb 07c100e6d6 MFC r210686:
MFp4 @181628:

  Free the rtentry after we diconnected it from the FIB and are counting
  it as rttrash.  There might still be a chance we leak it from a different
  code path but there is nothing we can do about this here.
2010-08-14 13:47:34 +00:00
Fabien Thomas f214ec81b9 MFC r210797:
- Do not use the runtime mask when logfile is specified.
- Revert the fix on rtld path that is not necessary.
2010-08-09 14:33:25 +00:00
Fabien Thomas e316ccd2a5 MFC r210794:
Allow file as a top source, it works with socket now.
This will allow top monitoring using socket/ssh tunnelling
of system without local symbols.

client:
pmcstat -R <ip>:<port> -T -r <symbolspath>
monitored device:
pmcstat -Sinstructions -O <ip>:<port>

- Move the file read in the event loop
- Initialize and clean log in all cases
- Preserve global stats value during top refresh
- Fix the rtld/line resolver that ignore '-r' prefix
- Support socket for '-R' (server mode)
- Display the statistics when exiting top mode
2010-08-09 14:30:45 +00:00
Fabien Thomas af3edfeab6 MFC r210766:
Fix the calltree top view that incorrectly filter out some nodes.
2010-08-09 14:26:52 +00:00
Gavin Atkinson 928c4184a1 Fix mismerge in r211035.
Pointy hat:	me
2010-08-08 19:07:59 +00:00
Jilles Tjoelker 992634c0e1 MFC r210734: Allow starting ipmon if ipnat is enabled but ipfilter is not
(in /etc/rc.conf).

This fixes an apparent confusion between test(1) and sh(1) syntax for
AND/OR.

PR:		conf/149036
Submitted by:	pluknet
2010-08-08 13:45:47 +00:00
Gavin Atkinson dc53a9f679 Merge r210534 from head:
Add support for the Longcheer WM66 USB HSDPA Modem to u3g(4)

PR:		usb/129945
Submitted by:	Antonio Hilario <avahilario gmail.com>
2010-08-07 19:27:49 +00:00
Rebecca Cran 57782f3ec5 MFC r209469:
If a device can't be opened, don't keep going but display the error
returned from open() and quit.

PR: bin/81035
Submitted by: Peter Schuller <peter.schuller at infidyne.com>
Approved by: rrs (mentor)
2010-08-07 13:02:26 +00:00
Rebecca Cran 8555b5a97b MFC r209468:
Make it easier to cancel a failing installation by only attempting to
extract distributions once. If a distribution fails to fetch/extract
and the user doesn't want to retry, abort the installation.

Approved by: rrs (mentor)
2010-08-07 12:54:12 +00:00
Rebecca Cran 255aafdd3a MFC r209467:
When installing on a machine which doesn't have a VGA card installed, enable
a getty on the serial port so that it's possible to login when the system is
rebooted.

PR: bin/23098
Submitted by: Doug Ambrisko <ambrisko at whistle.com>
Approved by: rrs (mentor)
2010-08-07 12:46:49 +00:00
Rebecca Cran ea5934646d MFC r209764:
Increase the default and minimum partition sizes.
Bump / to 1GB, /var to 4GB and /tmp to 1GB.

A 512MB root partition is now too small to hold two kernels, so to
prevent installkernel failing 1GB is a better default. Likewise,
applications are storing more data in /var so 4GB is more reasonable
on a modern machine.

The previous minimum partition sizes were too small to hold a minimal
installation, and have been adjusted accordingly.

Approved by: rrs (mentor)
2010-08-07 12:21:29 +00:00
Rebecca Cran fa89b3db1a MFC r209235, r210381 (bug fix for r209235):
* Allow partial MB/GB values to be entered in the slice and label editor.
* Don't strdup the name when calling deviceRegister because the string is
copied within new_device.
* Use a subtype of 165, not 3, when creating a slice in noninteractive
mode.

PR: bin/135333
PR: bin/66350
Approved by: rrs (mentor)
2010-08-07 11:15:32 +00:00
Rebecca Cran 4d3a7a1cac MFC r209058:
sctp_recvmsg returns the number of bytes received, not sent.

Approved by:	rrs (mentor)
2010-08-06 18:57:09 +00:00
Bernhard Schmidt a21a9ba580 MFC r182236,r182238,182250,182251:
- Add recent ELSA additions to wi(4), plus make sure the list matches
  the driver for ELSA.
- The APDL-325 is a Wireless LAN pcmcia adapter that sits inside some
  Billion Access Points.  Fix wi(4) to recognise the adapter.
- Remove opt_wi.h

PR:		kern/77913
Submitted by:	Daan Vreeken [PA4DAN] <Danovitsch at Vitsch.net>
2010-08-06 18:57:09 +00:00
Ulrich Spörlein a985e494ba MFC r210641: Fix a couple of typos.
PR:		docs/148891
Submitted by:	olgeni
2010-08-06 09:21:07 +00:00
Brian Somers 54fe435d70 MFC r209756:
Log dhclient's reason for exiting and change the 10 second
    ignore-routing-messages dhclient-script timeout to be effective
    from script completion rather than from script start time.

    Ignore RTM_DELADDR and RTM_NEWADDR messages when the message
    contains no interface address (which should not happen) rather than
    exiting.
2010-08-06 08:21:03 +00:00
John Baldwin 24bb68c424 MFC 210623:
Mark the __curthread() functions as __pure2 and remove the volatile keyword
from the inline assembly.  This allows the compiler to cache invocations of
curthread since it's value does not change within a thread context.
2010-08-05 22:04:07 +00:00
John Baldwin f604d68db3 MFC 210577: The corrected error count field is dependent on CMCI, not TES. 2010-08-05 21:01:35 +00:00
John Baldwin efa2358b4d MFC 210505:
- Change the warning about PCI-e links narrower than x8 to only apply to
  10G cards.  1G cards are x4 only.
- Use constants from pcireg.h for reading the current link width.
- Use pci_set_max_read_req() rather than implementing it by hand.
2010-08-05 20:45:46 +00:00
George V. Neville-Neil d933096e42 MFC: 210621
Make sure that we clear the correct bits when we turn off
a PMC.  It was possible that we could have turned a bit on but
never cleared it.

Extend the calls to rdmsr() to all necessary functions, not
just those which previously caused a panic.

Pointed out by: jhb@
2010-08-05 20:40:13 +00:00
John Baldwin 8c68a8f7e3 MFC 210604:
Fix test for double-nul characters that terminate the string table at
the end of each SMBIOS/DMI structure.
2010-08-05 19:43:32 +00:00
John Baldwin 52a9b51eb3 MFC 210136:
Retire the NFS access cache timestamp structure.  It was used in VOP_OPEN()
to avoid sending multiple ACCESS/GETATTR RPCs during a single open()
between VOP_LOOKUP() and VOP_OPEN().  Now we always send the RPC in
VOP_LOOKUP() and not VOP_OPEN() in the cases that multiple RPCs could be
sent.

To preserve the ABI I have left the structure in place, but renamed it
to 'n_unused' and just removed the code that updates it.
2010-08-05 19:41:43 +00:00
George V. Neville-Neil a38294c19b Fix a build breakage foudn by the module build in tinderbox.
Update NOTES so that em and igb are both now part of the LINT
kernel.

Pointed out by: tinderbox
2010-08-04 15:59:45 +00:00
Tijl Coosemans 2ec84a6940 MFC r209955:
When switching the thread from the processor, store %dr7 content
into the pcb before disabling watchpoints. Otherwise, when the
thread is restored on a processor, watchpoints are still disabled.

Approved by:	kib (mentor)
2010-08-04 09:56:43 +00:00
Xin LI 689f6632de MFC r210358:
Apply vendor version 1.20.00.17.

This version adds support for ARC1880; additionally this version fixed
an issue where all devices on a SAS port gets offlined when any device
failed on the port [1].

Many thanks to Areca for continuing to support FreeBSD.

PR:		kern/148502 [1]
Submitted by:	Ching-Lung Huang <ching2048 areca com tw>
Obtained from:	Areca
Tested by:	Rich Ercolani <rercola acm jhu edu> [1]
2010-08-04 01:34:35 +00:00
Gavin Atkinson 36a6068cfd Merge r210515,210516,210543 from head:
Prevent ukbd(4) and uhid(4) from attaching when a WiSPY DBx Spectrum
  Analyzer is attached. [1]

  Prevent uhid(4) from attaching to the Gembird Silver Shield remote power
  plug. [2]

  Prevent uhid(4) from attaching to the Liebert PowerSure Personal XT UPS.
  [3]

PR:		usb/134631 [1], usb/132785 [2], usb/129251 [3]
Submitted by:	Jesse Kempf <jkempf davisvision.com> [1]
Submitted by:	Dirk-Willem van Gulik <dirkx webweaving.org> [2]
Submitted by:	Andrew D Wiles <adw+gnats avatastic.co.uk> [3]
2010-08-03 22:06:34 +00:00
Fabien Thomas c591af37c3 MFC r209196:
Set the comment at the right place for PMC uncore classes.
2010-08-03 16:37:29 +00:00
Fabien Thomas 94ebf27ffe MFC r208861:
Convert pm_runcount to int to correctly check for negative value.
Remove uncessary check for error.

Found with:	Coverity Prevent(tm)
2010-08-03 16:31:18 +00:00
Fabien Thomas 7d0c390dc9 MFC r208860:
Fix memory leak on error.

Found with:	Coverity Prevent(tm)
2010-08-03 16:27:13 +00:00
Fabien Thomas 8d8f126b1f MFC r208858:
Fix warnings found by Coverity.

Found with:   Coverity Prevent(tm)
2010-08-03 16:23:46 +00:00
George V. Neville-Neil 08ae1ff427 MFC: 209241, 209512, 210428, 210452
Move statistics into the sysctl tree making it easier to find
and use them.
Add previously hidden statistics, some of which include interrupt
and host/card communication counters.

Include all fixups pointed out by others in testing.
2010-08-03 15:07:38 +00:00
Ulrich Spörlein 0f476ee2e3 MFC r210662: Fix indention of attribution line for some recent additions. 2010-08-02 11:48:05 +00:00
Xin LI 2fe683488b MFC r210661:
Change copyright holder to author.  We prefer using a real legal
entity for copyright holders.

Approved by:	sephe
2010-08-02 08:31:31 +00:00
Edwin Groothuis 7bd7b2661d MFC of 210718, tzdata2010k:
- Daylight Saving Time will not be used in Egypt during Ramadan.
- Proper names for Pacific/Pohnpei and Pacific/Chuuk
- Fix historical information for Finland for 1981 and 1982
- No leap-second for December 2010.
- Fix historical information for Ontario (Canada)
2010-08-01 09:11:56 +00:00
Bjoern A. Zeeb 4a0775741e MFC r210532:
Return NULL rather than 0 for a pointer.
2010-07-30 21:28:25 +00:00
Ulrich Spörlein 98d97ccee8 MFC r208730:
Zero struct before reading from it

PR:		140384
2010-07-30 12:36:40 +00:00
Gavin Atkinson 7f4130bed7 - Support the Epson RX620 and HP ScanJet 3570C scanners in uscanner(4).
Direct commit to stable/7 as the uscanner driver no longer exists in head.

PR:		usb/121426, usb/122025
Submitted by:	Greg Mars <authentec gmail.com>
Submitted by:	Bjorn Konig <bkoenig alpha-tierchen.de>
2010-07-28 16:58:36 +00:00
Attilio Rao 7615dc2d93 MFC r203042, r203735:
Allow -o as a synonym for -s, for compatibility with other systems.
2010-07-28 16:32:30 +00:00
Andriy Gapon 13bfb6f39a MFC r199969: add amdsbwd.4
This part of r199969 was left during original MFC, only merge to sys was
done at that time.

Reported by:	hrs
Pointyhat to:	avg
2010-07-28 09:17:42 +00:00
Gavin Atkinson 957f96e56f Support the ZTE AC8700 EVDO modem in u3g(4)
No mergeinfo due to vastly differing stacks in head vs stable/7.

PR:		usb/129522
Submitted by:	Sergej Kandyla <sk.paix gmail.com>
2010-07-27 12:53:53 +00:00
John Baldwin c1dd22be51 MFC 209948:
A previous change moved the GETATTR RPC for open() calls that hit in the
name cache up into nfs_lookup() instead of nfs_open().  Continue this
trend by flushing the attribute cache for leaf nodes in nfs_lookup() during
an open() if we do a LOOKUP RPC.  For NFSv3 this should generally be a NOP
as the attributes are flushed before fetching the post-op attributes from
the LOOKUP RPC which most (all?) NFSv3 servers provide, so the post-op
attributes should populate the cache.

Now all NFS open() calls will always clear the cached attributes during the
nfs_lookup() prior to nfs_open() in the !NMODIFIED case to provide CTOC.
As a result, we can remove the conditional flushing of the attribute
cache from nfs_open().
2010-07-26 18:55:18 +00:00
John Baldwin 07491ee2b0 MFC 209212:
Restore the machine check register banks on resume.  For banks being
monitored via CMCI, reset the interrupt threshold to 1 on resume.
2010-07-26 18:23:05 +00:00
John Baldwin fae98397a2 MFC 208633 (Missed in earlier CMCI MFC):
Defer initializing machine checks for the boot CPU until the local APIC is
fully configured.
2010-07-26 17:39:11 +00:00
Gavin Atkinson 7c4a92ca3b Support the Novatel U760 dongle (Verizon and Bell Canada)
Note that this is a direct commit to stable/7 due to differences in the
code in head.  No mergeinfo as the commit that added this in head made
many other changes at the same time.

PR:		usb/138138
Submitted by:	mike tancsa <mike sentex.net>
2010-07-26 12:58:20 +00:00
Doug Barton 4709ec64d6 MFC 209531:
Taken from actual police videos ...

MFC 210484:
Correct a Cecil Beaton quote
2010-07-26 02:05:36 +00:00
Doug Barton 59b51a8b18 Pull mergeinfo up into the parent 2010-07-26 02:02:45 +00:00
Christian Brueffer 30572dbe84 MFC: r145251
Various wording, spelling and markup fixes.
2010-07-25 20:08:07 +00:00
Rong-En Fan a4e7a91ef4 MFC r210465
- Fix wrong manpage title for keybound.3X

 PR:            docs/148864
 Obtained from: ncurses-5.7-20081213 snapshot
2010-07-25 11:53:32 +00:00
John Baldwin 6aa4b8bbb6 MFC 209956:
Remove a dead test.  We already exclude NMI traps from this code in an
earlier condition.
2010-07-23 15:32:44 +00:00
John Baldwin 5bc8f6cd37 MFC 209946:
- Add missing locking around flushing of an NFS node's attribute cache
  in the NMODIFIED case of nfs_open().
- Cosmetic tweak to simplify an expression in nfs_lookup().
2010-07-23 15:26:32 +00:00
John Baldwin eb27cdd9f0 MFC 210068:
- Sort list of trace points.
- Note that 'y' (sysctl requests) is in the default set of trace points.
2010-07-23 15:16:37 +00:00
John Baldwin 4b132d20c2 MFC 210066:
Rework the SMBIOS table walker to make it operate like other table walkers
and remove a buffer overflow.
2010-07-23 14:30:31 +00:00
Jung-uk Kim 38515bedd9 MFC: r210248
Fix two long-standing line wrapping bugs in VGA renderer for pixel mode.
Font size may be smaller than 16 and logical scan line may be larger than
the displayed scan line.
2010-07-22 17:02:51 +00:00
Jung-uk Kim dfb32c2a49 MFC: r209965, r209966, r210129, r210137, r210155
- According to ACPICA User Guide and Programmer Reference, the read data
must be zero extended to fill the 32-bit or 64-bit return value even if
the bit width of the port or location is less than 32 or 64.
- Use pmap_mapdev()/pmap_unmapdev() to map device memory instead of using
AcpiOsMapMemory()/AcpiOsUnmapMemory() (-> pmap_mapbios()/pmap_unmapbios())
for AcpiOsReadMemory() and AcpiOsWriteMemory().  Although they do not sound
too obvious, these functions are exclusively used to access memory mapped
IO in ACPICA.
- Remove 64-bit access from AcpiOsReadMemory() and AcpiOsWriteMemory().
These functions do not support 64-bit access.  Likewise, return error when
64-bit access is requested for PCI configuration space.
- Clean up some white spaces.
2010-07-20 19:43:25 +00:00
Jung-uk Kim 4ea8db2549 MFC: r209837, r209842, r209949
Sync. printf() of libstand(3) with sys/kern/subr_prf.c.

CVS r1.94	jhb:
Cast the integer read as the first argument for %b to an unsigned integer
so it's value is not sign extended when assigned to the uintmax_t variable
used internally by printf.  For example, if bit 31 is set in the cpuid
feature word, then %b would print out the initial value as a 16 character
hexadecimal value.  Now it only prints out an 8 character value.

CVS r1.109	njl:
Add support for 'h' and 'hh' modifiers for printf(9).

CVS r1.117	phk:
If we ignore an unknown % sequence, we must stop interpreting the remaining
% arguments because the varargs are now out of sync and there is a risk that
we might for instance dereference an integer in a %s argument.

SVN r209836	jkim:
Implement optional 'precision' for numbers.  Previously, it was parsed but
ignored.  Some third-party modules (e.g., ACPICA) prefer this format over
zero padding flag '0'.
2010-07-20 19:13:31 +00:00
Jung-uk Kim e644883007 MFC: r209836, r209949
Implement optional 'precision' for numbers.  Previously, it was parsed but
ignored.  Some third-party modules (e.g., ACPICA) prefer this format over
zero padding flag '0'.
2010-07-20 19:11:47 +00:00
George V. Neville-Neil 37abf93899 MFC r210012:
Fix a panic brought about by writing an MSR without a proper mask.
All of the necessary wrmsr calls are now preceded by a rdmsr
and we leave the reserved bits alone.
Document the bits in the relevant registers for future reference.

Tested by: mdf
2010-07-20 17:57:03 +00:00
Benedict Reuschling 70639618d5 Revert to r172506, because sio(4) is still the default in stable/7.
Pointed out by:     gavin
2010-07-18 14:52:40 +00:00
Benedict Reuschling 9db59ba20e MFC r209703:
Let boot(8) refer to the uart(4) serial driver, which is the replacement
for the obsolete sio(4) driver.

PR:             docs/144498
Submitted by:   Bruce Cran (bruce at cran dot org dot uk)
Approved by:    marcel
2010-07-18 11:03:32 +00:00
Marius Strobl 7a5a0c0b69 MFC: r209961
Correct inverted parent DMA tag parameters.

Reviewed by:	ken
2010-07-17 15:47:28 +00:00
Giorgos Keramidas 045d3298bc MFC r209871 from /head
Fix reading of empty fifolog files.  When we don't have anything
    to inflate, skip the rest of the fifolog reader code to avoid
    hitting the assert about Z_OK a bit further down.
2010-07-17 07:59:53 +00:00
John Baldwin 99a6b2553e MFC 185507:
Don't manually track statistics.
2010-07-16 20:28:45 +00:00
John Baldwin fc475f0cea When the MNTK_EXTENDED_SHARED mount option was added, some filesystems were
changed to defer the setting of VN_LOCK_ASHARE() (which clears LK_NOSHARE
in the vnode lock's flags) until after they had determined if the vnode was
a FIFO.  This occurs after the vnode has been inserted into a VFS hash or
some similar table, so it is possible for another thread to find this vnode
via vget() on an i-node number and block on the vnode lock.  If the lockmgr
interlock (vnode interlock for vnode locks) is not held when clearing the
LK_NOSHARE flag, then the lk_flags field can be clobbered.  As a result
the thread blocked on the vnode lock may never get woken up.  Fix this by
holding the vnode interlock while modifying the lock flags in this case.

The softupdates code also toggles LK_NOSHARE in one function to close a
race with snapshots.  Fix this code to grab the interlock while fiddling
with lk_flags.
2010-07-16 20:23:24 +00:00
Warner Losh 9e92d59b60 MFC: r188277, r188280, r201227, r205880, r206664, r206915, r207260, r207263,
r207265, r209135, r209969

(I'm not repeating all that here, see the logs for all the details):

Config version is now 600010
option alias support
makefile parsing fixes
calloc failure coping
WARNS=6
comment placement correction
alpha vestige removal

This should allow building of -current kernels and modules on 7-stable
machines (although not officially supported, enough people do it to
make some efforts to make it work a big win).

imp, ed, wkoszek, ru, gcooper, and nwhitehorn authored the original revs
2010-07-15 23:07:02 +00:00
John Baldwin b872127bd5 MFC 209595:
Send SIGPIPE to the thread that issued the offending system call
rather than to the entire process.
2010-07-14 21:52:23 +00:00
John Baldwin 8546461846 MFC 208507,208556,208621:
Add support for corrected machine check interrupts.  CMCI is a new local
APIC interrupt that fires when a threshold of corrected machine check
events is reached.  CMCI also includes a count of events when reporting
corrected errors in the bank's status register.  Note that individual
banks may or may not support CMCI.  If they do, each bank includes its own
threshold register that determines when the interrupt fires.  Currently
the code uses a very simple strategy where it doubles the threshold on
each interrupt until it succeeds in throttling the interrupt to occur
only once a minute (this interval can be tuned via sysctl).  The threshold
is also adjusted on each hourly poll which will lower the threshold once
events stop occurring.
2010-07-14 21:10:47 +00:00
John Baldwin 692c8b8166 MFC 208787:
Assert that the thread lock is held in sched_pctcpu() instead of
recursively acquiring it.  All of the current callers already hold the
lock.
2010-07-14 19:01:08 +00:00
John Baldwin 38fc21c316 MFC 209588:
- The ETIMEDOUT error applies to pthread_timedjoin_np(), not pthread_join().
- Tweak wording in history section for pthread_timedjoin_np().
2010-07-14 18:55:45 +00:00
John Baldwin 2063ffff15 MFC 177446,177856:
Spell -t option's argument by name.
2010-07-14 18:23:19 +00:00
Mark Peek 1dedbad1e6 Merge r197812:
Fix tcsh losing history when tcsh terminates because the pty beneath it
is closed.
2010-07-14 15:18:22 +00:00
Mark Peek 0f1991b30c MFC: Update to tcsh 6.17.00.
Requested by: gnn
2010-07-14 15:14:52 +00:00
Mark Peek 02bb2b70f4 MFC r184072: Actually fix pty detection for autologout setting. 2010-07-14 15:11:29 +00:00
Andrey V. Elsukov ace3342eb7 MFC r208946:
New netgraph node ng_patch(4). It performs data modification of packets
  passing through. Modifications are restricted to a subset of C language
  operations on unsigned integers of 8, 16, 32 or 64 bit size.
  These are: set to new value (=), addition (+=), subtraction (-=),
  multiplication (*=), division (/=), negation (= -), bitwise AND (&=),
  bitwise OR (|=), bitwise eXclusive OR (^=), shift left (<<=),
  shift right (>>=). Several operations are all applied to a packet
  sequentially in order they were specified by user.

  Submitted by:	Maxim Ignatenko <gelraen.ua at gmail.com>
  		Vadim Goncharov <vadimnuclight at tpu.ru>
  Discussed with:	net@

MFC r208947:
  Fix typo.

MFC r208989:
  Style(9) fixes:
  * Sort includes
  * Replace #define<SPACE> to #define<TAB>
  * Split declarations and initializations
  * Split long lines

  Requested by:	kib

MFC r209194:
  * Include sys/systm.h for KASSERT()
  * Remove unneeded includes and comment
  * Replace home made OFFSETOF() macro with standard offsetof()

  Pointed out by:	bde

Tested by:	Vadim Goncharov <vadimnuclight at tpu.ru>
Approved by:	mav (mentor)
2010-07-13 20:13:38 +00:00
Konstantin Belousov c020255075 MFC r209743:
Calculate nshift only once.
2010-07-13 08:55:52 +00:00
Konstantin Belousov c6b7468e13 MFC r209742:
In revoke(), verify that VCHR vnode indeed belongs to devfs.
2010-07-13 08:53:41 +00:00
Colin Percival c4294203cb Correctly copy the M_RDONLY flag when duplicating a reference
to an mbuf external buffer.

Approved by:	so (cperciva)
Approved by:	re (kensmith)
Security:	FreeBSD-SA-10:07.mbuf
2010-07-13 02:45:17 +00:00
Remko Lodder 609b3fafb6 MFC r202917
Add support for the NM10 chipset.

 PR:		kern/143118
 Submitted by:	Koshin sumitani <ksumitani at mui dot biglobe dot ne dot jp>
 Approved by:	imp (mentor, implicit)
 MFC after:	3 days
2010-07-12 17:50:38 +00:00
Xin LI 30eab52b03 MFC r209860:
Don't use pack() for structures that is used purely for software state.
Otherwise the resulting, unaligned mutex structure would trigger panic.

Submitted by:		Tom Cough <tom.couch lsi.com>
Reported/Tested by:	jhb
PR:			kern/148464
2010-07-09 20:43:57 +00:00
Andriy Gapon 831ec4f90c MFC r209413: readelf.1: remove duplicate -u/--unwind option description 2010-07-08 21:35:57 +00:00
Andriy Gapon 950ae92b04 MFC r209228: device.hints: do install when WITHOUT_BOOT is set 2010-07-08 20:57:37 +00:00
Andriy Gapon 1fd4899e16 MFC r209425: udf_vnops: cosmetic followup to r208671 2010-07-08 20:43:20 +00:00
Andriy Gapon 6ff5e23f44 MFC r209056: vnode.h: expand debug macros to non-empty void statements
when DEBUG_VFS_LOCKS is disabled
2010-07-08 20:18:52 +00:00
John Baldwin 3cc66cc553 MFC 175676:
Implement a quiet prefix, which will disable some diagnostics. The
fast prefix also implies quiet. During boot we use either fast or
quiet. For shutdown we already use 'faststop'. So, this informational
message should only appear during interactive use.

Reviewed by:	silence on freebsd-rc@
2010-07-08 13:34:01 +00:00
Marius Strobl e2d0ec5643 MFC: r209695
- Pin the IPI cache and TLB demap functions in order to prevent migration
  between determining the other CPUs and calling cpu_ipi_selected(), which
  apart from generally doing the wrong thing can lead to a panic when a
  CPU is told to IPI itself (which sun4u doesn't support).
  Reported and tested by: Nathaniel W Filardo
- Add __unused where appropriate.
2010-07-07 19:52:57 +00:00
Christian Brueffer 53c491a6b4 MFC: r207948
- Missing full stops
- Upper case the first character of an description
- Section headings do not need to be quoted. From OpenBSD's make.1, revision 1.81
- Plural of suffix is suffixes. From OpenBSD's make.1, revision 1.61
- s/seperating/separating/
2010-07-04 18:49:15 +00:00
Christian Brueffer ea4b9721e6 MFC: r207946
The previous revision actually removed the bug being hinted at, so
go ahead and remove the hint.
2010-07-04 18:44:32 +00:00
Jilles Tjoelker bee6a7824c MFC r207944: sh: Fix pathname expansion with quoted slashes like *\/.
These are git commits 36f0fa8fcbc8c7b2b194addd29100fb40e73e4e9 and
d6d06ff5c2ea0fa44becc5ef4340e5f2f15073e4 in dash.

Because this is the first code I'm importing from dash to expand.c, add the
Herbert Xu copyright notice which is in dash's expand.c.

When pathname expanding *\/, the CTLESC representing the quoted state was
erroneously taken as part of the * pathname component. This CTLESC was then
seen by the pattern matching code as escaping the '\0' terminating the
string.

The code is slightly different because dash converts the CTLESC characters
to backslashes and removes all the other CTL* characters to allow
substituting glob(3).

The effect of the bug was also slightly different from dash (where nothing
matched at all). Because a CTLESC can escape a '\0' in some way, whether
files were included despite the bug depended on memory that should not be
read. In particular, on many machines /*\/ expanded to a strict subset of
what /*/ expanded to.

Example:
  echo /*"/null"

This should print /dev/null, not /*/null.

PR:		bin/146378
Obtained from:	dash
2010-07-03 21:06:48 +00:00
Christian Brueffer 0eb0758072 MFC: r207975
IBM ServeRAID M5015 SAS/SATA works.
2010-07-03 09:54:14 +00:00
Christian Brueffer 513c28882f MFC: r207945
Comment in the BUGS section header. Matches what's in ipfilter 5.10.
2010-07-03 09:47:12 +00:00
David E. O'Brien b18d4185b1 Cleanup svn merge conflict markers. 2010-06-30 07:43:49 +00:00
John Baldwin b4a42e4d51 Remove gratuitous whitespace changes accidentally added in the previous
commit.
2010-06-28 14:06:44 +00:00
John Baldwin c022309b0f Remove some gratuitous local diffs. 2010-06-28 14:04:19 +00:00
Jilles Tjoelker d5dbaaebf1 MFC r208647,r208654: Clarify devfs manpages slightly.
mount(8): add xref to devfs(5)
devfs(5): change example to something more likely to be useful (it is not
necessary to mount a devfs on /dev manually, but for chroots/jails it is
often needed), mention since when devfs is preferred to device nodes on ufs
and when device nodes on ufs stopped working

PR:		146600
2010-06-26 14:42:07 +00:00
John Baldwin 6705331a45 MFC 208391:
Assert that the thread passed to sched_bind() and sched_unbind() is
curthread as those routines are only supported for curthread currently.
2010-06-24 12:09:12 +00:00
John Baldwin 2780907192 MFC 208388:
- Set 'dmadat' earlier so that we properly setup the heap if we fail to
  locate a high memory area for the heap using the SMAP.
- Read the number of hard drive devices from the BIOS instead of hardcoding
  a limit of 128.  Some BIOSes duplicate disk devices once you get beyond
  the maximum drive number.
2010-06-23 17:56:51 +00:00
Doug Barton cb3e9e0a8a MFC 209286:
Add the AAAA address for i.root-servers.net
2010-06-22 21:13:35 +00:00
Andriy Gapon 10e01ddc1c MFC r208672: g_label: fix possible NULL pointer dereference 2010-06-22 08:17:55 +00:00
Andriy Gapon 4c7b27a939 MFC r208670: amdsbwd: fix nonsensical timeout calculations 2010-06-22 07:52:58 +00:00
Andriy Gapon 68418bf450 MFC r208669: zfs boot: fix error handling in zfs_readdir 2010-06-22 07:46:54 +00:00
Xin LI 2c2cf3e3e5 Fix a regression when dealing with tar(1) format files
introduced with GNU cpio 2.8.

This is a direct commit against stable/7 because the
code have been removed on -HEAD and stable/8.

PR:		bin/147969
Submitted by:	kientzle
2010-06-21 22:54:47 +00:00
Xin LI 8b0218f997 MFC r208969,209268:
Driver update of twa(4) from LSI.  Many thanks to LSI for continuing to
support FreeBSD.

  1) Timeout ioctl command timeouts.
       Do not reset the controller if ioctl command completed
       successfully.
  2) Remove G66_WORKAROUND code (this bug never shipped).
  3) Remove unnecessary interrupt lock (intr_lock).
  4) Timeout firmware handshake for PChip reset (don't wait forever).
  5) Handle interrupts inline.
  6) Unmask command interrupt ONLY when adding a command to the pending
     queue.
  7) Mask command interrupt ONLY after removing the last command from
     the pending queue.
  8) Remove TW_OSLI_DEFERRED_INTR_USED code.
  9) Replace controller "state" with separate data fields to avoid races:

       TW_CLI_CTLR_STATE_ACTIVE                     ctlr->active
       TW_CLI_CTLR_STATE_INTR_ENABLED               ctlr->interrupts_enabled
       TW_CLI_CTLR_STATE_INTERNAL_REQ_BUSY          ctlr->internal_req_busy
       TW_CLI_CTLR_STATE_GET_MORE_AENS              ctlr->get_more_aens
       TW_CLI_CTLR_STATE_RESET_IN_PROGRESS          ctlr->reset_in_progress
       TW_CLI_CTLR_STATE_RESET_PHASE1_IN_PROGRESS   ctlr->reset_phase1_in_progress

 10) Fix "req" leak in twa_action() when simq is frozen and req is NOT
     null.
 11) Replace softc "state" with separate data fields to avoid races:
       TW_OSLI_CTLR_STATE_OPEN                      sc->open
       TW_OSLI_CTLR_STATE_SIMQ_FROZEN               sc->simq_frozen
 12) Fix reference to TW_OSLI_REQ_FLAGS_IN_PROGRESS in
     tw_osl_complete_passthru()
 13) Use correct CAM status values.
       Change CAM_REQ_CMP_ERR to CAM_REQ_INVALID.
       Remove use of CAM_RELEASE_SIMQ for physical data addresses.
 14) Do not freeze/ release the simq with non I/O commands.
       When it is appropriate to temporarily freeze the simq with an I/O
       command use:
         xpt_freeze_simq(sim, 1);
         ccb->ccb_h.status |= CAM_RELEASE_SIMQ;
       otherwise use:
         xpt_freeze_simq(sim, 1);
         xpt_release_simq(sim, 1);

Submitted by:	Tom Couch <tom.couch lsi.com>
PR:		kern/147694
2010-06-21 22:20:52 +00:00
Kai Wang 028287255a MFC r209122:
* Improve compatibility with existing application code by permitting the
    use of `elf_getbase()` on non-archive members. This change is needed
    for gcc LTO (-flto) to work properly.
  * Style fix: paranthesize returned values.
  * Document the current behaviour of `elf_getbase()`.
2010-06-21 13:52:31 +00:00
Xin LI 71d9f649e7 Fix two regressions introduced by GNU cpio 2.8 import:
cpio/src/copyout.c:
	Old behavior is not to strip leading / from symbol link target.

	By default cpio will replace the symbol link rather than following
	it so this should not be a risk.

cpio/src/util.c:
	Zero out rdev_{maj,min} for files where they are not applicable.

This is a direct commit since GNU cpio has been removed from -HEAD.

Sorry for the breakage...

Reported by:	sbruno
2010-06-18 18:15:40 +00:00
Max Laier 4960c757f0 MFC r209063:
Cache the last result from if_indextoname for printing.  This speeds up
  "arp -an" when using a lot of aliases (on a single interface).

  A better fix would include a better interface for if_indextoname than
  getting the whole address list from the kernel just to find the one
  index->name mapping.
2010-06-17 20:38:18 +00:00
Marius Strobl 611b9690c9 MFC: r209138
Update a branch missed in r207537 (commited to stable/7 in r207891).
2010-06-17 20:10:41 +00:00
Bjoern A. Zeeb ac19d45204 "MFC" (parts of) r185849:
Fix a locking issue triggering an assertion in rt_setgate()
  via arp_rtrequest() due to no radix node head (rnh) lock held
  in case of a route change.

  The previous MFC in r189026 left out this hunk.

Reported by:	Haven Hash (haven.hash isilon.com)
Tested by:	Haven Hash (haven.hash isilon.com)
PR:		kern/147767
2010-06-12 15:42:54 +00:00
Marius Strobl 2e37738364 MFC: r208778
- Mention that VTOC8 labels are found in Fujitsu SPARC64 machines as well.
- Add information regarding VTOC8 bootrstrap code and how it's handled with
  r208777 in place.
- Document the mapping of partition types to VTOC8 tags.
- Add examples for VTOC8 to the respective section.
- Eliminated hard sentence breaks.

Reviewed by:	marcel (slightly buggy version)
2010-06-12 00:28:53 +00:00
Marius Strobl a0d02b3c24 Revert part of r209079 which shouldn't have been MFC'ed, yet. 2010-06-11 22:53:41 +00:00
Marius Strobl 6c62101e42 MFC: r208777
- In gpart_bootfile_read() fix an off-by-one error preventing the bootstrap
  file to be of maximum size.
- Add special handling required for SMI/VTOC8 disklabel partcode, i.e. avoid
  overwriting the label when writing the bootstrap code to the partition
  starting at 0 and install it to all partitions when the -i option is omitted
  just like geom_sunlabel(4) and sunlabel(8) do by default.
- Add missing prototypes.
- Add const where applicable.

Reviewed by:	marcel
2010-06-11 22:35:43 +00:00
Marius Strobl 26cdf34d53 MFC: r208776
Avoid possible NULL-dereferences.

Found with:	Coverity Prevent(tm)
CID:		3428
2010-06-11 22:01:58 +00:00
Marius Strobl 93236f4bcf MFC: r208746
Don't leak memory on destruction.

Reviewed by:	marcel
Approved by:    re (kib)
2010-06-11 21:54:06 +00:00
Xin LI 089356bce6 MFC r205940:
Remove unused files.

PR:		bin/38256
2010-06-10 22:46:12 +00:00
John Baldwin 664d4a501c MFC 208603:
More gracefully handle stale file handles and attributes when opening a
file via NFS.  Specifically, to satisfy close-to-open-consistency, the NFS
client always performs at least one RPC on a file during an open(2) to see
if the file has changed.  Normally this RPC is an ACCESS or GETATTR RPC
that is forced by flushing a file's attribute cache during nfs_open() and
then requesting new attributes.  However, if the file is noticed to be
stale during nfs_open(), the only recourse is to fail the open(2) call
with ESTALE.  On the other hand, if the ACCESS or GETATTR RPC is sent
during nfs_lookup(), then the NFS client can fall back to a LOOKUP RPC to
obtain the new file handle in the case that a file has been replaced.

This change causes the NFS client to flush the attribute cache during
nfs_lookup() when validating a name cache hit if the attributes fetched
during nfs_lookup() can be reused in nfs_open().  This allows the client
to open a replaced file via the new file handle the first time that it
notices a replaced file rather than failing with ESTALE in some cases.
2010-06-10 20:13:23 +00:00
John Baldwin 542a3d86d6 MFC 208925:
The lock associated with the /dev/apm knote is already held, so use
KNOTE_LOCKED() instead of KNOTE_UNLOCKED().
2010-06-10 20:02:13 +00:00
Pyun YongHyeon 2bd49bdfc4 MFC r208862:
Fix a bug introduced in r199011. When bge(4) reuses loaded RX
  buffers it should also reinitialize RX descriptors otherwise some
  stale data could be passed to controller. This could end up with
  mbuf double free or unexpected NULL pointer dereference in upper
  stack. To fix the issue, save loaded buffer's length and
  reinitialize RX descriptors with the saved value whenever bge(4)
  reuses the loaded RX buffers.
  While I'm here, increase the number of RX buffers to 512 from 256.
  This simplifies RX buffer handling as well as giving more RX
  buffers. Controller supports just fixed number of RX buffers
  (i.e. 512) and bge(4) used to rely on hope that our CPU is fast
  enough to keep up with the controller. With this change, bge(4)
  will use 1MB for RX buffers but I don't think it would cause
  problems in these days.

  Reported by:	marcel
  Tested by:	marcel
2010-06-10 18:04:25 +00:00
Andriy Gapon bfc20092d5 MFC r208671: udf_readlink: fix malloc call with uninitialized size
parameter

Found by:	clang static analyzer
2010-06-09 10:14:43 +00:00
Andriy Gapon 1ca4b5b67d MFC r208800: scsi_cd: pass correct pointer to free() 2010-06-09 09:51:16 +00:00
Brian Somers 414c915231 MFC r197477 - clean up keys deleted via pthread_key_delete()
PR:		135462
2010-06-09 07:36:35 +00:00
Pyun YongHyeon 34da376f86 MFC r208806:
Don't blindly set IFF_DRV_OACTIVE when sge_encap() fails. If there
  is no queued frame, IFF_DRV_OACTIVE would never be cleared.

  Submitted by:	Nikolay Denev < ndenev <> gmail at com >
2010-06-08 19:36:41 +00:00
Alan Cox d1cbb09d35 MFC r208765
In the unlikely event that pmap_ts_referenced() demoted five superpage
  mappings to the same underlying physical page, the calling thread would
  be left forever pinned to the same processor.
2010-06-08 04:48:36 +00:00
Andriy Gapon 0e19d2ece1 MFC r208610: boot/zfs: fix gang block reading code
- use correct size (512) while reading a gang block
- skip holes while reading child blocks
- advance buffer pointer while reading child blocks

PR:		144214
2010-06-07 13:44:04 +00:00
John Baldwin c581257df0 MFC 208555:
Ignore the 'addr' argument passed to PT_STEP (it is required to be '1'
for PT_STEP which means "ignore") and PT_DETACH.
2010-06-01 19:39:27 +00:00
Pyun YongHyeon 9e51a50bf3 MFC r208512:
sge_encap() can sometimes return an error with m_head set to NULL.
  Make sure not to requeue freed mbuf in sge_start_locked(). This
  should fix NULL pointer dereference panic.

  Reported by:	Nikolay Denev <ndenev <> gmail dot com>
  Submitted by:	jhb
2010-05-31 22:07:18 +00:00
Colin Percival cba6498271 Change the current working directory to be inside the jail created by
the jail(8) command. [10:04]

Fix a one-NUL-byte buffer overflow in libopie. [10:05]

Correctly sanity-check a buffer length in nfs mount. [10:06]

Approved by:	so (cperciva)
Approved by:	re (kensmith)
Security:	FreeBSD-SA-10:04.jail
Security:	FreeBSD-SA-10:05.opie
Security:	FreeBSD-SA-10:06.nfsclient
2010-05-27 03:15:04 +00:00
Matt Jacob 8afe9a1216 This is an MFC of 208119, 208129
Hook up some wires that were forgotten a few months ago and restore
the zombie device timeout code and the loop down time code and the fabric
hysteresis code.
2010-05-26 19:06:40 +00:00
Marius Strobl 997d287a80 MFC: r208468
At least on sparc64 this module requires ata_machdep.c.
2010-05-26 17:30:19 +00:00
Jung-uk Kim b9810a5392 Regen for r208551. 2010-05-25 20:35:39 +00:00
Jung-uk Kim 256427e2ef MFC: r208322
Add an option file for WITHOUT_MAN_UTILS to regenerate src.conf(5).
2010-05-25 20:33:49 +00:00
Jung-uk Kim 4e46d43fc3 MFC: r208320
Add a new build option, MAN_UTILS.  This option lets you control building
utilities and related support files for manual pages, which were previously
controlled by MAN.  For POLA, the default depends on MAN, i.e., WITHOUT_MAN
implies WITHOUT_MAN_UTILS and WITH_MAN implies WITH_MAN_UTILS.
Note this patch implicitly fixes a documentation bug of src.conf(5), which
says WITHOUT_MAN may be used to not build manual pages while it was also
disabling some utilities for manual pages.
2010-05-25 20:32:30 +00:00
Jung-uk Kim 9e5896f7d7 Regen for r208540. 2010-05-25 15:58:31 +00:00
Jung-uk Kim 954df5a569 MFC: r183305, r183306
Add mission options.
2010-05-25 15:51:36 +00:00
John Baldwin ceb36f9418 MFC 208350:
Add support for the Perle Speed4 LE.
2010-05-24 19:36:32 +00:00
Andrew Gallatin 4373085b17 MFC 208379: Add interrupt descriptions for mxge's msi-x vectors 2010-05-24 13:01:07 +00:00
Andrew Gallatin f9a7f6838c MFC 208312: Correctly identify some twinax cables, which report
a media type of 1
2010-05-24 12:50:55 +00:00
Andrew Gallatin 36fa3d03da MFC 208309: Update mxge firmware to latest available from Myricom. 2010-05-24 12:11:19 +00:00
Doug Barton 55ebf40509 Upgrade to 9.4-ESV-R2, which addresses the following:
Named could return SERVFAIL for negative responses
	from unsigned zones.
2010-05-24 06:41:57 +00:00
Christian Brueffer 3ba8584108 MFC: r207998
Fix grammar in a line of output.
2010-05-23 20:28:06 +00:00
Christian Brueffer ebc8ad5174 MFC: r208054
List /var/cron/tabs in FILES and add descriptions for the other entries.
2010-05-23 20:24:35 +00:00
Christian Brueffer b2e1eb2451 MFC: r208056
Wording fixes.
2010-05-23 20:20:04 +00:00
Christian Brueffer 998939f1eb MFC: r208053
Mention LSI Logic FC949E.
2010-05-23 20:16:18 +00:00
Benedict Reuschling bb2e16d4fc MFC r208273:
Add a sentence to the man page explaining that the -d option
can only be used when ntpd is compiled with DEBUG support.

PR:             docs/138206
Submitted by:   Oliver Pinter (oliver dot pntr at gmail dot com)
Approved by:    roberto
2010-05-23 11:28:04 +00:00
Navdeep Parhar a7de3ba0c9 MFC r208356.
Remove bad assertion.
2010-05-23 09:28:55 +00:00
Stefan Farfeleder 5761ad8eab Merge r193178 and r194897: Tests for the eval command. 2010-05-21 16:32:14 +00:00
Stefan Farfeleder 9ebb597808 Merge r199628 and r199632: Tests for the cd command. 2010-05-21 16:25:16 +00:00
John Baldwin c84bcea689 MFC 208213:
Prevent unloading a kld for a driver that has subinterfaces (vlan interfaces)
from being automatically reloaded via devd shutdown event handlers.
- Revert part of my previous changes to call ifn_stop on subinterfaces
  when an interface is detached.  It is better to destroy the interfaces
  first so that an 'ifconfig foo0.blah down' doesn't result in ifconfig
  auto-loading if_foo.ko.  The ifconfig command will not be invoked if
  foo0.blah is gone when ifn_stop() is called.  Furthermore, it is not
  necessary to explicitly invoke ifn_stop() after the subinterface is
  destroyed as devd will already do that.
- Pass -n to ifconfig when destroying interfaces so that destroying a
  cloned interface does not kldload any drivers.
2010-05-21 16:17:46 +00:00
John Baldwin 82cd7d33d0 MFC 208212:
Ignore failures from removing multicast addresses from the parent (trunk)
interface when tearing down a vlan interface.
2010-05-21 16:07:41 +00:00
Jaakko Heinonen 3128e7828b MFC r197956:
- Catch SIGHUP to perform cleanup before exiting.
- Exit if getch() returns with an error other than EINTR. Otherwise
  systat(1) may get stuck in an infinite loop if it doesn't receive
  SIGHUP when terminal closes.
- Remove attempt to clear stdio error indicators. getch() doesn't use
  stdio, making it useless.
- Remove unneeded masking of getch() return value.

PR:		bin/107171
2010-05-21 16:03:57 +00:00
Kenneth D. Merry 100c61f82e MFC r206844:
Don't clear other flags (e.g. CSUM_TCP) when setting CSUM_TSO.  This was
causing TSO to break for the Xen netfront driver.

Reviewed by:  gibbs, rwatson
2010-05-21 04:48:40 +00:00
Gordon Tetlow 43f75014d0 MFC r207981:
Fix a bug due to a type conversion from 64 to 32 bits. The side effect of
 this type conversion is the high bits which were used to indicate if a
 special character was a literal or special were dropped. As a result, all
 special character were treated as special, even if they were supposed to
 be literals.

Approved by:	mentor (wes@)
2010-05-20 23:06:53 +00:00
Xin LI d12fd16d6f MFC r180407 (peter):
Merge gnu cpio 2.6 -> 2.8 changes.
2010-05-20 19:45:11 +00:00
Marius Strobl fc3a092909 MFC: r208143
Add the ofw_bus_if.h dependency introduced with r207585 (MFC'ed to
stable/7 in r208087).
2010-05-20 08:43:31 +00:00
Xin LI dda77c9696 MFC r207733:
Plug memory leak.
2010-05-20 00:31:51 +00:00
Pyun YongHyeon e2c42d430e MFC r208084:
If controller received bad frames make sure to update newly added
  RFA. Also drop frames that have either CRC error or alignment
  error. Normally bad frames are not received at all. But controllers
  running in promiscuous mode will receive bad frames. 82557 will
  also receive bad frames to receive VLAN oversized frames.

  While I'm here mark RNR condition if driver happen to see RNR in
  RFA status and restart RU to receive frames again. Because driver
  checks all received frames in RX loop, RNR condition could be set
  in the middle of RX processing. Just relying on RNR interrupt was
  not enough.

  This change fixes "Memory modified after free" issue when fxp(4)
  is running as a member of if_bridge(4).

  Tested by:	Larry Baird <lab <> gta dot com>
2010-05-19 21:12:10 +00:00
Pyun YongHyeon b16648b59b MFC r208081,208083:
r208081:
  Controller updates RFA via DMA so driver needs synchronization.
  Add missing BUS_DMASYNC_POSTWRITE and BUS_DMASYNC_PREREAD.

r208083:
  Dont' allow dma map load deferring. fxp(4) is not able to handle
  EINPROGRESS.
2010-05-19 21:02:02 +00:00
John Baldwin 598b7efeee MFC 200637,207335:
- Don't panic due to unlocking an unowned mutex if we fail during attach.
- Initialize the callout structure earlier in attach before calling any
  routines that can fail since ciss_free() always tries to stop and drain
  the callout.
2010-05-19 19:45:17 +00:00
Andriy Gapon 635451d2f6 kern_ntptime: fix two problems with r208298 (MFC of r207360)
This is a direct commit to fix previous improperly done MFC.
- sys/clock.h include is needed for resettodr()
- there is no callout_schedule in 7, so callout_reset has to be used
2010-05-19 15:50:17 +00:00
Andriy Gapon dd24e809b6 MFC r207360: periodically save system time to hardware time-of-day clock 2010-05-19 10:35:53 +00:00
Andriy Gapon d1dd510942 MFC r207359,207362: kern_ntptime: abstract time error check into a
function
2010-05-19 10:29:37 +00:00
Marius Strobl 0341249c62 MFC: r208098
Document the led(4) interface to the identification LEDs.
2010-05-18 17:15:41 +00:00
Marius Strobl 56355c1680 MFC: r208117
Fix a mismerge in r206001 (MFC'ed to stable/7 in r208105).

PR:		146614
Approved by:	jfv (implicit)
2010-05-18 17:09:22 +00:00
Marius Strobl 5b078c04c5 MFC: r205254, r208097
- Add quirk handling for Sun Fire V1280. The firmware of these machines
  provides no ino-bitmap properties so forge them using the default set
  of controller interrupts and let schizo_setup_intr() take care of the
  children, hoping for non-fancy routing.
- Enable DMA write parity error interrupts on Schizo with a working
  implementation.
- Let schizo_pci_bus() only panic in case of fatal errors as the interrupt
  triggered by the error the firmware of Sun Fire V890 as well as 280R
  with version 7 Schizo caused may happen as late as using the HBA and not
  only prior to touching the PCI bus (in the former case the actual error
  still is fatal but we clear it before touching the PCI bus).
  While at it count and export non-fatal error interrupts via sysctl(9).
- Remove unnecessary locking from schizo_ue().
2010-05-18 17:02:35 +00:00
Doug Barton bbcbc7acb2 MFC r208089:
Remove duplicate
2010-05-18 02:23:04 +00:00
Doug Barton bc313c5dba MFC r208088:
Hide the creation and population of the temproot
2010-05-18 02:18:27 +00:00
Pyun YongHyeon 2dac3a02a3 MFC r207971:
Document undocumented tunables and sysctl variables.
  While here use actual string to specify width as well as using Cm
  to set command argument.
2010-05-17 17:18:58 +00:00
Pyun YongHyeon 69fc12389e MFC r207853:
Now sge(4) supports TCP segmentation offload (TSO).
2010-05-17 17:16:49 +00:00
Pyun YongHyeon 06b1d5c78e MFC r207852:
SiS190 supports RX 10 bytes padding, CRC stripping as well as VLAN
  hardware tag insertion/stripping. Remove conditional code that
  disables these hardware features on SiS190. Also nuke RX fixup code
  which is no more required on strict-alignment architectures because
  SiS190 supports RX 10 bytes padding.
  Now all hardware features except jumbo frame and WOL are supported.
  Thanks to Masa Murayama who confirmed SiS190 also has the same
  hardware features of SiS191.
  I guess the only difference between SiS191 and SiS190 would be
  jumbo frame support. It will be implemented in near future.
2010-05-17 17:14:25 +00:00
Pyun YongHyeon cfbddc8ff1 MFC r207851:
Implement TSO and TSO over VLAN. Increase number of allowed
  fragmentation of mbuf chain to 32 from 16 because TSO can send 64KB
  sized packet which in turn requires long list of mbuf chain. Due to
  lack of documentation, I'm not sure whether driver have to pull up
  ethernet/IP/TCP header with options to make controller work but
  driver have to parse TCP header to update pseudo TCP checksum
  anyway. The controller expects pseudo TCP checksum computed by
  upper stack and the checksum should follow the MS NDIS
  specification to make TSO work.

  Tested by:	xclin <xclin <> cs dot nctu dot edu dot tw >
2010-05-17 17:04:09 +00:00
Pyun YongHyeon 4bd8a41b09 MFC r207832:
Export hardware MAC statistics through sysctl node. Previously
  fxp(4) already used to extract most hardware MAC statistics but it
  didn't show them. With this change, all MAC statistics counters
  are exported. Because there are a couple of new counters for 82558
  and 82559, enable extended MAC statistics functionality to get
  these counters. Accoring to public data sheet, 82559 MAC statistics
  return 24 DWORD counters(3 counters are unknown at this moment) so
  increase MAC counter structure to meet the MAC statistics block size.
  The completion of MAC counter dump is now checked against
  FXP_STATS_DR_COMPLETE status code which is appended at the end of
  status block. Previously fxp(4) ignored the status of the
  FXP_SCB_COMMAND_CU_DUMPRESET command. fxp(4) does not wait for the
  completion of pending command before issuing
  FXP_SCB_COMMAND_CU_DUMPRESET. Instead it skips the command and try
  it next time. This scheme may show better performance but there is
  chance to loose updated counters after stopping controller. So make
  sure to update MAC statistics in fxp_stop().
  While I'm here move sysctl node creation to fxp_sysctl_node().

  Tested by:	Larry Baird < lab <> gta dot com >
2010-05-17 16:59:36 +00:00
Pyun YongHyeon a574eeb49a MFC r207750:
8255x configure command requires number of bytes of configuration
  table. The default size of the configuration table was 22 bytes. To
  use extended feature of 82550/82551 the configuration table size
  was expanded to 32 bytes. The added configuration for 82550/82551
  specifies VLAN hardware tagging and IPSec configuration as well as
  TCO.
  To make configuration easier fxp(4) used a configuration template
  and the template was copied to configuration table. After that,
  some parameters of the configuration table was changed depending on
  controller type and operation mode. However the size of template
  was 22 bytes so some configuration parameters were not properly
  initialized on 82550/82551.
  Fix this by increasing the template size. For 82557, 82558 and
  82559 the size of the configuration is still 22 bytes.
2010-05-17 16:54:31 +00:00
Konstantin Belousov 8383881bb2 Partial MFC r207847:
For detach procfs ctl command, clear P_STOPPED_TRACE process stop flag.
2010-05-17 08:46:27 +00:00
Konstantin Belousov 5ea2f5cfb9 MFC r207848:
The thread_unsuspend() requires both process mutex and process spinlock
locked. Postpone the process unlock till the thread_unsuspend() is called.
2010-05-17 08:35:14 +00:00
Jack F Vogel c21b247328 Change lem_poll to match em 2010-05-17 02:20:24 +00:00
Jaakko Heinonen 4e5dc88a89 MFC r203157, r203816:
Handle short reads when the -P option is used and remove some dead code.

PR:		bin/121502
2010-05-16 16:33:38 +00:00
Jilles Tjoelker c017559987 MFC r207817: builtin(1): sh has no @ builtin command. 2010-05-16 11:17:21 +00:00
Jilles Tjoelker b191a114b2 MFC r207816: Document clock and pshared condvar attributes.
Note: clock accepts CLOCK_VIRTUAL and CLOCK_PROF too, but this seems broken
as it simply waits for the difference of the current and given value of the
clock as if it were CLOCK_MONOTONIC. So document only CLOCK_REALTIME and
CLOCK_MONOTONIC as allowed.
2010-05-16 11:14:11 +00:00
Stefan Farfeleder c5c1a8e256 Merge r193169: Fix the eval command in combination with set -e. 2010-05-16 10:23:33 +00:00
Stefan Farfeleder e695f08e9e Merge r190698: Don't let trailing empty lines overwrite the result of the last
command with 0.
2010-05-16 10:20:54 +00:00
Stefan Farfeleder b7b2af1e5c Merge r199631: Handle current work directories of arbitrary length. 2010-05-16 09:59:28 +00:00
Jack F Vogel d575fde0f3 Change poll routine to conform to proper interface. 2010-05-16 04:31:16 +00:00
Jack F Vogel c515f0a9d9 Add missing lem files to the MFC 2010-05-15 07:01:41 +00:00
Jack F Vogel c848c9468f MFC the new em/lem/igb drivers for stable/7 2010-05-14 22:39:51 +00:00
Doug Barton 50591e4787 MFC 208060:
Remove trailing white space. No functional changes.

Hand-delete trailing ws from rc.firewall while I'm here.
2010-05-14 19:36:11 +00:00
Marius Strobl a3ca5bae5a MFC: r207885
Include <machine/ofw_machdep.h> for OF_getscsinitid().
2010-05-14 19:18:06 +00:00
Marius Strobl af316c71a6 MFC: r207586
Sun GigaSwift Ethernet 1.0 MMF work with r207585 (MFC'ed to stable/7 in
r208087) in place.
2010-05-14 19:15:55 +00:00
Marius Strobl a1dbdb7d22 MFC: r207585
- Don't set CAS_PCS_DATAPATH to anything except CAS_PCS_DATAPATH_SERDES
  on Cassini using the external PCS SERDES otherwise unaligned access
  traps and other strange effects happen with some machines. Don't touch
  the MIF which is unused in that case either. These changes require the
  PHY type to use to be determined via the OFW device tree or from the
  VPD in machines without the former.
- Disable the SERDES pins of Saturn when not used in order to save power
  and ensure they are enabled otherwise.
- In cas_attach() use the correct register offset for CAS_PCS_CONF_EN.
- Add some bus space barriers missing in the PCS code path.

These changes make the Sun GigaSwift Ethernet 1.0 MMF cards as well as
the on-board interfaces found in Sun Fire B100s Blade Server work.

PR:	144867
2010-05-14 19:12:01 +00:00
Fabien Thomas 4905403074 MFC r207755:
Rework the calltree top view by critical callchain.
The percentage shown is the sum of the cost for the codepath.
2010-05-14 13:43:23 +00:00
Martin Matuska 930eaf5fcd MFC r207910:
(cddl/contrib/opensolaris part)

Fix possible panic with zfs destroy.
OpenSolaris onnv revision:	8779:f164e0e90508

PR:		kern/146471
Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6784924)
2010-05-14 10:06:20 +00:00
Martin Matuska 353903283d MFC r207909, r207910, r207911:
MFC r207909:
Fix zfs rename (may occasionally fail with dataset busy).
OpenSolaris onnv revision:	8517:41a0783dde17

MFC r207910:
Fix possible panic with zfs destroy.
OpenSolaris onnv revision:	8779:f164e0e90508

MFC r207911:
Fix failed assertion on destroying datasets from an older pool version.
OpenSolaris onnv revision:	9390:887948510f80

PR:		kern/146471
Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6784757, 6784924, 6826861)
2010-05-14 10:04:11 +00:00
Martin Matuska ae2dcd390a MFC r207908:
Fix endianess bug in ZFS intent log (ZIL).

OpenSolaris onnv revision:	8109:6147a1bdd359

Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6760048)
2010-05-14 09:09:08 +00:00
Martin Matuska 9f1f7d6ff5 MFC r207427:
Fix improper pool write throughput calculation.

OpenSolaris onnv revision:      9366:17553395a745

PR:		kern/146108
Obtained from:	OpenSolaris (Bug ID 6817339)
Approved by:	pjd, delphij (mentor)
2010-05-14 09:02:31 +00:00
Martin Matuska b5d042dcaa MFC r207480:
Change description of tunable group vfs.zfs.txg to be more
understandable.

Approved by:	pjd, delphij (mentor)
2010-05-14 08:56:07 +00:00
Jilles Tjoelker 407aaa2bb1 MFC r207449: telnet: Fix infinite loop if local output generates SIGPIPE.
Instead of catching SIGPIPE and jumping out of the signal handler with
longjmp, ignore it and handle write errors to the local output by exiting
from there. I have changed the error message to mention the local output
instead of NetBSD's wrong "Connection closed by foreign host". Write errors
to the network were already handled by exiting immediately and this now
applies to EPIPE too.

The code assumed that SIGPIPE could only be generated by the network
connection; if it was generated by the local output, it would longjmp out of
the signal handler and write an error message which caused another SIGPIPE.

PR:		19773
Obtained from:	NetBSD
2010-05-13 15:28:34 +00:00
Pyun YongHyeon 3c7ccd67d4 MFC r207763:
Don't change PCIe maximum read request size to 2048 on RTL810x
  controllers. It caused device timeouts.

  Reported by:	McLone < mclone <> gmail dot com >
  Tested by:	McLone < mclone <> gmail dot com >
2010-05-12 17:34:51 +00:00
Pyun YongHyeon 8c285f14dc MFC r207748:
It seems controller has two types of promiscuous control, one for
  unicast and the other for multicast. To receive multicast frames
  that host didn't join in promiscuous mode, driver have to set
  promiscuous mode for multicast frames as well.
  The Open Source Software Developer Manual for i8255x was not clear
  how to handle promiscuous mode.

  PR:		kern/145905
2010-05-12 17:12:47 +00:00
Xin LI c7041a30ee MFC r205622:
Expose MACHINE_CPU while building lib32 target.
2010-05-11 19:26:17 +00:00
Martin Matuska 6e7a0629e1 MFC r207624:
Fix deadlock during zfs receive.

OpenSolaris onnv revision:	9299:8809e849f63e

PR:		kern/146296
Approved by:	pjd, delphij (mentor)
Obtained from:	OpenSolaris (Bug ID 6783818, 6826836)
2010-05-11 07:07:44 +00:00
Edwin Groothuis 25d1f60f47 MFC of 207898, tzdata2010j:
- Bahia de Banderas (Mexican state of Nayarit) changed time zone
  UTC-7 to new time zone UTC-6 on April 4, 2010 (to share the same
  time zone as nearby city Puerto Vallarta, Jalisco).
2010-05-10 21:04:40 +00:00
Marius Strobl 797ae9f5c5 MFC: r207683
- Fix broken symlinks on cross platform zfs send/recv. [1]
- Enable zfs_ace_byteswap() on FreeBSD as it works just fine (tested between
  amd64 and sparc64 in both directions by Michael Moll).

PR:		146272
Approved by:	mm, pjd
Obtained from:	OpenSolaris (onnv rev. 8283:1ca59f393041; Bug ID 6764193) [1]
2010-05-10 20:55:24 +00:00
Marius Strobl b87310cce4 MFC: r207570
On sparc64 obtain the initiator ID from the Open Firmware device tree
in order to match what the PROM built-in driver uses.
2010-05-10 20:34:19 +00:00
Marius Strobl c12fe46f30 MFC: r207537
Add support for SPARC64 V (and where it already makes sense for other
HAL/Fujitsu) CPUs. For the most part this consists of fleshing out the
MMU and cache handling, it doesn't add pmap optimizations possible with
these CPU, yet, though.
With these changes FreeBSD runs stable on Fujitsu Siemens PRIMEPOWER 250
and likely also other models based on SPARC64 V like 450, 650 and 850.
Thanks go to Michael Moll for providing access to a PRIMEPOWER 250.
2010-05-10 20:25:51 +00:00
Marius Strobl 18e3c7b534 MFC: r207533 (partial)
Remove redundant checking of sc_leaving (uart_intr() already handles this).
2010-05-10 20:15:40 +00:00
Pyun YongHyeon b49ccdd29d MFC r207622-207623,207638
r207622:
  Drop driver lock before exiting from interrupt handler.

r207623:
  Make sure to check whether driver is running before processing
  received frames. Also check driver has valid ifp pointer before
  calling msk_stop() in device_shutdown handler. While I'm here
  remove unnecessary accesses to interrupt mask registers in
  device_shutdown handler because driver puts the controller into
  reset state.
  With these changes, msk(4) now survive from heavy RX traffic(1byte
  UDP frame) while reboot is in progress.

r207638:
  When VLAN hardware tagging is disabled, make sure to disable VLAN
  checksum offloading as well as TSO over VLAN.
2010-05-10 20:08:01 +00:00
Marius Strobl c8e146cc22 Partial MFC 186347 and 186355 in order to remove differences in headers
required.
2010-05-10 20:00:50 +00:00
Pyun YongHyeon 578bf98b27 MFC r207628,207635:
r207628:
  Enable multi-descriptor transmisstion for fragmented mbufs. There
  is no more need to defragment mbufs. After transmitting the
  multi-fragmented frame, the controller updates only the first
  descriptor of multi-descriptor transmission so it's driver's
  responsibility to clear OWN bits of remaining descriptor of
  multi-descriptor transmission. It seems the controller behaves much
  like jme(4) controllers in descriptor handling.

r207635:
  Free entire mbuf chain instead of the first mbuf.
2010-05-10 19:54:01 +00:00
Jung-uk Kim c677e9d8b2 MFC: r207330, r207620
- Remove dead code.  Calculated greatest common divisor was not used at all.
- Prefer u_int32_t over unsigned int to make its intention more clearer.
- Move the function to a header file and make it a static inline function.
2010-05-10 19:22:34 +00:00
Marius Strobl 42c01297f2 MFC: r207500
Add a hack for SPARC64 V CPUs, which set some undocumented bits in the
first data word.
2010-05-10 19:02:22 +00:00
Marius Strobl 0285cc06f1 MFC: r207287
On sparc64 obtain the initiator ID to be used for SPI HBAs from the
Open Firmware device tree in order to match what the PROM built-in
driver uses. This is especially important when netbooting Fujitsu
Siemens PRIMEPOWER250 as in that case the built-in driver isn't used
and the port facts PortSCSIID defaults to 0, conflicting with the
disk at the same address.
2010-05-10 18:56:40 +00:00
Marius Strobl 32e119586a MFC: r207286
Replace a magic value with the appropriate macro.
2010-05-10 18:54:59 +00:00
Marius Strobl 056377ee7f MFC: r207285
- On sparc64 obtain the initiator ID from the Open Firmware device tree
  in order to match what the PROM built-in driver uses.
- Remove some no longer used includes.
2010-05-10 18:53:44 +00:00
Marius Strobl 6fe175a340 MFC: r207281
Take advantage of OF_getscsinitid().
2010-05-10 18:52:00 +00:00
Marius Strobl 14f45a979d MFC: r207248
Don't bother enabling interrupts before we're ready to handle them. This
prevents the firmware of Fujitsu Siemens PRIMEPOWER250, which both causes
stray interrupts and erroneously enables interrupts at least when calling
SUNW,set-trap-table, from shooting itself in the foot.
2010-05-10 18:50:28 +00:00
Marius Strobl fca76de477 MFC: r207243
Add OF_getscsinitid(), a helper similar to OF_getetheraddr() but for
obtaining the initiator ID to be used for SPI controllers from the
Open Firmware device tree.
2010-05-10 18:47:54 +00:00
Marius Strobl cdaa54b193 MFC: r207242
For the on-board interfaces found in Fujitsu SPARC64 machines obtain the
MAC address via OFW as well.
2010-05-10 18:46:37 +00:00
Marius Strobl a3e9e18dfb MFC: r207241
- Add a missing const.
- Map the NS16550 found in Fujitsu Siemens PRIMEPOWER250 to PNP0501 as well.
2010-05-10 18:45:20 +00:00
Marius Strobl 2493b1e8f0 MFC: r207240
Skip the pseudo-devices found in Fujitsu Siemens PRIMEPOWER250.
2010-05-10 18:43:44 +00:00
Pyun YongHyeon a26d93413d MFC r207545,207625:
r207545:
  Fix wrong dma tag usage. Previously it used TX descriptor ring dma
  tag which should be TX mbuf dma tag.

r207625:
  Remove clearing RxHashTable2 register. The register is reprogrammed
  in sge_rxfilter().
2010-05-10 18:40:37 +00:00
Xin LI 1ed81e350f MFC most of the recent changes to gzip(1) back to RELENG_7. 2010-05-10 02:09:53 +00:00
Ed Maste 8c6a30ffe3 MFC r207590:
Update GRANDPARENTED text to match the contents of tzdata/factory r19879.
  This eliminates "warning: time zone abbreviation differs from POSIX" on
  installworld.
2010-05-10 01:23:31 +00:00
Fabien Thomas f443834e81 MFC r207731:
Exclude undefined symbol from ELF file when doing function resolve.
2010-05-09 15:41:27 +00:00
Doug Barton f8ae501311 rc_quiet does not exist in RELENG_7, so hand-merge the part of r179870
that I did not think was applicable here (namely bailing out of
run_rc_command before printing the warning) but use rc_fast as the
trigger instead of rc_quiet. The former exists in all supported branches,
and is set at boot time so it does the job.

The only remaining element that isn't already covered by 'faststart' is
an instance of '/etc/rc.d/ipfilter resync' in rc.d/netif, so make that
fastresync to also silence the warning there. This is similar to what
was done in r175676, although that used quietresync (as described above).

Pointed out by:	jhell <[email protected]>
2010-05-09 08:22:33 +00:00
Doug Barton 4ddd483630 MFC 207346:
Fix named-checkconf in the situation where named_chroot_autoupdate
is NOT set, but named_chrootdir IS set.

Remove required_files for named.conf, named-checkconf is enough.
2010-05-08 22:24:31 +00:00
Doug Barton 3d330d125d MFC r206686:
Make 'stop' work even if ${name}_enable is not set.
2010-05-08 22:15:05 +00:00
Doug Barton 9d244fb21f MFC r179870:
Move the check for enabled knobs further down in run_rc_command() so
that bogus commands cause usage information to be printed instead of
diagnostics about enabling the knob.

This is a prerequisite for merging r206686.
2010-05-08 22:13:48 +00:00
Giorgos Keramidas cc0cb22a4c MFC r196254 iostat: add a bit of space between tty in/out columns
The columns for tty input and output may bump against each other
if the tty output needs more than 5 columns.  Add a bit of space
that pushes everything 1 column to the right, but also avoids the
problem.

Approved by:    rwatson
2010-05-08 20:02:39 +00:00
Warner Losh 680fd7068e MFC 185023 (by raj):
Initial gdbserver support for ARM.
  Obtained from:  Juniper Networks, Semihalf
2010-05-08 13:23:57 +00:00
Konstantin Belousov 940796fc94 MFC r207606:
Fix typo in comment.
2010-05-07 11:17:20 +00:00
Pyun YongHyeon 5e1b061cfe MFC r207447:
Marvell 88E8059(Yukon Optima) is now supported.
2010-05-06 18:53:43 +00:00
Pyun YongHyeon 6567bc2faf MFC r207446:
Add Marvell PHYG65G Gigabit PHY which is found on 88E8059 Yukon Optima.

  Tested by:	James LaLagna < jameslalagna <> gmail dot com >
2010-05-06 18:51:47 +00:00
Pyun YongHyeon d63eec4e07 MFC r207445:
Add basic support for Marvell 88E8059 Yukon Optima.

  Tested by:	James LaLagna < jameslalagna <> gmail dot com >
2010-05-06 18:48:44 +00:00
Pyun YongHyeon 6b9ab9ee2a MFC r207409,207442:
r207409:
  Both RX_GMF_LP_THR and RX_GMF_UP_THR must be 16 bits register. If
  it is 8bits register then RX FIFO size can't exceed 2KB which is
  not true for almost all Yukon II controller.

r207442:
  Disable non-ASF packet flushing on Yukon Extreme as vendor's driver
  does. Without this change, Yukon Extreme seems to generate lots of
  RX FIFO overruns even though controller has available RX buffers.
  These excessive RX FIFO overruns generated lots of pause frames
  which in turn killed devices plugged into switch. It seems there is
  still occasional RX frame corruption on Yukon Extreme but this
  change seems to fix the pause frame storm.

  Reported by:	jhb
  Tested by:	jhb
2010-05-06 18:44:49 +00:00
Pyun YongHyeon d2e0dcf090 MFC r207381:
Now sge(4) supports hardware VLAN tag insertion/stripping.
2010-05-06 18:38:19 +00:00
Pyun YongHyeon 115912c87a MFC r207380:
Enable VLAN hardware tag insertion/stripping. Due to lack of SiS190
  controller, I'm not sure whether this is also applicable to SiS190
  so this feature is only activated on SiS191 controller.
  In theory, controller reinitialization is not needed when VLAN tag
  configuration is changed, but xclin said controller was not stable
  whenever toggling VLAN tag bit. To address that, sge(4)
  reinitialize controller for VLAN configuration which seems to work
  as expected. VLAN tag information for TX/RX descriptor and
  configure bit of RxMacControl register was found by xclin.

  Submitted by:	xclin <xclin <> cs dot nctu dot edu dot tw > (initial version)
  Tested by:	xclin <xclin <> cs dot nctu dot edu dot tw >
2010-05-06 18:35:53 +00:00
Pyun YongHyeon b7494d7722 MFC r207379:
Enable FCS stripping and padding 10 bytes bit of RX MAC control
  register. Due to lack of SiS190 controller, I'm not sure whether
  this is also applicable to SiS190 so this feature is only activated
  on SiS191 controller.
  The controller can pad 10 bytes before DMAing a received frame to
  RX buffer and received bytes include the padded bytes. This padding
  is very useful on strict-alignment architectures because driver
  does not have to copy received frame to align IP header on 4 bytes
  boundary. It also gives better RX performance on non-strict
  alignment architectures. Special thanks to xclin to give me
  valuable register information. Without his enthusiastic trial and
  errors this wouldn't be even possible.

  While I'm here tighten validity check of received frame. Controller
  clears RDS_CRCOK bit when it received bad CRC frames. xclin found
  that using loop back testing.

  Tested by:	xclin <xclin <> cs dot nctu dot edu dot tw >
2010-05-06 18:32:02 +00:00
Pyun YongHyeon 3025db336e MFC r207375-207377.
r207375:
  Preserve unknown bits of RX MAC control register when driver
  programs RX filter configuration. It seems RX MAC control register
  is one of key registers to get various offloading features as well
  as performance. Blindly clearing unrelated bits can result in
  unexpected results.

  Tested by:    xclin <xclin <> cs dot nctu dot edu dot tw >

r207376:
  Remove wrong link state chage.

r207377:
  Explicitly marks SiS190 to differentiate it from SiS191.
2010-05-06 18:26:43 +00:00
Gavin Atkinson 2408c22dc2 Merge r202161 from head:
Spell "Hz" correctly wherever it is user-visible.

PR:		bin/142566
Submitted by:	N.J. Mann   njm njm.me.uk
2010-05-06 12:37:01 +00:00
Jilles Tjoelker 618e44f76d MFC r206760: getcwd(3): Clarify that EACCES may or may not be checked.
POSIX permits but does not require checking access on the current and parent
directories.

Because various programs do not like it if getcwd(3) fails, it seems best
to avoid checking access as much as possible. There are various reports in
GNATS about this (search for getcwd).

Our getcwd(3) implementation first queries the kernel for the pathname
directly, which does not check any permissions but sometimes fails, and then
falls back to reading all parent directories for the names.

PR:		standards/44425
2010-05-05 22:19:52 +00:00
Jilles Tjoelker 17583a2d82 MFC r207186: sysctl(3): Update description of various kern.* variables.
Also add xrefs for confstr(3) (as sysconf(3) but for strings) and kvm(3)
(which is a more convenient way to access some of the variables).

PR:		116480
2010-05-05 22:07:28 +00:00
Gavin Atkinson be24891f69 Fix merge botch.
Submitted by:	Sofian Brabez <sbrabez gmail.com>
Pointy hat:	Earned and deserved.
2010-05-05 20:54:16 +00:00
Gavin Atkinson ee2f97da4c Spell "Hz" correctly in arlcontrol.
Direct commit to stable/7 as this code no longer exists in head.

PR:		bin/142566
Submitted by:	N.J. Mann  <njm njm.me.uk>
2010-05-05 17:17:19 +00:00
Ken Smith 6811b3eb35 Merge r206423:
> Shift the version of perl used by the release build process over to
> perl-5.10.  This aligns the release build process with the current
> default version of perl in the ports tree.
2010-05-05 17:01:03 +00:00
Ken Smith 16f9aa8798 Merge r206422:
> Pass the HTTP_PROXY and FTP_PROXY environment variables through in addition
> to FTP_PASSIVE_MODE so release building works for a machine that needs
> to use a proxy.

PR:           misc/137688
Submitted by: Michael Leun
2010-05-05 16:41:14 +00:00
Gavin Atkinson 30825f3199 Merge r203310,203547,203717 from head:
Implement the "-i" option to sysctl(8), to ignore failures while
  retrieving individual OIDs.  This allows the same list of OIDs to be
  passed to sysctl(8) across different systems where particular OIDs may
  not exist, and still get as much information as possible from them.

PR:		bin/123644
Submitted by:	dhw
2010-05-05 12:48:30 +00:00
Dmitry Morozovsky efdf96ea82 MFC r207068:
Allow to modify directory's content even if the ZFS_NOUNLINK (SF_NOUNLINK,
  sunlnk) flag is set. We only deny dirctory's removal or rename.

  PR:           kern/143343
  Approved by:	pjd
2010-05-05 09:01:15 +00:00
Xin LI 7d3cd92b2f MFC r206973:
When CPUTYPE is defined to any value, on amd64 platform "mmx" is
available through MACHINE_CPU, indicating the CPU supports that
feature, as done by revision 138685.

This changeset adds "mmx" into the default amd64 MACHINE_CPU list
when no CPUTYPE is specified to provide consistent behavior.

PR:		amd64/145593
Submitted by:	mm
2010-05-05 00:39:06 +00:00
Jilles Tjoelker 9adee652c9 MFC r207153: stat: Allow -f %Sf to display the file flags symbolically.
PR:		124349
2010-05-04 21:56:16 +00:00
John Baldwin 3825be9635 MFC: 202767,202774
Add a timeout for the negative name cache entries in the NFS client.
This avoids a bogus negative name cache entry from persisting forever
when another client creates an entry with the same name within the
same NFS server time of day clock tick.  Unlike 8.x and later, the
timeout is only adjustable via a system-wide sysctl
(vfs.nfs.negative_name_timeout) rather than a mount option.  Setting
the timeout to 0 disables negative name caching.

I also fixed one obvious typo where args.timeo should be
args.maxgrouplist.
2010-05-04 21:21:05 +00:00
Brooks Davis 49fe672a98 MFC r205073
Regen:
* Hart:         rev 671 of pcidevs.txt; 22-01-2008 (D-M-Y).
* Boemler:      vendors.txt (2010-03126)

PR:             kern/133733
2010-05-04 15:52:17 +00:00
Warner Losh 4634deb157 MFC r207461:
sparc64, and possibly other architectures, pads the length of the
  section holding the config file to sh_addralign bytes using NULs.
  This bogusly triggers an assert.  Break out of the loop when we hit a
  NUL within that many bytes of the end.
2010-05-04 04:04:37 +00:00
Warner Losh c6942b5d58 MFC r188214 (by wkoszek):
Make config -x <kernel> only return non-zero characters,
   so that:
        config -x <kernel> | grep <something>
   just works.

   Reported by:    Danny Braniss <[email protected]>
2010-05-04 04:02:43 +00:00
Xin LI 50c0772971 MFC r202668 and r200806 [1]:
Add a new option, -P, which reverts newsyslog(8) to the old behavior,
which stops to proceed further, as it is possible that processes which
fails to create PID file get screwed by rotation.

----
Don't consider non-existence of a PID file an error, we should be able
to proceed anyway as this most likely mean that the process has been
terminated.

PR:             bin/140397
Submitted by:   Dan Lukes <dan obluda cz>
2010-05-03 22:09:06 +00:00
Xin LI 6d53df9030 MFC r196432 (partial, kensmith@) and 207383:
Add definition for FreeBSD 8.1 and 9.0.
2010-05-03 17:34:12 +00:00
Konstantin Belousov 6d6bdbdd96 MFC r203822:
Remove unused macros.
2010-05-03 12:06:40 +00:00
Pyun YongHyeon 9273a8701c MFC r207251:
It seems ale(4) controllers do not like to see TCP payload in the
  first descriptor in TSO case. Otherwise controller can generate bad
  frames during TSO. To address it, make sure to pull up ethernet +
  IP + TCP header with options in first buffer. Also ensure the
  buffer length of the first descriptor for TSO covers entire ethernet
  + IP + TCP with options and setup additional Tx descriptor if the
  first buffer includes TCP payload.

  Tested by:	Amar Takhar <verm <> darkbeer dot org >
2010-05-03 01:13:37 +00:00
Jilles Tjoelker 5322613a28 MFC r205398: Do not create *.gmon files for PIE executables on i386.
Scrt1_c.o was accidentally compiled with -DGCRT (profiling), like gcrt1_c.o.
This problem is i386-specific, the other architectures are OK.

If you have problems with PIE executables such as samba and cups leaving
behind gmon files, rebuild them after installing this change.

PR:		ports/143924
2010-05-02 20:12:20 +00:00
Marius Strobl f89f56f063 MFC: r207151
Add a TestFloat based test suite for floating-point implementations
currently supporting sparc64. After a `make depend all` there are
three programs; testsoftfloat for testing against the SoftFloat in
src/lib/libc/softfloat for reference purposes, testemufloat for
testing the emulator source in src/lib/libc/sparc64/fpu and testfloat
for testing with the installed libc. Support for other architectures
can be added as needed.

PR:		144900
Submitted by:	Peter Jeremy
2010-05-02 16:55:13 +00:00
Marius Strobl bf1a25bb18 MFC: r206490, r206492
While SPARC V9 allows tininess to be detected either before or after
rounding (impl. dep. #55), the SPARC JPS1 responsible for SPARC64 and
UltraSPARC processors defines that in all cases tininess is detected
before rounding therefore rounding up to the smallest normalized number
should set the underflow flag. This change is needed for using SoftFloat
on sparc64 for reference purposes.

PR:		144900
Submitted by:	Peter Jeremy
2010-05-02 16:52:24 +00:00
Marius Strobl 0a6030d52c MFC: r206480
Update for UltraSPARC-IV{,+} and SPARC64 V, VI, VII and VIIIfx CPUs.
2010-05-02 16:47:54 +00:00
Marius Strobl d0d9f03625 MFC: r206450
Correct the DCR_IPE macro to refer to the right bit. Also improve the
associated comment as besides US-IV+ these bits are only available with
US-III++, i.e. the 1.2GHz version of the US-III+.
2010-05-02 16:46:22 +00:00
Marius Strobl 8e905b8d0b MFC: r206449
Unlike the sun4v variant, the sun4u version of SUNW,set-trap-table
actually only takes one argument.
2010-05-02 16:45:09 +00:00
Marius Strobl 637ebf4a60 MFC: r206448
Do as the comment suggests and determine the bus space based on the last
bus we actually mapped at rather than always based on the last bus we
encountered while moving upward in the tree. Otherwise we might use the
wrong bus space in case the bridge directly underneath the nexus doesn't
require mapping, i.e. was skipped as it's the case for ssm(4) nodes.
2010-05-02 16:38:57 +00:00
Jilles Tjoelker 526e392ad5 MFC r207187: kvm(3): Mention that some of the functions use sysctl(3)
instead of kmem.

Additionally, because of sysctl(3) use (which is generally good), behaviour
for crash dumps differs slightly from behaviour for live kernels and this
will probably never be fixed entirely, so weaken that claim.
2010-05-02 13:53:08 +00:00
Jilles Tjoelker 76653bc8c3 MFC r207188: symlink(7): The ownership of symlinks is used by the system,
in at least three ways, so do not say it is ignored:
* who may delete/rename a symlink in a sticky directory
* who may do lchflags(2)/lchown(2)/lchmod(2)
* whose inode quota is charged
2010-05-02 13:38:08 +00:00
Jilles Tjoelker d25fead31f MFC r207168: builtin(1): Add missing escaping for !, . and : in the table.
This caused these commands to look differently (not bold) from the other
commands in the table (bold).
2010-05-01 15:00:00 +00:00
Jilles Tjoelker 61c5e6df82 MFC r207166: builtin(1): Mention [ sh builtin. 2010-05-01 14:57:35 +00:00
Matt Jacob 1e0ea34839 This is an MFC of 205932.
nit: xpt_bus_deregister has to be called with the sim lock held.
2010-04-29 19:13:42 +00:00
Matt Jacob 0d2513fd29 This is an MFC of 205847
Change how multipath labels are created and managed. This makes it easier
to support various storage boxes which really aren't active-active.

We only write the label on the *first* provider. For all other providers
we just "add" the disk. This also allows for an "add" verb.

A usage implication is that you should specificy the currently active
storage path as the first provider.

Note that this does not add RDAC-like functionality, but better allows for
autovolumefailover configurations (additional checkins elsewhere will support
this).
2010-04-29 19:07:58 +00:00
Xin LI ac80d74c7d MFC r205938:
Sync with OpenBSD:
 - avoid coredump when there's only one token on a line;
 - Use calloc();
 - Remove a line inherited from example mdoc.

Obtained from:	OpenBSD
2010-04-29 00:38:15 +00:00
Ed Maste 4ae82e0347 MFC r175406:
Eliminate warnings by adding headers.
2010-04-28 13:26:30 +00:00
Andrew Gallatin 4f679efba2 MFC 206662: Cleanup if_media handling in mxge(4) 2010-04-27 15:40:24 +00:00
Nick Hibma ad4f3b4265 Typo in comment. 2010-04-27 12:50:42 +00:00
Pyun YongHyeon cf5a46a5ca MFC r207071:
Intialize interrupt moderation control register. The magic value
  was chosen by lots of trial and errors. The chosen value shows
  good interrupt moderation without additional latency.
  Without this change, controller can generate more than 140k
  interrupts per second under high network load.

  Submitted by:	xclin <xclin <> cs dot nctu dot edu dot tw >
2010-04-26 18:09:12 +00:00
Pyun YongHyeon 1f4a36fb6c MFC r206876:
With r206844, CSUM_TCP is also set for CSUM_TSO case. Modify
  drivers to take into account for the change. Basically CSUM_TSO
  should be checked before checking CSUM_TCP.
2010-04-26 18:04:33 +00:00
Pyun YongHyeon 1381f93171 MFC r206672:
Fix include path.
2010-04-26 17:57:08 +00:00
Pyun YongHyeon 152109df40 MFC r206631:
Add sge(4) man page and hook up sge(4) to the build.
  Also add Xr to appropriate man pages.
2010-04-26 17:43:46 +00:00
Pyun YongHyeon 724206e965 MFC r206628:
Add sge(4) to the list of supported network interface.
2010-04-26 17:28:12 +00:00
Pyun YongHyeon 3621f25f39 MFC r206625:
Add driver for Silicon Integrated Systems SiS190/191 Fast/Gigabit Ethernet.
  This driver was written by Alexander Pohoyda and greatly enhanced
  by Nikolay Denev. I don't have these hardwares but this driver was
  tested by Nikolay Denev and xclin.

  Because SiS didn't release data sheet for this controller, programming
  information came from Linux driver and OpenSolaris. Unlike other open
  source driver for SiS190/191, sge(4) takes full advantage of TX/RX
  checksum offloading and does not require additional copy operation in
  RX handler.
  The controller seems to have advanced offloading features like VLAN
  hardware tag insertion/stripping, TCP segmentation offload(TSO) as
  well as jumbo frame support but these features are not available
  yet. Special thanks to xclin <xclin<> cs dot nctu dot edu dot tw>
  who sent fix for receiving VLAN oversized frames.
2010-04-26 17:22:02 +00:00
Nick Hibma 868f653f83 Remove the call to usbd_reset_device() as this panics the kernel on
devices with many serial ports (the device is reset for each port that
reports IOERROR).
Remove statements that should have been removed when rewriting the if
statement.
2010-04-25 19:22:06 +00:00
Warner Losh 62a7b516f6 Merge the ARM module building stuff from current (not done as a merge on
the makefile becuase there's too many conflicts).
2010-04-25 19:18:26 +00:00
Fabien Thomas e258dd0d9b MFC r206994:
Apply threshold filter to root node in calltree view.
2010-04-25 16:17:52 +00:00
Matt Jacob cb733994f6 This is an MFC of 205252.
We actually can generate a host number.
2010-04-24 23:13:05 +00:00
Matt Jacob d0aa30d02a This is an MFC of 205236
Put gone device timer into a structure tag that can hold more than 32 seconds. Oops.

Untangle some of the confusion about what role means when it's in the FCPARAM/SDPARAM
or isp_fc/isp_spi structures. This fixed a problem about seeing targets appear if you've
turned off autologin and find them, or rather don't, via camcontrol rescan.
2010-04-24 23:07:34 +00:00
Matt Jacob 149464bc45 This is an MFC of 205847, 204071, 196580 and 196579
------------------------------------------------------------------------
Change how multipath labels are created and managed. This makes it easier
to support various storage boxes which really aren't active-active.

We only write the label on the *first* provider. For all other providers
we just "add" the disk. This also allows for an "add" verb.

A usage implication is that you should specificy the currently active
storage path as the first provider.

Note that this does not add RDAC-like functionality, but better allows for
autovolumefailover configurations (additional checkins elsewhere will support
this).
------------------------------------------------------------------------

- Style fixes.
- Prefer strlcpy() over strncpy().

------------------------------------------------------------------------

There's no need for checking result of M_WAITOK allocation.

------------------------------------------------------------------------

Fix an obvious topology lock leak.
2010-04-23 19:35:07 +00:00
Matt Jacob a143933a1e This is an MFC of 205412.
Add 'rotate' and 'getactive' verbs to provide some control and information
about what the currently active path is.
2010-04-23 16:28:06 +00:00
Matt Jacob adab122503 This is an MFC of 205412.
Add 'rotate' and 'getactive' verbs to provide some control and information
about what the currently active path is.
2010-04-23 16:21:40 +00:00
Andriy Gapon 2e38150727 MFC r206996: indent.pro example: actually install the sample file 2010-04-23 15:51:13 +00:00
Andriy Gapon 6f061eda45 MFC r206687: indent(1): don't treat bare '_t' as a type name with -ta 2010-04-23 14:35:03 +00:00
Jaakko Heinonen 50ccb1e581 MFC r205385:
Escape characters unsafe for XML output in GEOM class, instance and
provider names.

- Characters in range 0x01-0x1f except '\t', '\n', and '\r' are replaced
  with '?'. Those characters are disallowed in XML.
- '&', '<', '>', '\'', '"' and characters in range 0x7f-0xff are
  replaced with XML numeric character reference.

If the kern.geom.confxml sysctl provides invalid XML, libgeom
geom_xml2tree() fails and utilities using it do not work. Unsafe
characters are common in msdosfs and cd9660 labels.

PR:		kern/104389
2010-04-22 14:54:54 +00:00
Andriy Gapon e06d699775 MFC r206650: g_io_check: respond to zero pp->mediasize with ENXIO 2010-04-22 12:50:01 +00:00
Andriy Gapon 1f30ceb25a MFC r206648,206651: scsi_cd: CD_FLAG_VALID_MEDIA is sufficient to set
d_sectorsize and d_mediasize

Note that there is a redundant assignment of d_maxsize.

PR:		kern/138789
2010-04-22 12:12:52 +00:00
Pyun YongHyeon bbad9ba8b7 MFC r206563:
Add Agere ET1011 PHY which is found on Belkin F5D5055 USB
  controller. Unlike Agere ET1011C, Agere ET1011 does not seem to
  need special DSP programming to workaround silicon bug.
2010-04-22 01:45:18 +00:00
Gavin Atkinson 10d4d6ea78 Merge r203027 from head:
Correct the HISTORY section of these man pages to show when the function,
  not the "manual page example" was introduced.
2010-04-21 17:00:15 +00:00
Konstantin Belousov b61f8c6c33 MFC r206549:
Align the declaration for sa_sigaction with POSIX.

MFC r206649:
Still reference struct __sigaction with clarification when this form
of argument declaration is needed.

MFC r206802:
Revert r206649. Simplify the presented declaration of struct sigaction.
2010-04-21 11:11:11 +00:00
Rebecca Cran 4517992cd9 MFC r205118:
Free the memory allocated via strdup.

PR:	bin/113881
Submitted by:	Alexander Drozdov <dzal_mail at mtu-net.ru>
Approved by:	rrs (mentor)
2010-04-20 20:26:26 +00:00
Rebecca Cran c0e4c6d8d5 MFC r205119 and r206056:
Prevent the SIZE field being corrupted when a process allocates more than
2TB.

PR:	bin/129706
Submitted by:	brucec
Approved by:	rrs (mentor)
2010-04-20 20:21:01 +00:00
Giorgos Keramidas 15791b9862 MFC 173194
Remove an extra (commented out) .Sh HISTORY section heading, to avoid
the risk of "shadowing" the following .El request, and delete an empty
line to fix mdoc warnings.
2010-04-19 21:02:54 +00:00
Edwin Groothuis 3eca53cb4d MFC of tzdata2010i, r206868
- Marocco does have DST this year between May and August.
- Historical data for Taiwan
- Argentina / San Luis does not do DST this year.
2010-04-19 21:01:29 +00:00
Giorgos Keramidas 169c90570f MFC 173190
Remove an extra (commented out) .Sh HISTORY section heading, to avoid
the risk of "shadowing" the following .El request, strip eol spaces
and delete an empty line to fix mdoc warnings.
2010-04-19 20:56:04 +00:00
Giorgos Keramidas 0aa5efc80e MFC 173189
Change a .PP request to a valid .Pp mdoc request, and remove an extra
(but commented out) .Sh HISTORY section heading.
2010-04-19 20:53:37 +00:00
Giorgos Keramidas d83fe60a67 MFC 173188
Remove duplicate (but commented out) .Sh HISTORY section heading.
It almost "shadows" the ending .El request of a list, which seems
to have caused mdoc buglets in some gss_*.3 manpages.
2010-04-19 20:51:54 +00:00
Giorgos Keramidas 5e6ab498b3 MFC 173187
Remove duplicate (but commented out) .Sh HISTORY section heading
and add a missing .El request.
2010-04-19 20:48:27 +00:00
Peter Holm 16b7da9694 Fix incorrect assertion. If the caller passed in no lock flags
(i.e. just checking the vnode for validity) then there is a window
between the VI_UNLOCK() in _vn_lock(9) and the subsequent VI_LOCK()
in vget() where another thread could have set VI_DOOMED.

Submitted by:	Matthew Fleming <matthew fleming isilon com>
Reviewed by:	kib
2010-04-18 12:50:26 +00:00
Konstantin Belousov f4e8785eb4 MFC r206671:
Fix typo.
2010-04-18 04:49:07 +00:00
Andriy Gapon d237bc399a MFC r206130: g_vfs_open: allow only one mount per device vnode 2010-04-17 12:01:50 +00:00
Andriy Gapon 66e6d0b849 MFC r206129: vn_stat: use va_blocksize when setting st_blksize 2010-04-17 11:38:18 +00:00
Andriy Gapon d958d0110e MFC r205860,206097: correctly set b_offset for getblk(devvp) 2010-04-17 11:12:20 +00:00
Fabien Thomas fff0b058c7 MFC r206089, r206684:
- Support for uncore counting events: one fixed PMC with the uncore
   domain clock, 8 programmable PMC.
- Westmere based CPU (Xeon 5600, Corei7 980X) support.
- New man pages with events list for core and uncore.
- Updated Corei7 events with Intel 253669-033US December 2009 doc.
  There is some removed events in the documentation, they have been
  kept in the code but documented in the man page as obsolete.
- Offcore response events can be setup with rsp token.

Sponsored by: NETASQ
2010-04-16 16:15:30 +00:00
Fabien Thomas 7ec406ff20 MFC r206089, r206684:
- Support for uncore counting events: one fixed PMC with the uncore
   domain clock, 8 programmable PMC.
- Westmere based CPU (Xeon 5600, Corei7 980X) support.
- New man pages with events list for core and uncore.
- Updated Corei7 events with Intel 253669-033US December 2009 doc.
  There is some removed events in the documentation, they have been
  kept in the code but documented in the man page as obsolete.
- Offcore response events can be setup with rsp token.

Sponsored by: NETASQ
2010-04-16 16:13:49 +00:00
Pyun YongHyeon 611bed2cef MFC r206268
- Fixed 5708S 2.5G support broken in last commit.
  - Added some new debug helper routines to systcl.
  - Fixed many of the style(9) violations that have crept into the code
    due to my use of a "smart" editor.
2010-04-15 19:31:21 +00:00
Pyun YongHyeon 32341a07cd MFC r205300:
- Added support for 5709S/5716S PHYs.
  - Update copyright to 2010.
  - Add new debug code for RV2P block.
  - Improve output formatting for various debug functions.

  PR:	kern/134658, kern/136417, kern/139761, kern/140970
2010-04-15 19:28:15 +00:00
Pyun YongHyeon 4d889f7dcc MFC r205299:
- Added support for 5709S/5716S PHYs.

  Submitted by: pyunyh
  PR:	kern/134658, kern/136417, kern/139761, kern/140970
2010-04-15 19:22:55 +00:00
Alexander Motin 6b7d1e56f9 MFC r205680:
Use last 16 bytes of serial number in metadata instead of first ones,
same as Intel MatrixRAID does.

PR:             kern/124064
2010-04-15 12:22:47 +00:00
John Baldwin dd42bde507 MFC 205900:
Use panic() (which the environment is required to provide to libstand) to
implement assert() instead of relying on a non-required exit().  The exit()
invocation also did not match the semantics of the exit() routine that
current boot environments happen to require.
2010-04-14 17:17:25 +00:00
Alan Cox 793e66cbb1 MFC r206409
Introduce the function kmem_alloc_attr(), which allocates kernel virtual
  memory with the specified physical attributes.

  Correct an error in the prototype for kmem_malloc().
2010-04-14 16:54:49 +00:00
John Baldwin ac05ca4ff1 MFC 205886:
Defer freeing a kevent list until after dropping kqueue locks.
2010-04-14 15:33:30 +00:00
John Baldwin af4b8626fc MFC 205536:
Reject attempts to create a MAP_ANON mapping with a non-zero offset.
2010-04-14 15:23:16 +00:00
John Baldwin b0e51be80c MFC 184226:
Add a statement about the non-portability of non-page-aligned offsets.
2010-04-14 15:20:30 +00:00
John Baldwin 5e1a6adeb8 MFC 185933,205851:
- Add constants for fields in the local APIC error status register.
- Add a handler for the local APIC error interrupt.  For now it just prints
  out the current value of the local APIC error register when the interrupt
  fires.
2010-04-14 15:01:49 +00:00
Pyun YongHyeon 552d46bc55 MFC r206436:
Consistently use capital letters.
2010-04-14 01:24:09 +00:00
Pyun YongHyeon 522b258b8b MFC r206433:
Add preliminary support for 8168E/8111E PCIe controller.
  While I'm here simplify device description string.

  Tested by:	Michael Beckmann < michael <> apfel dot de >
2010-04-14 01:14:40 +00:00
Pyun YongHyeon 12ca7c97c0 MFC r206364:
Partial revert r204545.
  Just relying on status LE ownership of status block seems to cause
  poor performance. Always read current status index register first
  and then check status ownership as we had before. Accessing status
  index register seems to trigger immediate status update if
  controller have pending status updates.

  Reported by:	Andre Albsmeier <Andre.Albsmeier <> siemens dot com>
  Tested by:	Andre Albsmeier <Andre.Albsmeier <> siemens dot com>
2010-04-14 01:09:14 +00:00
Doug Barton 4f2186720a MFC r205995:
Massive cleanup and synchronization with other *BSDs
2010-04-13 20:47:11 +00:00
Nick Hibma 9b9512a6ce Make the list of allocated ports dynamic. The Option GTM382 has 10
serial ports (yes, 10, it has a built in GPS and other stuff) and we
need to access the last one for PPP access to the card. Other ports
are HSO (Option specific protocol; see Linux driver).

Reviewed by:	thompsa
2010-04-13 19:43:16 +00:00
Ed Maste 32a058b162 MFC r201758:
Remove extraneous semicolons, no functional changes.
2010-04-13 00:20:40 +00:00
Fabien Thomas 2c0ed92d93 MFC r206090:
Improve "top" header by:
- Display sample received per PMCs (or merged PMCs).
- Display percentage vs all samples
2010-04-12 21:42:01 +00:00
Andriy Gapon ed5acd2a7a MFC r206102,206103,206175,206176: add example indent.pro file 2010-04-12 21:29:04 +00:00
Andriy Gapon 8b0482d98f MFC r206178: ibc/db/hash: cap auto-tuned block size 2010-04-12 21:13:03 +00:00
Andriy Gapon 6075b76ed7 MFC r206128: ffs_mount: remove redundant assignment to devvp.v_bufobj 2010-04-12 21:09:13 +00:00
Andriy Gapon 01f520a03f MFC r205989: indent(1): new option, -ta, to treat all *_t identifiers as
types
2010-04-12 21:05:36 +00:00
Andriy Gapon 5e9404cee3 MFC r206098: mountmsdosfs: reject too high value of bytes per cluster 2010-04-12 20:54:56 +00:00
Alan Cox afc68c59e1 MFC r204907, r204913, r205402, r205573, r205778
Implement AMD's recommended workaround for Erratum 383 on Family 10h
  processors.

  Enable machine check exceptions by default.
2010-04-10 22:24:03 +00:00
Ed Maste 0578626784 MFC r206383:
Remove extraneous '>'.
2010-04-09 22:51:19 +00:00
Ed Maste 14be458a54 MFC r192862: 2010-04-09 22:48:27 +00:00
Nick Hibma 6ad40f70e6 Add the ID for the Matrix Orbital LCD display MOU-Axxx series.
Simplify a switch statement in the uftdi driver to an if-then-else-endif
as it encoded those two cases only.

Reviewed by:	imp
2010-04-09 08:20:43 +00:00
Alan Cox bed8aa587a MFC r206174
vm_reserv_alloc_page() should never be called on an OBJT_SG object, just
  as it is never called on an OBJT_DEVICE object.  (This change should have
  been included in r195840.)
2010-04-09 06:47:36 +00:00
Matt Jacob f76d901b0b This is an MFC of 206029
Add a couple missing basic mode page codes.
2010-04-08 18:38:50 +00:00
Andriy Gapon 9f531cdb73 MFC r206177: hash.3: fix a factual mistake in the man page 2010-04-08 07:45:42 +00:00
Xin LI f55834899d MFC r204901
Remove the check for IFF_DRV_OACTIVE right before adding a port into lagg
interface.  The check itself seems to be coming from OpenBSD but does not
seem to be useful for our code.

Discussed with:	thomasa
2010-04-08 00:55:08 +00:00
Andriy Gapon fe3e44d7a5 MFC r205988: indent(1): correctly handle case/label at the very start of
a function
2010-04-07 22:28:16 +00:00
Jaakko Heinonen 70a783d38a MFC r198940:
File flags handling fixes for ext2fs:

- Disallow setting of flags not supported by ext2fs.
- Map EXT2_APPEND_FL to SF_APPEND.
- Map EXT2_IMMUTABLE_FL to SF_IMMUTABLE.
- Map EXT2_NODUMP_FL to UF_NODUMP.

Note that ext2fs doesn't support user settable append and immutable flags.
EXT2_NODUMP_FL is an user settable flag also on Linux.

PR:		kern/122047
2010-04-07 15:33:19 +00:00
Nick Hibma 03f4f9cc84 Add the ID of the Option GTM382 Mini PCI express module
Approved by:	re (implicit)
2010-04-06 13:12:11 +00:00
Edward Tomasz Napierala bb2b307780 MFC r201432:
Add manual page for gcache(8).
2010-04-06 10:09:03 +00:00
Navdeep Parhar ad44e4cef8 MFC r204921,r205944,r205945,r205946
r204921: Better TwinAx transceiver detection.
r205944: Refresh the firmware version immediately after it is upgraded (or downgraded).
r205945: Improved PHY EDC settings.
r205946: Do not attempt to retrieve interrupt information before it is available.
2010-04-06 03:07:39 +00:00
Navdeep Parhar b5362ca545 MFC r189643,r194928,r204267
r189643:
commands to fetch uP logic analyzer and IOQs information.

r194928:
"stdio" mode.

r204267:
Allow cxgbtool to build with WARNS=6
2010-04-06 01:17:47 +00:00
Xin LI 7b56f37c16 MFC r205534:
Add PCI ID for MCS9901's parallel port.

PR:		kern/144713
Submitted by:	gcooper
2010-04-06 00:52:45 +00:00
Xin LI 768e902f6b MFC r205520:
Correct cross reference.
2010-04-06 00:47:33 +00:00
Edwin Groothuis 1be2098dec MFC of tzdata2010h:
From tzdata2010h:

- Tunis will not go into DST this year.
- Pakistan will not go into DST this year.

From tzdata2010g:

- Bangladesh cancels DST.
- Palestine goes into DST one day later than expected.

- Russian timezones update:
  Europe/Samara goes to Moscow time.
  Asia/Kamchatka goes to Moscow+8 time.
  Asia/Anadyr goes to Moscow+8 time.
2010-04-05 23:44:39 +00:00
Matt Jacob 548354266d This is an MFC of 205712.
D'oh- isp_handle_index' logic was reversed (not used in FreeBSD).
2010-04-05 18:38:18 +00:00
Matt Jacob ac7bf7be4d This is an mfs of 205698.
Clean up some printing stuff so that we can have a bit finer control
on debug output. Add a new platform function requirement to allow
for printing based upon the ITL nexus instead of the isp unit plus
channel, target and lun. This allows some printouts and error messages
from the core code to appear in the same format as the platform's
subsystem (in FreeBSD's case, CAM path).
2010-04-05 18:29:45 +00:00
Marius Strobl 8d6acfc69d MFC: r206086
- Try do deal gracefully with correctable ECC errors.
- Improve the reporting of unhandled kernel and user traps.
2010-04-05 18:22:48 +00:00
Marius Strobl 6d07d8a8ba MFC: r206020
Use device_get_nameunit(9) rather than device_get_name(9) so one can
identify the reporting bridge in machines with multiple PCI domains.
2010-04-05 18:04:08 +00:00
Marius Strobl d6bd2c5d79 MFC: r206019
Don't re-implement device_get_nameunit(9).
2010-04-05 17:58:47 +00:00
Marius Strobl f1504dff75 MFC: r206018
- Take advantage of the INTCLR_* macros.
- Right-justify the backslashes as per style(9).
2010-04-05 17:57:46 +00:00
Jung-uk Kim bf6a107c79 MFC: r205858
Check the pointer to JIT binary filter before its de-allocation.
2010-04-05 17:33:33 +00:00
Marius Strobl b68661f02a MFC: r205269
o Add support for UltraSparc-IV+:
  - Swap the configuration of the first and second large dTLB as with
    US-IV+ these can only hold entries of certain page sizes each, which
    we happened to chose the non-working way around.
  - Additionally ensure that the large iTLB is set up to hold 8k pages
    (currently this happens to be a NOP though).
  - Add a workaround for US-IV+ erratum #2.
  - Turn off dTLB parity error reporting as otherwise we get seemingly
    false positives when copying in the user window by simulating a
    fill trap on return to usermode. Given that these parity errors can
    be avoided by disabling multi issue mode and the problem could be
    reproduced with a second machine this appears to be a silicon bug of
    some sort.
  - Add a membar #Sync also before the stores to ASI_DCACHE_TAG. While
    at it, turn of interrupts across the whole cheetah_cache_flush() for
    simplicity instead of around every flush. This should have next to no
    impact as for cheetah-class machines we typically only need to flush
    the caches a few times during boot when recovering from peeking/poking
    non-existent PCI devices, if at all.
  - Just use KERNBASE for FLUSH as we also do elsewhere as the US-IV+
    documentation doesn't seem to mention that these CPUs also ignore the
    address like previous cheetah-class CPUs do. Again the code changing
    LSU_IC is executed seldom enough that the negligible optimization of
    using %g0 instead should have no real impact.

  With these changes FreeBSD runs stable on V890 equipped with US-IV+
  and -j128 buildworlds in a loop for days are no problem. Unfortunately,
  the performance isn't were it should be as a buildworld on a 4x1.5GHz
  US-IV+ V890 takes nearly 3h while on a V440 with (theoretically) less
  powerfull 4x1.5GHz US-IIIi it takes just over 1h. It's unclear whether
  this is related to the supposed silicon bug mentioned above or due to
  another issue. The documentation (which contains a sever bug in the
  description of the bits added to the context registers though) at least
  doesn't mention any requirements for changes in the CPU handling besides
  those implemented and the cache as well as the TLB configurations and
  handling look fine.
o Re-arrange cheetah_init() so it's easier to add support for SPARC64
  V up to VIIIfx CPUs, which only require parts of this initialization.

Committed from:	EH2010
2010-04-04 14:57:45 +00:00
Alan Cox 7fde0e1cd6 MFC r205652
A ptrace(2) by one process may trigger a page size promotion in the
  address space of another process.  Modify pmap_promote_pde() to handle
  this.
2010-04-03 15:52:32 +00:00
Hiroki Sato 905323b684 - Typo (s/-p flag/-d flag/) in a ps(1) entry. [*]
- Use &man.*; wherever possible.

Spotted by:	pluknet gmail.com [*]
PR:		docs/145059 [*]
2010-04-03 10:07:10 +00:00
Fabien Thomas 0992d9c79e MFC r205998:
If there is multiple PMCs for the same interrupt ignore new post.
This will indirectly fix a bug where the thread will be pinned
forever if the assert is not compiled.
2010-04-03 07:19:31 +00:00
Andriy Gapon 2bf7f0c378 MFC r205854: calendar.freebsd: add my entry 2010-04-02 15:36:56 +00:00
Jaakko Heinonen 84ee02c5a4 MFC r197833:
When run() returns an error, print the error message also in
non-interactive mode. Previously error messages were printed only in
interactive mode.

PR:		bin/124517
2010-04-02 08:57:39 +00:00
Marius Strobl d986b9eba5 MFC: r205409
- The firmware of Sun Fire V1280 has a misfeature of setting %wstate to
  7 which corresponds to WSTATE_KMIX in OpenSolaris whenever calling into
  it which totally screws us even when restoring %wstate afterwards as
  spill/fill traps can happen while in OFW. The rather hackish OpenBSD
  approach of just setting the equivalent of WSTATE_KERNEL to 7 also is
  no option as we treat %wstate as a bit field. So in order to deal with
  this problem actually implement spill/fill handlers for %wstate 7 which
  just act as the WSTATE_KERNEL ones except of theoretically also handling
  32-bit, turn off interrupts completely so we don't even take IPIs while
  in OFW which should ensure we only take spill/fill traps at most and
  restore %wstate after calling into OFW once we have taken over the trap
  table. While at it, actually set WSTATE_{,PROM}_KMIX before calling into
  OFW just like OpenSolaris does, which should at least help testing this
  change on non-V1280.
- Remove comments referring to the %wstate usage in BSD/OS.
- Remove the no longer used RSF_ALIGN_RETRY macro.
- Correct some trap table addresses in comments.
- Ensure %wstate is set to WSTATE_KERNEL when taking over the trap table.
- Ensure PSTATE_AM is off when entering or exiting to OFW as well as that
  interrupts are also completely off when exiting to OFW as the firmware
  trap table shouldn't be used to handle our interrupts.
2010-04-01 15:17:52 +00:00
Xin LI d6c22fc9c3 MFC r205656:
Check that gl_pathc is bigger than zero before derefencing gl_pathv.
When gl_pathc == 0, the content of gl_pathv is undefined.

PR:		bin/144761
Submitted by:	David BERARD <contact davidberard fr>
Obtained from:	OpenBSD
2010-04-01 00:38:38 +00:00
Marius Strobl d440faef02 MFC: r205399
Improve the KVA space sizing of r186682 (r190080); on machines with large
dTLBs we can actually use all of the available lockable entries of the tiny
dTLB for the kernel TSB. With this change the KVA space sizing happens to
be more in line with the MI one so up to at least 24GB machines KVA doesn't
need to be limited manually. This is just another stopgap though, the
real solution is to take advantage of ASI_ATOMIC_QUAD_LDD_PHYS on CPUs
providing it so we don't need to lock the kernel TSB pages into the dTLB
in the first place.
2010-03-31 22:05:53 +00:00
Marius Strobl f4c9392e62 MFC: r205263
Add macros for the VER.impl of SPARC64 II to VIIIfx.
2010-03-31 22:00:22 +00:00
Marius Strobl 721216dfe9 MFC: r205258
- Add TTE and context register bits for the additional page sizes supported
  by UltraSparc-IV and -IV+ as well as SPARC64 V, VI, VII and VIIIfx CPUs.
- Replace TLB_PCXR_PGSZ_MASK and TLB_SCXR_PGSZ_MASK with TLB_CXR_PGSZ_MASK
  which just is the complement of TLB_CXR_CTX_MASK instead of trying to
  assemble it from the page size bits which vary across CPUs.
- Add macros for the remainder of the SFSR bits, which are useful for at
  least debugging purposes.
2010-03-31 21:57:49 +00:00
Marius Strobl 3a1b84d6bd MFC: r204153
Starting with UltraSPARC IV CPUs the CPU caches are described with different
OFW properties.
2010-03-31 21:41:03 +00:00
Marius Strobl abcc9afed0 MFC: r204152, r204164
Some machines can not only consist of CPUs running at different speeds
but also of different types, f.e. Sun Fire V890 can be equipped with a
mix of UltraSPARC IV and IV+ CPUs, requiring different MMU initialization
and different workarounds for model specific errata. Therefore move the
CPU implementation number from a global variable to the per-CPU data.
Functions which are called before the latter is available are passed the
implementation number as a parameter now.
2010-03-31 21:32:52 +00:00
Alexander Motin 040aaafb96 MFC r205074:
Mask disk_idx to avoid panic because of extra bits set.

PR:             kern/102211
Submitted by:   yoichi
2010-03-31 07:52:48 +00:00
Fabien Thomas df480375a1 MFC r205809:
Wait for pmc name in the log before displaying data.
This will solve an abort in case of low throughput PMCs.
2010-03-31 07:12:12 +00:00
Xin LI 6f3ab15087 MFC r204533:
Add PCI ID for MCS9901.

Submitted by:	gcooper
PR:		kern/144397
2010-03-31 00:42:18 +00:00
Marius Strobl 7d25428e91 MFC: r203846
Predict KASSERTs to be true.
2010-03-30 20:46:09 +00:00
Marius Strobl c06e007d35 MFC: r203845
- Add the 'cmp' and 'core' pseudo-busses which are used to group CPU cores
  to the exclusion lists as the CPU nodes aren't handled as regular devices
  either. Also add the pseudo-devices found in Sun Fire V1280.
- Allow nexus_attach() and nexus_alloc_resource() to be used by drivers
  derived from nexus(4) for subordinate busses.
- Don't add the zero-sized memory resources of glue devices to the resource
  lists.
2010-03-30 20:44:05 +00:00
Marius Strobl e24c69faf7 MFC: r203843
Resurrect nexusvar.h from r167307.
2010-03-30 20:39:48 +00:00
Marius Strobl af0a939e2c MFC: r203839
Style fixes
2010-03-30 20:38:20 +00:00
Marius Strobl 04270cca08 MFC: r203838
- Search the whole OFW device tree instead of only the children of the
  root nexus device for the CPUs as starting with UltraSPARC IV the 'cpu'
  nodes hang off of from 'cmp' (chip multi-threading processor) or 'core'
  or combinations thereof. Also in large UltraSPARC III based machines
  the 'cpu' nodes hang off of 'ssm' (scalable shared memory) nodes which
  group snooping-coherency domains together instead of directly from the
  nexus.
  It would be great if we could use newbus to deal with the different ways
  the 'cpu' devices can hang off of pseudo ones but unfortunately both
  cpu_mp_setmaxid() and sparc64_init() have to work prior to regular device
  probing.
- Add support for UltraSPARC IV and IV+ CPUs. Due to the fact that these
  are multi-core each CPU has two Fireplane config registers and thus the
  module/target ID has to be determined differently so the one specific
  to a certain core is used. Similarly, starting with UltraSPARC IV the
  individual cores use a different property in the OFW device tree to
  indicate the CPU/core ID as it no longer is in coincidence with the
  shared slot/socket ID.
  This involves changing the MD KTR code to not directly read the UPA
  module ID either. We use the MID stored in the per-CPU data instead of
  calling cpu_get_mid() as a replacement in order prevent clobbering any
  registers as side-effect in the assembler version. This requires CATR()
  invocations from mp_startup() prior to mapping the per-CPU pages to be
  removed though.
  While at it additionally distinguish between CPUs with Fireplane and
  JBus interconnects as these also use slightly different sizes for the
  JBus/agent/module/target IDs.
- Make sparc64_shutdown_final() static as it's not used outside of
  machdep.c.
2010-03-30 20:29:45 +00:00
Marius Strobl aed6aeec26 MFC: r203833
- At least the trap table of the Sun Fire V1280 firmware apparently has
  no cleanwindows handler so just remove trying to trigger it from _start
  and the AP trampoline code as that leads to a crash there. This should
  be okay as leaking data from the OFW via the CPU registers on start of
  the kernel should be no real concern.
- Make the comments of _start and the AP trampoline code regarding the
  initializations they perform match each other and reality.
- Make the comments of the AP trampoline code regarding iTLB accesses
  refer to the right macro.
2010-03-30 20:12:46 +00:00
Marius Strobl 37d73cf2fe MFC: r203830, r203831
Use the SUNW,{d,i}tlb-load methods for entering locked TLB entries like
OpenBSD and OpenSolaris do instead of fiddling with the MMUs ourselves.
Unlike direct access the firmware methods don't automatically use the
next free (?) TLB slot, instead the slot to be used has to be specified.
We allocate the TLB slots for the kernel top-down as OpenSolaris suggests
that the firmware will always allocate the ones for its own use bottom-up.
Besides being simpler, according to OpenBSD using the firmware methods is
required to allow booting on Sun Fire E10K with multi-systemboard domains.
2010-03-30 20:05:22 +00:00
Marius Strobl d4ed522501 MFC: r203829
- Assert that HEAPSZ is a multiple of PAGE_SIZE as at least the firmware
  of Sun Fire V1280 doesn't round up the size itself but instead lets
  claiming of non page-sized amounts of memory fail.
- Change parameters and variables related to the TLB slots to unsigned
  which is more appropriate.
- Search the whole OFW device tree instead of only the children of the
  root nexus device for the BSP as starting with UltraSPARC IV the 'cpu'
  nodes hang off of from 'cmp' (chip multi-threading processor) or 'core'
  or combinations thereof. Also in large UltraSPARC III based machines
  the 'cpu' nodes hang off of 'ssm' (scalable shared memory) nodes which
  group snooping-coherency domains together instead of directly from the
  nexus.
- Add support for UltraSPARC IV and IV+ BSPs. Due to the fact that these
  are multi-core each CPU has two Fireplane config registers and thus the
  module/target ID has to be determined differently so the one specific
  to a certain core is used. Similarly, starting with UltraSPARC IV the
  individual cores use a different property in the OFW device tree to
  indicate the CPU/core ID as it no longer is in coincidence with the
  shared slot/socket ID.
  While at it additionally distinguish between CPUs with Fireplane and
  JBus interconnects as these also use slightly different sizes for the
  JBus/agent/module/target IDs.
- Check the return value of init_heap(). This requires moving it after
  cons_probe() so we can panic when appropriate. This should be fine as
  the PowerPC OFW loader uses that order for quite some time now.
2010-03-30 20:02:28 +00:00
Marius Strobl 5416fb7aa4 MFC: r203731
Some style(9) fixes
2010-03-30 19:52:45 +00:00
Hiroki Sato d7ef2f0c92 Document fdopendir(3) missing prototype issue.
Submitted by:	delphij
2010-03-30 19:41:43 +00:00
Marius Strobl a66a3f3438 MFC: r203341
- Remove the BUS_HANDLE_MIN checking in the __BUS_DEBUG_ACCESS macro;
  for UPA it should have fulfilled its purpose by now and Fireplane-
  and JBus-based machines are way to messy in organization to implement
  something equivalent.
- Fix a bunch of style(9) bugs.
2010-03-30 19:37:55 +00:00
Marius Strobl 4b5496c830 MFC: r203335
- Const'ify the bus_stream_asi and bus_type_asi arrays.
- Replace hard-coded functions names missed in bus_machdep.c with __func__.
- Break some long lines.
2010-03-30 19:36:03 +00:00
Marius Strobl 1d8a71ad12 MFC: r203334
Sync with the other archs and declare the memory location referenced by
the address argument of the bus_space_write_multi_*() familiy as const.
2010-03-30 19:33:09 +00:00
Hiroki Sato 59c95a9161 Document zfsloader issue on 7.3R. 2010-03-30 19:31:58 +00:00
Marius Strobl 66f11a53d2 MFC: r173859, r205410
Avoid aliasing which leads to incorrect results when compiling with the
default strict aliasing rules.

PR:		144900
Submitted by:	Peter Jeremy
2010-03-30 19:15:57 +00:00
Marius Strobl 7f37c9ad97 MFC: r205397
- While SPARC V9 allows tininess to be detected either before or after
  rounding (impl. dep. #55), the SPARC JPS1 responsible for SPARC64 and
  UltraSPARC processors defines that in all cases tinyness is detected
  before rounding, therefore rounding up to the smallest normalised
  number should set the underflow flag.
- If an infinite result is rounded down, the result should have an
  exponent 1 less than the value for infinity.

PR:		144900
Submitted by:	Peter Jeremy
2010-03-30 19:08:01 +00:00
Marius Strobl 8178aba859 MFC: r205396
Division should take both arguments' signs into account when the
the dividend is infinity or zero and the divisor is not the same.

PR:		144900
Submitted by:	Peter Jeremy
2010-03-30 19:06:33 +00:00
Marius Strobl c2472ebf0e MFC: r205395
FPU_DEBUG requires <stdio.h>.

PR:		144900
Submitted by:	Peter Jeremy
2010-03-30 19:05:11 +00:00
Marius Strobl 76ae032b13 MFC: r205394
Ensure that __fpu_ftox() both returns the high bits and res[1] contains
the low bits also in the default case.

PR:		144900
Obtained from:	OpenBSD
2010-03-30 19:03:27 +00:00
Marius Strobl 6de27b496e MFC: r205393
- Remove a bogus forward declaration.
- Fix whitespace.
2010-03-30 18:58:10 +00:00
Jaakko Heinonen a97df478a4 MFC r205121:
Use an unique directory name instead of hardcoded /tmp/.diskless.
A malicious user could create a file named /tmp/.diskless and cause
the script to misbehave.

PR:		conf/141258
2010-03-30 15:25:16 +00:00
Attilio Rao 92b4a7328c MFC r205167:
Make the code more readable and compiling on 64-bits arch different
than amd64.

Sponsored by:	Sandvine Incorporated
2010-03-30 12:08:00 +00:00
Attilio Rao c40108a1d4 MFC r205160:
Checkin a facility for specifying a passthrough FIB from userland.
arcconf tool by Adaptec already seems to use for identifying the
Serial Number of the devices.

Sponsored by:	Sandvine Incorporated
2010-03-30 12:01:35 +00:00
Doug Barton d721231926 Update to 9.4-ESV-R1, the latest patchfix release which deals with
the problems related to the handling of broken DNSSEC trust chains.

This fix is only relevant for those who have DNSSEC validation
enabled and configure trust anchors from third parties, either
manually, or through a system like DLV.
2010-03-29 23:00:45 +00:00
Doug Barton 53c92a65cd MFC r205290:
MAKE_JUST_WORLDS
2010-03-29 22:59:35 +00:00
Warner Losh e134c4a158 MFC: r192058
- Remove nonexistent header file from includes list
2010-03-29 15:29:06 +00:00
Fabien Thomas a4ad14a48f MFC r205693:
Do not overflow the term in the case of multi-line display.
2010-03-29 06:59:08 +00:00
Fabien Thomas 82528cde50 MFC r205694:
Handling SIGPIPE will cause deadlock/crash.
Return an error immediatly in case of hard shutdown.
2010-03-29 06:56:17 +00:00
Ed Maste fa707b3e0b MFC aac(4) driver changes
r204019:

  Include command type in COMMAND TIMEOUT messages to aid in debugging.

r203885:

  Diff reduction with Adaptec's vendor driver.

  Driver version 2.1.9 chosen as that Adaptec version roughly corresponds
  with the current feature set merged to the in-tree driver.

r203801:

  Garbage collect Falcon/PPC support that has not been used in released
  products, based on discussion with Adaptec.

r198617:

  Rename aac_srb32 to aac_srb, to match Adaptec's vendor driver.
2010-03-29 00:39:09 +00:00
Ed Maste 9ac57a842c MFC r205411:
Avoid holding the VLAN_LOCK() over the parent interface SIOCGIFMEDIA
  ioctl call, as it may sleep.

  Reviewed by:    rwatson
2010-03-29 00:13:16 +00:00
Ed Maste 2633b9e122 MFC r204264:
Minor diff reduction with Adaptec's driver: in aac_release_command() set
  cm_queue to AAC_ADAP_NORM_CMD_QUEUE by default.  In every place it was
  set, it was set to AAC_ADAP_NORM_CMD_QUEUE anyhow.
2010-03-29 00:09:56 +00:00
John Baldwin 21b201e9a3 MFC 205332:
Use the same policy for rejecting / not-reject ACPI tables with incorrect
checksums as the base acpi(4) driver.  This fixes a problem where the MADT
parser would reject the MADT table during early boot causing the MP Table
to be, but then the acpi(4) driver would attach and use non-SMP interrupt
routing.
2010-03-26 19:00:17 +00:00
John Baldwin 8bba1454f7 MFC 204972:
Make NKPT a kernel option on i386 so that it can be set to a non-default
value from kernel config files.
2010-03-26 18:54:46 +00:00
John Baldwin 30c596d101 MFC 205214:
- Extend the machine check record structure to include several fields useful
  for parsing model-specific and other fields in machine check events
  including the global machine check capabilities and status registers,
  CPU identification, and the FreeBSD CPU ID.
- Report these added fields in the console log of a machine check so that
  a record structure can be reconstituted from the console messages.
- Parse new architectural errors including memory controller errors.
2010-03-26 13:50:19 +00:00
John Baldwin 26647c1701 MFC 205210,205448:
Remove unneeded type specifiers from 64-bit constants.  The compiler
infers their natural type from the constants' values.
2010-03-26 13:01:53 +00:00
Maxim Sobolev 03a888a4c7 MFC: workaround no-carrier issue on IBM HS21.
PR:		118238
2010-03-26 00:05:42 +00:00
Xin LI a9da4345a8 MFC r205654:
The rmt client in GNU cpio could have a heap overflow when a malicious
remote tape service returns deliberately crafted packets containing
more data than requested.

Fix this by checking the returned amount of data and bail out when it
is more than what we requested.

PR:		gnu/145010
Submitted by:	naddy
Reviewed by:	imp
Security:	CVE-2010-0624
2010-03-25 20:07:30 +00:00
Jaakko Heinonen 2884255c17 MFC r202944:
Print full path in the error message. It's possible that fts(3)
provides an empty fts_name and reporting the full path is more
appropriate especially with the -R option.

PR:		bin/107515
2010-03-25 16:31:05 +00:00
John Baldwin b525abdb18 MFC 205013:
Print out the family and model from the cpu_id.  This is especially useful
given the advent of the extended family and extended model fields.  The
values are printed in hex to match their common usage in documentation.
2010-03-25 15:53:02 +00:00
Gavin Atkinson 8e3c8a034a Merge r204165 from head:
Add a "-x" option to chown(8)/chgrp(1) similar to the same option in
  du(1), cp(1) etc, to prevent the crossing of mountpoints whilst using the
  commands recursively.

PR:		bin/130855
Submitted by:	keramida
2010-03-25 13:15:55 +00:00
Maxim Sobolev d2aa506a3d MFC: allow comment in the middle of configuration line not only at the
beginning.
2010-03-25 00:37:13 +00:00
Pyun YongHyeon a5636cc5f1 MFC r205161:
It seems PCI_OUR_REG_[1-5] registers are not mapped on PCI
  configuration space on Yukon Ultra(88E8056) such that accesses to
  these registers were NOPs which in turn make msk(4) instable on
  this controller. Use indirect access method to access
  PCI_OUR_REG_[1-5] registers. This should fix a long standing
  instability bug which prevented msk(4) working on Yukon Ultra.
  Special thanks to koitsu who gave me remote access to his system.

  PR:	kern/114631, kern/116853
2010-03-24 17:38:08 +00:00
Pyun YongHyeon ca8b6562fd MFC r204975,204978-204979,204981:
r204975:
  Enable hardware fixes for BCM5704 B0 as recommended by data sheet.
r204978:
  Set maximum read byte count to 2048 for PCI-X BCM5703/5704 devices.
  Also disable relaxed ordering as recommended by data sheet for
  PCI-X devices. For PCI-X BCM5704, set maximum outstanding split
  transactions to 0 as indicated by data sheet.
  For BCM5703 in PCI-X mode, DMA read watermark should be less than
  or equal to maximum read byte count configuration. Enforce this
  limitation in DMA read watermark configuration.
r204979:
  Fix typo in r204975.
r204981:
  Fix typo in r204978.
2010-03-24 17:32:20 +00:00
Pyun YongHyeon 434b0e8298 MFC r204545:
Remove taskqueue based interrupt handling. After r204541 msk(4)
  does not generate excessive interrupts any more so we don't need
  to have two copies of interrupt handler.
  While I'm here remove two STAT_PUT_IDX register accesses in LE
  status event handler. After r204539 msk(4) always sync status LEs
  so there is no need to resort to reading STAT_PUT_IDX register to
  know the end of status LE processing. Just trust status LE's
  ownership bit.
2010-03-24 17:21:05 +00:00
Pyun YongHyeon ec20a5073e MFC r204543:
Document newly added loader tunable and sysctl variable dev.mskc.%d.int_holdoff
2010-03-24 17:15:39 +00:00
Pyun YongHyeon 9f8b311c1c MFC r204541:
Implement rudimentary interrupt moderation with programmable
  countdown timer register. The timer resolution may vary among
  controllers but the value would be represented by core clock
  cycles. msk(4) will automatically computes number of required clock
  cycles from given micro-seconds unit.
  The default interrupt holdoff timer value is 100us which will
  ensure less than 10k interrupts under load. The timer value can be
  changed with dev.mskc.0.int_holdoff sysctl node.

  Note, the interrupt moderation is shared resource on dual-port
  controllers so you can't use separate interrupt moderation value
  for each port. This means we can't stop interrupt moderation in
  driver stop routine. Also have msk_tick() reclaim transmitted Tx
  buffers as safety belt. With this change there is no need to check
  missing Tx completion interrupt in watchdog handler, so remove it.
2010-03-24 17:13:19 +00:00
Jaakko Heinonen 47fd23ccf0 MFC r203551:
- Cast intptr_t, pid_t and time_t values to intmax_t and use %jd with
  printf.
- Cast the system call return value to long and use %ld in a printf in
  ktrsysret().

PR:		bin/123774
2010-03-24 16:47:12 +00:00
Konstantin Belousov 4c172a339b MFC r204957:
Fall back to wbinvd when region for CLFLUSH is >= 2MB.

MFC r205334 (by avg):
Fix a typo in a comment.
2010-03-24 10:02:10 +00:00
Xin LI 4bfef5fb7d MFC: less v436. 2010-03-23 23:28:14 +00:00
Xin LI 5616a59d97 MFC: nc from OpenBSD 4.6. 2010-03-23 23:09:38 +00:00
Pyun YongHyeon 6eb06ed981 MFC r204378:
Add TSO support on VLANs. While I'm here remove unnecessary check
  of VLAN hardware checksum offloading. vlan(4) already takes care of
  this.
2010-03-23 22:24:02 +00:00
Pyun YongHyeon ce2d1fa190 MFC r204377:
Add TSO support on VLANs. While I'm here remove unnecessary check
  of VLAN hardware checksum offloading. vlan(4) already takes care of
  this.
2010-03-23 22:20:51 +00:00
Pyun YongHyeon d3c376f55e MFC r204376:
Disable TSO on BCM5755M controller until I understand better for
  the issue. I still have no idea why TSO does not work on this
  controller. davidch@ also confirmed there is no known TSO related
  issues for this controller.
2010-03-23 22:17:49 +00:00
Pyun YongHyeon 96a689d683 MFC r204373-204374:
r204373:
  Move TSO setup to new function bce_tso_setup(). Also remove VLAN
  parsing code in TSO path as the controller requires VLAN hardware
  tagging to make TSO work over VLANs.
  While parsing the mbuf in TSO patch, always perform check for
  writable mbuf as bce(4) have to reset IP length and IP checksum
  field of IP header and make sure to ensure contiguous buffer before
  accessing IP/TCP headers. While I'm here replace magic number 40 to
  more readable sizeof(struct ip) + sizeof(struct tcphdr).

r204374:
  Add TSO support on VLANs. bce(4) controllers require VLAN hardware
  tagging to make TSO work on VLANs so explicitly disable TSO on VLAN
  if VLAN hardware tagging is disabled.
2010-03-23 22:14:05 +00:00
Pyun YongHyeon f7913c45a7 MFC r204368,204370-204372:
r204368:
  Allow disabling VLAN hardware tag stripping with software work
  around. Management firmware(ASF/IPMI/UMP) requires the VLAN
  hardware tag stripping so don't actually disable VLAN hardware tag
  stripping. If VLAN hardware tag stripping was disabled, bce(4)
  manually reconstruct VLAN frame by appending stripped VLAN tag.
  Also remove unnecessary IFCAP_VLAN_MTU message.

r204370:
  Make sure to stop controller first before changing MTU. And if
  interface is not running don't initialize controller.
  While here remove unnecessary update of error variable.

r204371:
  Make toggling TSO, VLAN hardware checksum offloading work. Also fix
  TX/RX checksum handler to set/clear relavant assist bits which was
  used to cause unexpected results.
  With this change, bce(4) can be bridged with other interfaces that
  lack TSO, VLAN checksum offloading.

r204372:
  Prefer m_collapse(9) over m_defrag(9).
2010-03-23 22:06:59 +00:00
Pyun YongHyeon 19d2b155d1 MFC r204363,204365-204367,204539-204540:
r204363:
  Optimize inserting LE for TX checksum computation. Controller does
  not require checksum LE configuration if checksum start and write
  position is the same as before. So keep track last checksum start
  and write position and insert new LE whenever the position is
  changed. This reduces number of LEs used in TX path as well as
  slightly enhance TX performance.

r204365:
  Don't hardcod register offset to set PCIe max read request size.
  The register offset is not valid on 88E8072 controller. Also don't
  blindly increase max read request size to 4096, instead, use 2048
  which seems to be more sane value and only change the value if the
  hardware default size(512) was used on that register.
  For PCIX controllers, use system defined constant rather than using
  magic value.
  While I'm here stop showing negotiated link width.

r204366:
  Allocate single MSI message. msk(4) used to allocate 2 MSI messages
  for controllers like 88E8053 which reports two MSI messages.
  Because we don't get anything useful things with 2 MSI messages,
  allocating 1 MSI message would be more sane approach.
  While I'm here, enable MSI for dual-port controllers too. Because
  status block is shared for dual-port controllers, I don't think
  msk(4) will encounter problem for using MSI on dual-port
  controllers.

r204367:
  Remove trailing white spaces.

r204539:
  Properly sync status LEs after processing.

r204540:
  Make sure to enable flow-control only if established link is
  full-duplex. Previously msk(4) used to allow flow-control on
  1000baseT half-duplex media. Also GMAC pause is enabled if link
  partner is capable of handling it.
  While I'm here use IFM_OPTIONS instead of using IFM_GMASK to check
  optional flags of link.
2010-03-23 21:56:07 +00:00
Pyun YongHyeon 500141a884 MFC r204361-204362:
r204361:
  Reuse the configured LE for VLAN if new LE was created for TSO.
  Only old controllers need to create new LE for TSO. This change
  makes TSO work over VLANs.

r204362:
  Add TSO support on VLANs. Controller requires VLAN hardware tagging
  to make TSO work over VLANs.
2010-03-23 21:43:01 +00:00
John Baldwin 2060aaa7ba Enable the ability to build ZFS into the loader so that /boot/zfsloader
actually contains ZFS support.

Submitted by:	Alexander Zagrebin  alexz of visp ru
2010-03-23 21:39:33 +00:00
Andrew Gallatin e7a35c936a MFC 204212: Update mxge to support IFCAP_VLAN_HWTSO 2010-03-23 21:38:41 +00:00
Pyun YongHyeon b73e2c2ee3 MFC r204228,204230:
r204228:
  Add TSO support on VLANs. Also make sure to update TSO capability
  whenever jumbo frame is configured.
  While I'm here remove unnecessary check of VLAN hardware checksum
  offloading. vlan(4) already takes care of this.

r204230:
  Remove Tx mbuf parsing code for VLAN in TSO path. Controller does
  not support TSO over VLAN if VLAN hardware tagging is disabled so
  there is no need to check VLAN here.
2010-03-23 19:44:59 +00:00
Pyun YongHyeon a05e3eb47f MFC r204225:
Add TSO support on VLANs. jme(4) controllers do not require VLAN
  hardware tagging to make TSO work over VLANs.
2010-03-23 19:38:45 +00:00
Pyun YongHyeon bd478f639b MFC r204155,204219:
r204155:
  Increase PCIe maximuim read request size to 2048. Because re(4) uses
  Tx DMA burst size 2048, I beleive PCIe maximum read request size
  also should match to the value of Tx DMA burst size. With this
  change I can get more than 800Mbps for TCP bulk transfers.
  Previously I was not able to get more than 700Mbps. If I enable TSO
  it now shows 927Mbps.

r204219:
  Add TSO on VLANs. Because re(4) has a TSO limitation for jumbo
  frame, make sure to update VLAN capabilities whenever jumbo frame
  is configured.
  While I'm here rearrange interface capabilities configuration. The
  controller requires VLAN hardware tagging to make TSO work on VLANs
  so explicitly check this requirement.
2010-03-23 19:34:34 +00:00
Pyun YongHyeon 5cbe7661f4 MFC r204151,204223:
r204151:
  Add TSO support on VLAN. Controller requires VLAN hardware tagging
  to make TSO work on VLAN. So if VLAN hardware tagging is disabled
  explicitly clear TSO on VLAN. While I'm here remove duplicated
  VLAN_CAPABILITIES call.

r204223:
  Remove Tx mbuf parsing code for VLAN in TSO path. Controller does
  not support TSO over VLAN if VLAN hardware tagging is disabled so
  there is no need to check VLAN here.
  While I'm here make sure to pullup IP/TCP headers in the first
  buffer.
2010-03-23 19:24:17 +00:00
Ken Smith 7fbe18de6f 7.3-RELEASE is out so shift from PRERELEASE to STABLE. 2010-03-23 19:11:25 +00:00
Hiroki Sato 3523a98e25 Trim old items and add an errata item for 7.3R. 2010-03-23 18:36:45 +00:00
Pyun YongHyeon fdb1769dba MFC r204156:
Add __FBSDID.
2010-03-22 23:27:08 +00:00
Pyun YongHyeon 3c2ad38307 MFC r203528:
Add pci_get|set_max_read_req() helper functions to control maximum PCIe
  read request size.
2010-03-22 23:15:19 +00:00
Edwin Groothuis 4dcba75b42 MFC of r205475, tzdata2010f:
The Australian Antartic Division:
- Macquarie Island will stay on UTC+11 for winter and not switch back from DST.
- Casey station reverted to its normal time of UTC+8 on 5 March 2010.
- Davis station will revert to its normal time of UTC+7 at 10 March 2010
- Mawson station stays on UTC+5.

Syria will start DST on Thursday 1 April 2010 at midnight.

Correct Samao DST start date (26 Sep vs 24 Oct)
2010-03-22 21:35:56 +00:00
Jung-uk Kim 736f521c56 MFC: r205223
Fix a long standing regression of readdir(3) in fdescfs(5) introduced
in r1.48.  We were stopping at the first null pointer when multiple file
descriptors were opened and one in the middle was closed.  This restores
traditional behaviour of fdescfs.
2010-03-22 20:41:44 +00:00
Jung-uk Kim 9e14ecacaa MFC: r205092
Tidy up callout for select(2) and read timeout.

- Add a missing callout_drain(9) before the descriptor deallocation.[1]
- Prefer callout_init_mtx(9) over callout_init(9) and let the callout
subsystem handle the mutex for callout function.

PR:		kern/144453
Submitted by:	Alexander Sack (asack at niksun dot com)[1]
2010-03-22 20:12:10 +00:00
Jung-uk Kim 974843e875 MFC: r203943
Remove COMPILATIONDATE from the default section.  This string is no longer
being substituted since r162063.
2010-03-22 19:52:06 +00:00
Pyun YongHyeon de25bbb0b9 MFC r204150:
Add TSO support on VLAN in fconfig(8).
2010-03-22 19:50:33 +00:00
Pyun YongHyeon ffb9c4e603 MFC r182414:
Add support in ifconfig to control the vlan hardware filter feature.
2010-03-22 19:36:47 +00:00
Pyun YongHyeon 93934d22e6 MFC r204149:
Add TSO support on VLANs. Intentionally separated IFCAP_VLAN_HWTSO
  from IFCAP_VLAN_HWTAGGING. I think some hardwares may be able to
  TSO over VLAN without VLAN hardware tagging.
  Driver changes and userland support will follow.
2010-03-22 19:04:02 +00:00
John Baldwin 9e67b248d2 MFC 204950,205020:
Use thr_once() with once_t controls to initialize various thread_key_t
objects used to provide per-thread storage in the RPC code.  Almost all
of these used double-checking with a dedicated mutex (tsd_lock) to do this
before.  However, that is not always safe with more relaxed memory orders.
There were also other bugs, such as one in __rpc_createrr() that caused a
new key to be allocated each time __rpc_createrr() was invoked.
2010-03-22 15:54:56 +00:00
Andrew Gallatin f60639d1b7 MFC 205255: Fix 2 bugs in mxge_attach() 2010-03-22 13:20:25 +00:00
Michael Tuexen a6d4dfd1d6 MFC 186815
Adds flag for SCTP checksum offloading.
Requested by Pyun YongHyeon.

Reviewed by: rrs
2010-03-22 00:11:31 +00:00
Ken Smith c5d86e6e59 Guess at the date the 7.3-RELEASE builds will be finished and everything
will be in place for the announcement.
2010-03-20 23:50:55 +00:00
Jaakko Heinonen a3155d529b MFC r204447:
In _gettemp(), check that the length of the path doesn't exceed
MAXPATHLEN. Otherwise the path name (or part of it) may not fit to
carrybuf causing a buffer overflow.

PR:		bin/140228
2010-03-19 12:04:56 +00:00
Pyun YongHyeon f241007553 MFC r202717:
- Added a workaround for NC-SI management firmware that would allow
    frames to be accepted while the driver is resetting the hardware.
    This failure is generally observed when broadcast frames are received
    during driver load and will generate "Unable to write CTX memory"
    errors.
  - Small changes to driver flags display.

PR:	kern/135836, kern/140684
2010-03-19 00:29:52 +00:00
Pyun YongHyeon 17d2620ac2 MFC r194781:
- Added code to read bootcode firwmare version.
  - Created dedicated shared memory access routines.
2010-03-19 00:18:53 +00:00
Pyun YongHyeon 1bbb1b99ac MFC r202826-202827,204146
r202826:
  s/Mhz/MHz/g

  Submitted by:	N.J. Mann <njm <> njm dot me dot uk >

r202827:
  Yukon Ultra2 has 125MHz clock.

r204146:
  Correct inversed programming of ethernet hardware address on
  big-endian architecture.

  Submitted by:	C. Jayachandran <c.jayachandran at gmail dot com> (initial version)
2010-03-18 19:00:37 +00:00
Pyun YongHyeon fff1160b65 MFC r203358,203716:
r203358:
  PCI express device status register has W1C feature. Writing 0 has
  no effect. Make sure to clear error bits by writing 1. [1]
  While I'm here use predefined value instead of hardcodig magic
  vlaue.

  Submitted by:	msaitoh at NetBSD [1]

r203716:
  Move device specific flag configuration to attach routine.
  The softc obtained in device probe wouldn't be the same one used in
  device attach. Drivers should not assume any values stored in softc
  structure in probe routine will be available for its attach routine.
2010-03-18 18:52:18 +00:00
Pyun YongHyeon f62eff8675 MFC r203355:
Add more bit definitions to PCI express device control and device
  status register.
2010-03-18 18:45:45 +00:00
Pyun YongHyeon 4c15f99a49 MFC r202821-202822.
r202821:
  Fix a long standing ASF heartbeat sending bug. The initial
  implementation of heartbeat interval was 2 but there was typo which
  caused the heartbeat is sent approximately every 5 seconds. This
  caused unintended controller reset by firmware because firmware
  thought OS was crashed.

  Submitted by:	Floris Bos < info <> je-eigen-domein dot nl >
  Tested by:	Andrzej Tobola < ato <> iem dot pw dot edu dot pl >

r202822:
  Use new handshake command for BCM5750 or new controllers.
2010-03-18 18:38:53 +00:00
Rui Paulo 48fa92006c Fix HTCAP's SM power save bits to match the ones in HEAD.
PR:		144476
Submitted by:	Alexander Egorenkov <egorenar at gmail.com>
2010-03-18 16:55:47 +00:00
Gavin Atkinson 68cc9e3f9f Merge r203622 from head:
Add support for a few more Sony-specific ACPI features (default display
  brightness, wired LAN power and bass gain), and update the description of
  one previously unknown feature (display contrast).  While here, expand on
  a comment and remove two defines left over from an old version of the code.

  Also update man page to document the above changes, and correct grammar.

PR:		kern/127581
2010-03-17 21:19:30 +00:00
Xin LI 19d233803c MFC 178256:
Add prototype for fdopendir().

Requested by:	naddy
2010-03-17 21:11:48 +00:00
Gavin Atkinson 9111d1a218 Merge r201401 from head:
Remove dead code.  This section of code is only run in the
  (sblock.fs_magic == FS_UFS1_MAGIC) case, so the check within the
  loop is redundant.

Merge 203835 from head:

  When growing a UFS1 filesystem, we need to initialise all inodes in any new
  cylinder groups that are created.  When the filesystem is first created,
  newfs always initialises the first two blocks of inodes, and then in the
  UFS1 case will also initialise the remaining inode blocks.  The changes in
  growfs.c 1.23 broke the initialisation of all inodes, seemingly based on
  this implementation detail in newfs(8).  The result was that instead of
  initialising all inodes, we would actually end up initialising all but the
  first two blocks of inodes.  If the filesystem was grown into empty
  (all-zeros) space then the resulting filesystem was fine, however when
  grown onto non-zeroed space the filesystem produced would appear to have
  massive corruption on the first fsck after growing.
  A test case for this problem can be found in the PR audit trail.

  Fix this by once again initialising all inodes in the UFS1 case.

PR:		bin/115174
Submitted by:	"Nate Eldredge" <nge cs.hmc.edu>
Reviewed by:	mjacob
2010-03-17 20:30:37 +00:00
Gavin Atkinson 1b7f5e05bf Merge r203865 from head:
The -newerXB option was being interpreted the same as the -newerXm option
  as a check for F_TIME2_B was missing.  Fix this.

PR:		bin/138245
Submitted by:	"David E. Cross"  <crossd cs.rpi.edu>
2010-03-17 20:17:25 +00:00
Doug Barton d7e2187844 MFC r205145:
Make it more clear in the docs that -a is not compatible with -iFU,
and enforce this in the code. Apparently a lot of users mistakenly
combine -a with these flags and are then mystified that no changes
were made.

While I'm here, fix a trailing space in mergemaster.8
2010-03-17 07:26:59 +00:00
Marius Strobl 0e29edd7c2 MFC: r204222
According to the Linux sungem driver, in case of Apple (K2) GMACs
GEM_MIF_CONFIG_MDI0 cannot be trusted when the firmware has powered
down the chip so the internal transceiver has to be hardcoded. This
is also in line with the AppleGMACEthernet driver, which just doesn't
distinguish between internal/external transceiver and MDIO/MDI1
respectively in the first place. Tested by: Andreas Tobler
2010-03-15 19:13:49 +00:00
Marius Strobl 80e46283b2 MFC: r204144
Add support for BCM54K2 found in combination with Apple K2 GMAC.

Submitted by:   Andreas Tobler
Obtained from:  OpenBSD
2010-03-15 19:04:51 +00:00
Marius Strobl dc2da26ad4 MFC: r204974, r205002
- The OPSZ macro actually only does the right thing for int32 and int64
  operands but not for double and extended double ones. Instead of trying
  to fix the macro just nuke it and unroll the loops in the correct way
  though as extended double operands turn out to be the only special case.
- For FxTO{s,d,q} the source operand is int64 so rs2 has to be re-decoded
  after setting type accordingly as it's generally decoded using the low
  2 bits as the type, which are 0 for these three instructions.
- Similarly, in case of F{s,d,q}TOx the target is int64 so rd has to be
  re-decoded using not only the operand mask appropriate for int64 but
  also the correct register number encoding.
- Use const where appropriate.
- Wrap long lines.

Submitted by:	Peter Jeremy (partly)
2010-03-15 18:33:23 +00:00
Gavin Atkinson dc82e6ff42 Merge r202461 from head:
Implement an "-x" option to cp(1), for compatibility with Linux and
  feature parity with du(1) and similar:  When set, cp(1) will not traverse
  mount points.

PR:		bin/88056
Initial patch by: Graham J Lee  <leeg teaching.physics.ox.ac.uk>
2010-03-14 16:03:36 +00:00
Gavin Atkinson 33878b41be Merge r183385 from head (by cognet)
Advertise bit 26 as sse2.

PR:		kern/130724
Approved by:	cognet
2010-03-14 13:32:40 +00:00
Xin LI 50f8e33866 MFC r203760: Improve time precision for grdc(6):
Traditionally, grdc would obtain time through time(3) which in turn gets
only the second part of clock (CLOCK_SECOND), and sleep for 1 second after
each screen refresh.

This approach would have two problems.  First, we are not guaranteed to
be waken up at the beginning of a whole second, which will typically
exhibit as a "lag" on second number.  Second, because we sleep for whole
second, and the refresh process would take some time, the error would
accumulate from time to time, making the lag variable.

Make grdc(6) to use time(3) to get time only at the beginning, and sample
time in CLOCK_REALTIME_FAST granularity after refreshing, and use the
nanosecond part to caculate how much time we want to sleep.

PR:		bin/120813
2010-03-12 00:51:25 +00:00
Fabien Thomas f3497883ee MFC r204878:
Change the way shutdown is handled for log file.

 pmc_flush_logfile is now non-blocking and just ask the kernel
 to shutdown the file. From that point, no more data is
 accepted by the log thread and when the last buffer is flushed
 the file is closed.

 This will remove a deadlock between pmcstat asking for
 flush while it cannot flush the pipe itself.
2010-03-11 07:39:36 +00:00
Fabien Thomas d9a41872e2 MFC r204878:
Change the way shutdown is handled for log file.

 pmc_flush_logfile is now non-blocking and just ask the kernel
 to shutdown the file. From that point, no more data is
 accepted by the log thread and when the last buffer is flushed
 the file is closed.

 This will remove a deadlock between pmcstat asking for
 flush while it cannot flush the pipe itself.
2010-03-11 07:38:27 +00:00
Pyun YongHyeon 3ad6e7a743 MFC r204647:
Remove programming LED register and enable 25MHz TX clock for
  88E1149 PHY. This will fix intermittent watchdog timeouts as well
  as very slow network performance on 88E8072 Yukon Extreme.

  PR:	kern/144148
2010-03-10 22:23:55 +00:00
John Baldwin 612afc958d MFC 204638:
Allow lseek(SEEK_END) to work on disk devices by using the DIOCGMEDIASIZE
to determine the media size.
2010-03-10 19:49:33 +00:00
Ken Smith 1df1e1f3f3 Package set for 7.3-RELEASE.
Reviewed by:	portmgr@, re@
2010-03-10 19:00:33 +00:00
Jung-uk Kim 37eadd8918 MFC: r197438, r203810, r203813, r203935, r203936
Sync acpi_video(4) with HEAD.

r197438:
Uninline an instance of STAILQ_FOREACH_SAFE().

r203810:
Implement LCD brightness control notify handler.

r203813:
Make sanity check slightly more useful and tweak an error message.

r203935:
Add support for `cycle' and `zero' events for LCD brightness control.

r203936:
Rename some macros to clarify their intentions and fix style nits.
2010-03-10 18:13:17 +00:00
John Baldwin 885296cbb4 Revert the change to increase MAXCPU to 32 on amd64 and i386. MAXCPU is
part of the de facto KBI currently.
2010-03-10 15:47:33 +00:00
Gavin Atkinson ada6493274 Merge r202000 from head:
Don't panic on attach if we can't allocate ifp
2010-03-10 13:54:13 +00:00
Gavin Atkinson 7e42b2cf7a Merge r204053 from head:
The correct value of DEL is 0x7f, not 0xff.  This is purely a documentation
  issue - od(1) and hexdump(1) behave as expected.

PR:		docs/143869
Submitted by:	gcooper
2010-03-10 13:42:37 +00:00
John Baldwin 5be5a478d3 MFC 183525: Bump MAXCPU to 32 now that 32 CPU x86 systems exist. 2010-03-09 22:10:11 +00:00
Konstantin Belousov 6ac88ff2ad MFC r204590:
Correct mfip module dependency on mfi. This allows mfip to be loaded as
module when mfi is a module itself.
2010-03-09 13:41:33 +00:00
John Baldwin 5c43a4e1b2 Don't include disabled CPUs in the topology map. ULE assumes that all CPUs
in the topology map were present and enabled.  Booting a system with
hyperthreading and at least one CPU would cause ULE to attempt to use a
disabled CPU when rebalancing load resulting in a panic.  This is a direct
commit to 7 as the topology code is different in 8 and later.
2010-03-09 13:08:57 +00:00
John Baldwin 7beeb7e2b1 MFC 204518:
Print the contents of the miscellaneous (MISC) register to the console if
it is valid along with the other register values when a machine check is
encountered.
2010-03-08 21:42:19 +00:00
Edwin Groothuis 779c88d8c5 MFC of tzdata2010e, r204887
- Adjust beginning / end of DST in Bangladesh (minimal impact)
- Fiji ends DST one month earlier to last Sunday of March
- Samoa changes
- Chile extends DST until 3 April this year.
2010-03-08 21:29:05 +00:00
Fabien Thomas a96d21ce7b MFC r204783:
Bug fixed:
  - no display on serial terminal in top mode.
  - display alignment for continuation string.
  - correct invalid value used for display limit.
2010-03-08 08:05:02 +00:00
Konstantin Belousov 649741b0ac MFC r204464:
Several fixes for miscellaneous clone handlers in if_tun and if_tap.

Tested by:	Mikolaj Golub <to.my.trociny gmail com>
2010-03-07 20:06:06 +00:00
Gregory Neil Shapiro 418df301f3 MFC: Enable the use of nanosleep() instead of using pause() and signals.
This Makefile change can be removed when the next version of sendmail
     is imported as it will have this built in to the FreeBSD conf.h section.
2010-03-07 02:03:25 +00:00
Ivan Voras 133097bc5c MFC virtual machine guest detection code and r204420 - code to disable
superpages on buggy AMD CPUs.

Reviewed by:	alc
2010-03-06 16:45:55 +00:00
Fabien Thomas 5efea86de5 MFC 180091:
Document messages printed in verbose mode.
2010-03-05 22:59:49 +00:00
Fabien Thomas 0caf7e25da MFC 204329 partially:
Fixed dependencies (make checkdpadd).
2010-03-05 22:53:31 +00:00
Fabien Thomas b1d3291292 MFC 203790:
- Reorganize code in 'plugin' to share log processing.
- Kcachegrind (calltree) support with assembly/source
  code mapping and call count estimator (-F).
- Top mode for calltree and callgraph plugin (-T).
2010-03-05 22:43:44 +00:00
Andriy Gapon 06a72f45e1 MFC r203061: KASSERT contract of return value of interrupt filter 2010-03-05 15:19:53 +00:00
Konstantin Belousov f0e1168e19 MFC r204308:
Do not restrict the allowed signals that can be specified by number
to the list of signals that has symbolic name. It was impossible to
send rt signals with kill(1) due to the check.
2010-03-04 07:24:09 +00:00
Andriy Gapon 295dee8012 MFC r203823: kgdb: initialize n_type field of nlist entry for kvm_nlist 2010-03-02 19:08:44 +00:00
Edwin Groothuis bf2901bca8 MFC of r204566, tzdata2010c:
Paraguay changes its DST schedule, postponing the March rule to
April and modifying the October date.
2010-03-02 10:05:24 +00:00
Matt Jacob abeb0c39c5 MFC of 184830 and 196007- pull latest firmware and ispfw.c
fixes into RELENG_7
2010-03-02 01:21:33 +00:00
John Baldwin 63ade98d43 MFC: Fix spelling of EACCES. 2010-03-01 21:04:10 +00:00
Maksim Yevmenkin 371ad52614 Use start/stop instead of quietstart/quietstop. Pointy hat goes to me.
Pointed out by:	jhb
2010-03-01 18:58:18 +00:00
Matt Jacob 5365c36425 MFC of 204397: fix problems with fast posting handles 2010-03-01 17:42:06 +00:00
Andriy Gapon b93a1c9822 MFC r203546: acpi_cpu: prefer _OSC over _PDC 2010-02-28 21:45:00 +00:00
Andriy Gapon 49b53b1e99 MFC r203430: acpi_cpu: correct capabilities arguments for Processor _OSC 2010-02-28 21:32:10 +00:00
Andriy Gapon 115aa22334 MFC r203062: acpi_hpet: correctly get number of timers/comparators 2010-02-28 21:23:50 +00:00
Andriy Gapon a39c34420e MFC r203160: add static qualifier to definition of already static function 2010-02-28 21:21:29 +00:00
Gavin Atkinson fb74d2eb20 Pull mergeinfo for r192215 up to the directory 2010-02-28 11:27:03 +00:00
Gavin Atkinson a9587ac8fb Merge r204166 from head:
Document the interaction between /etc/devfs.conf and
  /etc/defaults/devfs.conf

PR:		docs/117308
Submitted by:	Mel <mel.xyzzy rachie.is-a-geek.net> (partially)
2010-02-28 11:22:42 +00:00
Matt Jacob c5fbbca5d6 MFC of 204384: Fix misallocation error in target mode 2010-02-28 06:16:41 +00:00
Alan Cox 897f132836 MFC r203085
Optimize pmap_demote_pde() by using the new KPTmap to access a kernel
  page table page instead of creating a temporary mapping to it.

  Set the PG_G bit on the page table entries that implement the KPTmap.

  Locore initializes the unused portions of the NKPT kernel page table
  pages that it allocates to zero.  So, pmap_bootstrap() needn't zero
  the page table entries referenced by CMAP1 and CMAP3.

  Simplify pmap_set_pg().
2010-02-27 18:45:32 +00:00
Kirk McKusick 5b5268a82a MFC of 203763, 203764, 203768, 203769, 203770, 203782, and 203784.
These fixes correct a problem in the file system that treats large
inode numbers as negative rather than unsigned. For a default
(16K block) file system, this bug began to show up at a file system
size above about 16Tb.

These fixes also update newfs to ensure that it will never create a
filesystem with more than 2^32 inodes.

They also update libufs, tunefs, and growfs so that they properly
handle inode numbers as unsigned.

Reported by: Scott Burns, John Kilburg, and Bruce Evans
Followup by: Jeff Roberson
PR:          133980
2010-02-27 17:55:29 +00:00
Ed Maste 7fd261657a MFC r204106:
Avoid corrupting the list or queue if _REMOVE is invoked with a
  reference to the head.

PR:		kern/119307
2010-02-27 04:02:40 +00:00
Jung-uk Kim e8bb53166c MFC: r204105
Return partially filled buffer for non-blocking read(2)
in non-immediate mode.

PR:		kern/143855
Submitted by:	Guy Harris (guy at alum dot mit dot edu)
2010-02-26 00:12:48 +00:00
Maksim Yevmenkin 0ffd34fa03 MFC: r203676
Introduce new rc.conf variable firewall_coscripts. It can be used to
specify list of executables and/or rc scripts that should be executed
after firewall starts/stops.

Submitted by:	Yuri Kurenkov <y dot kurenkov at init dot ru>
Reviewed by:	rhodes, rc@
2010-02-25 18:02:52 +00:00
Rebecca Cran 9565f40b18 MFC r203323:
Remove extra semicolon.

Approved by:	rrs (mentor)
2010-02-24 22:04:49 +00:00
Rebecca Cran fdd11dd2e0 MFC r203322:
Fix typo of ENOTCONN.
Add missing RETURN VALUES section in sctp_opt_info(3).

Approved by:	rrs (mentor)
2010-02-24 22:02:25 +00:00
Rebecca Cran e94f99fcd6 MFC r203681:
Fix typo and remove extra spaces.

Approved by:	rrs (mentor)
2010-02-24 22:00:00 +00:00
Rebecca Cran 14895c3b57 MFC r203688:
Initialize the execfile argument to NULL instead of _PATH_DEVNULL. This allows
the -M option to be used without specifying -N.

Approved by:	rrs (mentor)
2010-02-24 21:57:51 +00:00
John Baldwin 4eb2ce74f0 MFC 204090:
Fix mptutil's method for locating disk devices attached to a specific
mpt(4) controller.  Previously, the code assumed that multiple match
patterns provided to an XPT_DEV_MATCH request were ANDed together.
Instead, they are ORed.  Instead, to match peripherals for a specific bus,
one query needs to be performed to lookup the path ID of the bus.  A second
query can then be performed matching peripherals attached to that path.
This approach also makes the code a bit cleaner as the returned match
results do not mix buses and perphierals.
2010-02-24 21:29:30 +00:00
John Baldwin 9a97255f8b MFC 204086:
- Don't emit a warning in 'show adapter' if the IOC2 or IOC6 pages are not
  present.  mpt(4) controllers that do not support RAID do not have an IOC6
  page, for example.
- Correct a check for a missing page error in a debug function.
2010-02-24 21:26:27 +00:00
Gavin Atkinson fa2bd43543 Merge r202931 from head:
Add support for four more nfsmb controllers, shipping on at least the
  ASUS Atom ION boards.

PR:		kern/142571
Submitted by:	oliver
2010-02-23 22:09:42 +00:00
Gavin Atkinson 24568a3cc1 Merge r202115 from head:
Our standard "xterm" termcap entry supports colour, so this tip is redundant.
  As it happens, "xterm-color" has just been an alias for "xterm" since
  src/share/termcap/termcap.src 1.131 in September 2002.

PR:		docs/132959
2010-02-23 21:15:05 +00:00
Gavin Atkinson 7e555def00 Merge r203636 from head:
Correct arguments to free_unr(), "item" was missing.
2010-02-23 20:28:15 +00:00
Gavin Atkinson 821d69ea13 Merge r203393,r203395 from head:
The multiplicand a = 0x5deece66d = 25214903917, not 0xfdeece66d.
  This bug in the man page has gone unnoticed for over 15 years!

PR:		docs/143461
Submitted by:	Jeremy Huddleston  jeremyhu apple.com
2010-02-23 19:37:00 +00:00
Gavin Atkinson f67dce937d Merge r203620,203621 from head:
Document support for the D-Link DFE520-TX card (supported with the vr(4)
  driver)

PR:		kern/135989
Submitted by:	"Rashid N. Achilov"  citycat4 ngs.ru
2010-02-23 19:34:22 +00:00
Matt Jacob 358f059986 MFC 196008 196162 197214 197372 197373
MFC 198822 200089 201325 201408 202418
MFC 203444 203463 203478 204050

Move back into RELENG_7 the current state of isp.
2010-02-23 18:37:21 +00:00
Matt Jacob ff846dae78 MFC 203505
Add the long missing "destroy" option.
2010-02-23 07:07:46 +00:00
Ed Maste 9a075cdd6f MFC r202812:
Add H55 ID from Mike Tancsa, with minor rewording from avg@.

PR:		kern/143068
Submitted by:	Mike Tancsa (Sentex)
2010-02-23 01:24:01 +00:00
Xin LI 80883315f4 MFC r203728:
- Return EAFNOSUPPORT instead of EINVAL for unsupported address family,
   this matches the Linux behavior.
 - Check if we have sufficient space allocated for socket structure, which
   fixes a buffer overflow when wrong length is being passed into the
   emulation layer. [1]

PR:		kern/138860
Submitted by:	Mateusz Guzik <mjguzik gmail com>
Reported by:	Alexander Best [1]
2010-02-23 00:41:40 +00:00
Xin LI 0a9d59c567 MFC r203533:
Remove two files that are not needed by FreeBSD.
2010-02-22 22:41:36 +00:00
Konstantin Belousov b1e1a121d8 MFC r203818:
Clear the bp pointer when buffer is already brelse()d.

Approved by:	re (bz)
2010-02-20 12:31:00 +00:00
John Baldwin a66b41ffa6 Fix a bug where MSI interrupts on x86 were always routed to APIC ID 0 rather
than the APIC ID of the boot CPU prior to SI_SUB_SMP.  This resulted in
some storage controllers not being able to enumerate attached devices when
using MSI/MSI-X interrupts.  This only affects <= 7.x, so it is a direct
commit to 7 rather than an MFC.

Reviewed by:	scottl
Approved by:	re (kib)
2010-02-17 21:17:54 +00:00
Konstantin Belousov 8cb1e4419d MFC r203441:
Placate new binutils, by using 16-bit %ax instead of 32-bit %eax as an
argument for fnstsw. Explicitely specify sizes for the XMM control and
status word and X87 control and status words.

Approved by:	re (bz)
2010-02-17 10:27:07 +00:00
Konstantin Belousov b4b2800503 MFC r203875:
Do not leak process lock when current thread is not allowed to see target.

Approved by:	re (bz)
2010-02-17 10:15:17 +00:00
Doug Barton fcbd7a3320 Upgrade to BIND 9.4-ESV. This version incorporates all bug and security
fixes since the release of 9.4.3, including the most recent -P5 security
fix detailed below.

From the README:
BIND 9.4-ESV will be supported until December 31, 2010, at
which time you will need to upgrade to the current release
of BIND.

This versions address the following vulnerabilities:

BIND 9 Cache Update from Additional Section
https://www.isc.org/advisories/CVE-2009-4022v6
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2009-4022
A nameserver with DNSSEC validation enabled may incorrectly add
unauthenticated records to its cache that are received during the
resolution of a recursive client query

BIND 9 DNSSEC validation code could cause bogus NXDOMAIN responses
https://www.isc.org/advisories/CVE-2010-0097
http://cve.mitre.org/cgi-bin/cvename.cgi?name=CVE-2010-0097
There was an error in the DNSSEC NSEC/NSEC3 validation code that could
cause bogus NXDOMAIN responses (that is, NXDOMAIN responses for records
proven by NSEC or NSEC3 to exist) to be cached as if they had validated
correctly

These issues only affect systems with DNSSEC validation enabled.

Approved by:	re (kensmith)
2010-02-16 05:14:51 +00:00
Konstantin Belousov b807cef577 MFC r195635:
Properly set MAP_ENTRY_WIRE_SKIPPED when aborting the loop.

PR:	kern/143717 (for RELENG_7)
Approved by:	re (bz)
2010-02-13 10:42:29 +00:00
Ken Smith 9fc938161d Bump __FreeBSD_version to reflect that releng/7.3 has been branched.
Approved by:	re (implicit)
2010-02-10 04:12:55 +00:00
3321 changed files with 342213 additions and 232961 deletions

No files matched your search

+1 -1
View File
@@ -4,7 +4,7 @@
The compilation of software known as FreeBSD is distributed under the
following terms:
Copyright (c) 1992-2010 The FreeBSD Project. All rights reserved.
Copyright (c) 1992-2011 The FreeBSD Project. All rights reserved.
Redistribution and use in source and binary forms, with or without
modification, are permitted provided that the following conditions
+2
View File
@@ -295,6 +295,7 @@ universe_${target}:
"check _.${target}.buildworld for details")
@echo ">> ${target} buildworld completed on `LC_ALL=C date`"
.endif
.if !defined(MAKE_JUST_WORLDS)
.if exists(${.CURDIR}/sys/${target}/conf/NOTES)
@(cd ${.CURDIR}/sys/${target}/conf && env __MAKE_CONF=/dev/null \
${MAKE} LINT > ${.CURDIR}/_.${target}.makeLINT 2>&1 || \
@@ -310,6 +311,7 @@ universe_${target}:
echo "${target} ${kernel} kernel failed," \
"check _.${target}.${kernel} for details")
.endfor
.endif
@echo ">> ${target} completed on `LC_ALL=C date`"
.endfor
universe: universe_epilogue
+2 -1
View File
@@ -88,7 +88,7 @@ CLEANDIR= cleandir
.endif
CVS?= cvs
CVSFLAGS?= -r RELENG_7 -P -d -I!
CVSFLAGS?= -r RELENG_7_4 -P -d -I!
SUP?= /usr/bin/csup
SUPFLAGS?= -g -L 2
.if defined(SUPHOST)
@@ -263,6 +263,7 @@ LIB32WMAKEENV= MAKEOBJDIRPREFIX=${OBJTREE}/lib32 \
VERSION="${VERSION}" \
MACHINE=i386 \
MACHINE_ARCH=i386 \
MACHINE_CPU="i686 mmx sse sse2" \
INSTALL="sh ${.CURDIR}/tools/install.sh" \
PATH=${TMPPATH} \
CC="${CC} ${LIB32FLAGS}" \
+6
View File
@@ -14,6 +14,12 @@
# The file is partitioned: OLD_FILES first, then OLD_LIBS and OLD_DIRS last.
#
# 20101114: Remove long-obsolete MAKEDEV.8
OLD_FILES+=usr/share/man/man8/MAKEDEV.8.gz
# 20101112: vgonel(9) has gone to private API a while ago
OLD_FILES+=usr/share/man/man9/vgonel.9.gz
# 20101025: catch up with vm_page_sleep_if_busy rename
OLD_FILES+=usr/share/man/man9/vm_page_sleep_busy.9.gz
# 20091129: pecoff image activator removed
.if ${TARGET_ARCH} == "i386"
OLD_FILES+=usr/include/machine/pecoff_machdep.h
+12
View File
@@ -8,6 +8,18 @@ Items affecting the ports and packages system can be found in
/usr/ports/UPDATING. Please read that file before running
portupgrade.
20110221:
FreeBSD 7.4-RELEASE
20101126:
New version of minidump format for amd64 architecture was
introduced in r215874. To analyze vmcore files produced by
kernels at or after this version you will need updated userland,
libkvm actually, that is able to handle the new version.
20100323:
FreeBSD 7.3-RELEASE
20091129:
PECOFF image activator support removed.
+1
View File
@@ -1072,6 +1072,7 @@ find_element(char *voltag, uint16_t *et, uint16_t *eu)
/* Read in the changer slots */
if (cp.cp_nslots > 0) {
(void) memset(&cesr, 0, sizeof(cesr));
cesr.cesr_element_type = CHET_ST;
cesr.cesr_element_base = 0;
cesr.cesr_element_count = cp.cp_nslots;
+5 -3
View File
@@ -32,7 +32,7 @@
.\" @(#)cp.1 8.3 (Berkeley) 4/18/94
.\" $FreeBSD$
.\"
.Dd October 27, 2006
.Dd January 17, 2010
.Dt CP 1
.Os
.Sh NAME
@@ -45,7 +45,7 @@
.Op Fl H | Fl L | Fl P
.Oc
.Op Fl f | i | n
.Op Fl alpv
.Op Fl alpvx
.Ar source_file target_file
.Nm
.Oo
@@ -53,7 +53,7 @@
.Op Fl H | Fl L | Fl P
.Oc
.Op Fl f | i | n
.Op Fl alpv
.Op Fl alpvx
.Ar source_file ... target_directory
.Sh DESCRIPTION
In the first synopsis form, the
@@ -183,6 +183,8 @@ permissions.
Cause
.Nm
to be verbose, showing files as they are copied.
.It Fl x
File system mount points are not traversed.
.El
.Pp
For each destination file that already exists, its contents are
+5 -2
View File
@@ -101,8 +101,9 @@ main(int argc, char *argv[])
int Hflag, Lflag, Pflag, ch, fts_options, r, have_trailing_slash;
char *target;
fts_options = FTS_NOCHDIR | FTS_PHYSICAL;
Hflag = Lflag = Pflag = 0;
while ((ch = getopt(argc, argv, "HLPRafilnprv")) != -1)
while ((ch = getopt(argc, argv, "HLPRafilnprvx")) != -1)
switch (ch) {
case 'H':
Hflag = 1;
@@ -150,6 +151,9 @@ main(int argc, char *argv[])
case 'v':
vflag = 1;
break;
case 'x':
fts_options |= FTS_XDEV;
break;
default:
usage();
break;
@@ -160,7 +164,6 @@ main(int argc, char *argv[])
if (argc < 2)
usage();
fts_options = FTS_NOCHDIR | FTS_PHYSICAL;
if (Rflag && rflag)
errx(1, "the -R and -r options may not be specified together");
if (rflag)
+2 -2
View File
@@ -429,8 +429,8 @@ usage(void)
{
(void)fprintf(stderr, "%s\n%s\n",
"usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpv] source_file target_file",
" cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpv] source_file ... "
"usage: cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpvx] source_file target_file",
" cp [-R [-H | -L | -P]] [-f | -i | -n] [-alpvx] source_file ... "
"target_directory");
exit(EX_USAGE);
}
+24 -11
View File
@@ -32,7 +32,7 @@
.\" @(#)echo.1 8.1 (Berkeley) 7/22/93
.\" $FreeBSD$
.\"
.Dd April 12, 2003
.Dd November 12, 2010
.Dt ECHO 1
.Os
.Sh NAME
@@ -56,24 +56,37 @@ The following option is available:
.Bl -tag -width flag
.It Fl n
Do not print the trailing newline character.
This may also be achieved by appending
.El
.Pp
The end-of-options marker
.Fl Fl
is not recognized and written literally.
.Pp
The newline may also be suppressed by appending
.Ql \ec
to the end of the string, as is done
by iBCS2 compatible systems.
Note that this option as well as the effect of
Note that the
.Fl n
option as well as the effect of
.Ql \ec
are implementation-defined in
.St -p1003.1-2001
as amended by Cor.\& 1-2002.
Applications aiming for maximum
portability are strongly encouraged to use
.Xr printf 1
to suppress the newline character.
.El
.Pp
Some shells may provide a builtin
For portability,
.Nm
command which is similar or identical to this utility.
should only be used if the first argument does not start with a hyphen
.Pq Ql "-"
and does not contain any backslashes
.Pq Ql "\e" .
If this is not sufficient,
.Xr printf 1
should be used.
.Pp
Most shells provide a builtin
.Nm
command which tends to differ from this utility
in the treatment of options and backslashes.
Consult the
.Xr builtin 1
manual page.
+21 -10
View File
@@ -30,7 +30,7 @@
.\"
.\" $FreeBSD$
.\"
.Dd July 12, 2004
.Dd September 9, 2010
.Dt EXPR 1
.Os
.Sh NAME
@@ -217,6 +217,9 @@ command, one might rearrange the expression:
More generally, parenthesize possibly-negative values:
.Dl "a=$(expr \e( $a \e) + 1)"
.It
With shell arithmetic, no escaping is required:
.Dl "a=$((a + 1))"
.It
This example prints the filename portion of a pathname stored
in variable
.Va a .
@@ -229,6 +232,12 @@ The
.Li //
characters resolve this ambiguity.
.Dl "expr \*q//$a\*q \&: '.*/\e(.*\e)'"
.It
With modern
.Xr sh 1
syntax,
.Dl "\*q${a##*/}\*q"
expands to the same value.
.El
.Pp
The following examples output the number of characters in variable
@@ -237,19 +246,21 @@ Again, if
.Va a
might begin with a hyphen, it is necessary to prevent it from being
interpreted as an option to
.Nm .
.Nm ,
and
.Va a
might be interpreted as an operator.
.Bl -bullet
.It
If the
.Nm
command conforms to
.St -p1003.1-2001 ,
this is simple:
.Dl "expr -- \*q$a\*q \&: \*q.*\*q"
.It
For portability to older systems, however, a more complicated command
To deal with all of this, a complicated command
is required:
.Dl "expr \e( \*qX$a\*q \&: \*q.*\*q \e) - 1"
.It
With modern
.Xr sh 1
syntax, this can be done much more easily:
.Dl "${#a}"
expands to the required number.
.El
.Sh SEE ALSO
.Xr sh 1 ,
+1 -1
View File
@@ -108,7 +108,7 @@ main(int argc, char *argv[])
numsig = strtol(*argv, &ep, 10);
if (!**argv || *ep)
errx(1, "illegal signal number: %s", *argv);
if (numsig < 0 || numsig >= sys_nsig)
if (numsig < 0)
nosig(*argv);
} else
nosig(*argv);
+3 -3
View File
@@ -29,7 +29,7 @@
.\" @(#)symlink.7 8.3 (Berkeley) 3/31/94
.\" $FreeBSD$
.\"
.Dd March 31, 1994
.Dd April 25, 2010
.Dt SYMLINK 7
.Os
.Sh NAME
@@ -138,8 +138,8 @@ an existing symbolic link can be changed by means of the
and
.Xr lutimes 2
system calls, respectively.
Of these, only the flags are used by the system;
the access permissions and ownership are ignored.
Of these, only the flags and ownership are used by the system;
the access permissions are ignored.
.Pp
The
.Bx 4.4
+1 -1
View File
@@ -504,7 +504,7 @@ traverse(int argc, char *argv[], int options)
break;
case FTS_DNR:
case FTS_ERR:
warnx("%s: %s", p->fts_name, strerror(p->fts_errno));
warnx("%s: %s", p->fts_path, strerror(p->fts_errno));
rval = 1;
break;
case FTS_D:
-3
View File
@@ -29,9 +29,6 @@ PROG= pax
SRCS= ar_io.c ar_subs.c buf_subs.c cache.c cpio.c file_subs.c ftree.c \
gen_subs.c getoldopt.c options.c pat_rep.c pax.c sel_subs.c \
tables.c tar.c tty_subs.c
#XXX NOTYET
#MAN= pax.1 tar.1 cpio.1
#LINKS= ${BINDIR}/pax ${BINDIR}/tar ${BINDIR}/pax ${BINDIR}/cpio
.if ${MACHINE_ARCH} == "arm"
WARNS?= 3
-304
View File
@@ -1,304 +0,0 @@
.\"-
.\" Copyright (c) 1997 SigmaSoft, Th. Lockert
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by SigmaSoft, Th. Lockert.
.\" 4. The name of the author may not be used to endorse or promote products
.\" derived from this software without specific prior written permission
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $OpenBSD: cpio.1,v 1.16 2001/05/01 17:58:01 aaron Exp $
.\" $FreeBSD$
.\"
.Dd February 16, 1997
.Dt CPIO 1
.Os
.Sh NAME
.Nm cpio
.Nd copy file archives in and out
.Sh SYNOPSIS
.Nm
.Fl o
.Op Fl aABcLvzZ
.Op Fl C Ar bytes
.Op Fl F Ar archive
.Op Fl H Ar format
.Op Fl O Ar archive
.No < Ar name-list
.Op No > Ar archive
.Nm
.Fl i
.Op Fl bBcdfmrsStuvzZ6
.Op Fl C Ar bytes
.Op Fl E Ar file
.Op Fl F Ar archive
.Op Fl H Ar format
.Op Fl I Ar archive
.Op Ar pattern ...
.Op No < Ar archive
.Nm
.Fl p
.Op Fl adlLmuv
.Ar destination-directory
.No < Ar name-list
.Sh DESCRIPTION
The
.Nm
command copies files to and from a
.Nm
archive.
.Pp
The options are as follows:
.Bl -tag -width indent
.It Fl o
Create an archive.
Reads the list of files to store in the
archive from standard input, and writes the archive on standard
output.
.Bl -tag -width indent
.It Fl a
Reset the access times on files that have been copied to the
archive.
.It Fl A
Append to the specified archive.
.It Fl B
Set block size of output to 5120 bytes.
.It Fl c
Use
.Tn ASCII
format for
.Nm
header for portability.
.It Fl C Ar bytes
Set the block size of output to
.Ar bytes .
.It Fl F Ar archive
.It Fl O Ar archive
Use the specified file name as the archive to write to.
.It Fl H Ar format
Write the archive in the specified format.
Recognized formats are:
.Pp
.Bl -tag -width sv4cpio -compact
.It Cm bcpio
Old binary
.Nm
format.
.It Cm cpio
Old octal character
.Nm
format.
.It Cm sv4cpio
.Tn SVR4
hex
.Nm
format.
.It Cm tar
Old tar format.
.It Cm ustar
.Tn POSIX
ustar format.
.El
.It Fl L
Follow symbolic links.
.It Fl v
Be verbose about operations.
List filenames as they are written to the archive.
.It Fl z
Compress archive using
.Xr gzip 1
format.
.It Fl Z
Compress archive using
.Xr compress 1
format.
.El
.It Fl i
Restore files from an archive.
Reads the archive file from
standard input and extracts files matching the
.Ar patterns
that were specified on the command line.
.Bl -tag -width indent
.It Fl b
Do byte and word swapping after reading in data from the
archive, for restoring archives created on systems with
a different byte order.
.It Fl B
Set the block size of the archive being read to 5120 bytes.
.It Fl c
Expect the archive headers to be in
.Tn ASCII
format.
.It Fl C Ar bytes
Read archive written with a block size of
.Ar bytes .
.It Fl d
Create any intermediate directories as needed during
restore.
.It Fl E Ar file
Read list of file name patterns to extract or list from
.Ar file .
.It Fl f
Restore all files except those matching the
.Ar patterns
given on the command line.
.It Fl F Ar archive , Fl I Ar archive
Use the specified file as the input for the archive.
.It Fl H Ar format
Read an archive of the specified format.
Recognized formats are:
.Pp
.Bl -tag -width sv4cpio -compact
.It Cm bcpio
Old binary
.Nm
format.
.It Cm cpio
Old octal character
.Nm
format.
.It Cm sv4cpio
.Tn SVR4
hex
.Nm
format.
.It Cm tar
Old tar format.
.It Cm ustar
.Tn POSIX
ustar format.
.El
.It Fl m
Restore modification times on files.
.It Fl r
Rename restored files interactively.
.It Fl s
Swap bytes after reading data from the archive.
.It Fl S
Swap words after reading data from the archive.
.It Fl t
Only list the contents of the archive, no files or
directories will be created.
.It Fl u
Overwrite files even when the file in the archive is
older than the one that will be overwritten.
.It Fl v
Be verbose about operations.
List filenames as they are copied in from the archive.
.It Fl z
Uncompress archive using
.Xr gzip 1
format.
.It Fl Z
Uncompress archive using
.Xr compress 1
format.
.It Fl 6
Process old-style
.Nm
format archives.
.El
.It Fl p
Copy files from one location to another in a single pass.
The list of files to copy are read from standard input and
written out to a directory relative to the specified
.Ar directory
argument.
.Bl -tag -width indent
.It Fl a
Reset the access times on files that have been copied.
.It Fl d
Create any intermediate directories as needed to write
the files at the new location.
.It Fl l
When possible, link files rather than creating an
extra copy.
.It Fl L
Follow symbolic links.
.It Fl m
Restore modification times on files.
.It Fl u
Overwrite files even when the original file being copied is
older than the one that will be overwritten.
.It Fl v
Be verbose about operations.
List filenames as they are copied.
.El
.El
.Sh ENVIRONMENT
.Bl -tag -width TMPDIR
.It Ev TMPDIR
Path in which to store temporary files.
.El
.Sh EXIT STATUS
The
.Nm
utility will exit with one of the following values:
.Bl -tag -width 2n
.It 0
All files were processed successfully.
.It 1
An error occurred.
.El
.Pp
Whenever
.Nm
cannot create a file or a link when extracting an archive or cannot
find a file while writing an archive, or cannot preserve the user
ID, group ID, file mode, or access and modification times when the
.Fl p
option is specified, a diagnostic message is written to standard
error and a non-zero exit value will be returned, but processing
will continue.
In the case where
.Nm
cannot create a link to a file,
.Nm
will not create a second copy of the file.
.Pp
If the extraction of a file from an archive is prematurely terminated
by a signal or error,
.Nm
may have only partially extracted the file the user wanted.
Additionally, the file modes of extracted files and directories may
have incorrect file bits, and the modification and access times may
be wrong.
.Pp
If the creation of an archive is prematurely terminated by a signal
or error,
.Nm
may have only partially created the archive which may violate the
specific archive format specification.
.Sh SEE ALSO
.Xr pax 1 ,
.Xr tar 1
.Sh AUTHORS
.An Keith Muller
at the University of California, San Diego.
.Sh BUGS
The
.Fl s
and
.Fl S
options are currently not implemented.
+4 -2
View File
@@ -33,7 +33,7 @@
.\" @(#)pax.1 8.4 (Berkeley) 4/18/94
.\" $FreeBSD$
.\"
.Dd July 3, 2004
.Dd August 29, 2010
.Dt PAX 1
.Os
.Sh NAME
@@ -748,7 +748,9 @@ The extended tar interchange format specified in the
.St -p1003.2
standard.
The default blocksize for this format is 10240 bytes.
Pathnames stored by this format must be 250 characters or less in length.
Pathnames stored by this format must be 255 characters or less in length.
The directory part may be at most 155 characters and each path component
must be less than 100 characters.
.El
.Pp
The
-310
View File
@@ -1,310 +0,0 @@
.\"-
.\" Copyright (c) 1996 SigmaSoft, Th. Lockert
.\" All rights reserved.
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 3. All advertising materials mentioning features or use of this software
.\" must display the following acknowledgement:
.\" This product includes software developed by SigmaSoft, Th. Lockert.
.\" 4. The name of the author may not be used to endorse or promote products
.\" derived from this software without specific prior written permission
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR
.\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES
.\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED.
.\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT,
.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT
.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
.\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
.\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF
.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
.\"
.\" $OpenBSD: tar.1,v 1.33 2001/05/01 17:58:01 aaron Exp $
.\" $FreeBSD$
.\"
.Dd February 7, 2001
.Dt TAR 1
.Os
.Sh NAME
.Nm tar
.Nd tape archiver
.Sh SYNOPSIS
.Nm
.Sm off
.Op Fl
.Brq Cm crtux
.Op Cm befhjmopqsvwyzHLOPXZ014578
.Sm on
.Op Ar blocksize
.Op Ar archive
.Op Ar replstr
.\" XXX how to do this right?
.Op Fl C Ar directory
.Op Fl I Ar file
.Op Ar
.Sh DESCRIPTION
The
.Nm
command creates, adds files to, or extracts files from an
archive file in
.Nm
format.
A
.Nm
archive is often stored on a magnetic tape, but can be
stored equally well on a floppy, CD-ROM, or in a regular disk file.
.Pp
One of the following flags must be present:
.Bl -tag -width indent
.It Fl c
Create new archive, or overwrite an existing archive,
adding the specified files to it.
.It Fl r
Append the named new files to existing archive.
Note that this will only work on media on which an end-of-file mark
can be overwritten.
.It Fl t
List contents of archive.
If any files are named on the
command line, only those files will be listed.
.It Fl u
Alias for
.Fl r .
.It Fl x
Extract files from archive.
If any files are named on the
command line, only those files will be extracted from the
archive.
If more than one copy of a file exists in the
archive, later copies will overwrite earlier copies during
extraction.
The file mode and modification time are preserved
if possible.
The file mode is subject to modification by the
.Xr umask 2 .
.El
.Pp
In addition to the flags mentioned above, any of the following
flags may be used:
.Bl -tag -width indent
.It Fl b Ar "blocking factor"
Set blocking factor to use for the archive, with 512 byte blocks.
The default is 20, the maximum is 126.
Archives with a blocking factor larger 63 violate the
.Tn POSIX
standard and will not be portable to all systems.
.It Fl e
Stop after first error.
.It Fl f Ar archive
Filename where the archive is stored.
Defaults to
.Pa /dev/sa0 .
.It Fl h
Follow symbolic links as if they were normal files
or directories.
.It Fl j
Compress archives using
.Xr bzip2 1 .
.It Fl m
Do not preserve modification time.
.It Fl O
Write old-style
.Pq non- Ns Tn POSIX
archives.
.It Fl o
Do not write directory information that the older (V7) style
.Nm
is unable to decode.
This implies the
.Fl O
flag.
.It Fl p
Preserve user and group ID as well as file mode regardless of
the current
.Xr umask 2 .
The setuid and setgid bits are only preserved if the user is
the superuser.
Only meaningful in conjunction with the
.Fl x
flag.
.It Fl q
Select the first archive member that matches each
.Ar pattern
operand.
No more than one archive member is matched for each
.Ar pattern .
When members of type directory are matched, the file hierarchy rooted at that
directory is also matched.
.It Fl s Ar replstr
Modify the file or archive member names specified by the
.Ar pattern
or
.Ar file
operands according to the substitution expression
.Ar replstr ,
using the syntax of the
.Xr ed 1
utility regular expressions.
The format of these regular expressions are:
.Dl /old/new/[gp]
As in
.Xr ed 1 ,
.Cm old
is a basic regular expression and
.Cm new
can contain an ampersand
.Pq Ql & ,
.Li \e Ns Ar n
(where
.Ar n
is a digit) back-references,
or subexpression matching.
The
.Cm old
string may also contain newline characters.
Any non-null character can be used as a delimiter
.Ql ( /
is shown here).
Multiple
.Fl s
expressions can be specified.
The expressions are applied in the order they are specified on the
command line, terminating with the first successful substitution.
The optional trailing
.Cm g
continues to apply the substitution expression to the pathname substring
which starts with the first character following the end of the last successful
substitution.
The first unsuccessful substitution stops the operation of the
.Cm g
option.
The optional trailing
.Cm p
will cause the final result of a successful substitution to be written to
standard error
in the following format:
.Pp
.Dl <original pathname> >> <new pathname>
.Pp
File or archive member names that substitute to the empty string
are not selected and will be skipped.
.It Fl v
Verbose operation mode.
.It Fl w
Interactively rename files.
This option causes
.Nm
to prompt the user for the filename to use when storing or
extracting files in an archive.
.It Fl y
Compress archives using
.Xr bzip2 1 .
.It Fl z
Compress archive using
.Xr gzip 1 .
.It Fl C Ar directory
This is a positional argument which sets the working directory for the
following files.
When extracting, files will be extracted into
the specified directory; when creating, the specified files will be matched
from the directory.
.It Fl H
Follow symlinks given on command line only.
.It Fl L
Follow all symlinks.
.It Fl P
Do not strip leading slashes
.Pq Ql /
from pathnames.
The default is to strip leading slashes.
.It Fl I Ar file
This is a positional argument which reads the names of files to
archive or extract from the given file, one per line.
.It Fl X
Do not cross mount points in the file system.
.It Fl Z
Compress archive using
.Xr compress 1 .
.El
.Pp
The options
.Op Fl 014578
can be used to select one of the compiled-in backup devices,
.Pa /dev/rst Ns Ar N .
.Sh ENVIRONMENT
.Bl -tag -width TMPDIR
.It Ev TMPDIR
Path in which to store temporary files.
.It Ev TAPE
Default tape device to use instead of
.Pa /dev/sa0 .
.El
.Sh FILES
.Bl -tag -width "/dev/sa0"
.It Pa /dev/sa0
default archive name
.El
.Sh EXIT STATUS
The
.Nm
utility will exit with one of the following values:
.Bl -tag -width 2n
.It 0
All files were processed successfully.
.It 1
An error occurred.
.El
.Pp
Whenever
.Nm
cannot create a file or a link when extracting an archive or cannot
find a file while writing an archive, or cannot preserve the user
ID, group ID, file mode, or access and modification times when the
.Fl p
option is specified, a diagnostic message is written to standard
error and a non-zero exit value will be returned, but processing
will continue.
In the case where
.Nm
cannot create a link to a file,
.Nm
will not create a second copy of the file.
.Pp
If the extraction of a file from an archive is prematurely terminated
by a signal or error,
.Nm
may have only partially extracted the file the user wanted.
Additionally, the file modes of extracted files and directories may
have incorrect file bits, and the modification and access times may
be wrong.
.Pp
If the creation of an archive is prematurely terminated by a signal
or error,
.Nm
may have only partially created the archive which may violate the
specific archive format specification.
.Sh COMPATIBILITY
The
.Fl L
flag is not portable to other versions of
.Nm
where it may have a different meaning.
.Sh SEE ALSO
.Xr cpio 1 ,
.Xr pax 1
.Sh HISTORY
A
.Nm
command first appeared in
.At v7 .
.Sh AUTHORS
.An Keith Muller
at the University of California, San Diego.
+2 -2
View File
@@ -1086,7 +1086,7 @@ name_split(char *name, int len)
*/
if (len <= TNMSZ)
return(name);
if (len > (TPFSZ + TNMSZ + 1))
if (len > TPFSZ + TNMSZ)
return(NULL);
/*
@@ -1095,7 +1095,7 @@ name_split(char *name, int len)
* to find the biggest piece to fit in the name field (or the smallest
* prefix we can find)
*/
start = name + len - TNMSZ - 1;
start = name + len - TNMSZ;
while ((*start != '\0') && (*start != '/'))
++start;
+2 -1
View File
@@ -212,7 +212,8 @@ main(int argc, char *argv[])
init_list(&sesslist, addelem_pid, sizeof(pid_t), "session id");
init_list(&ttylist, addelem_tty, sizeof(dev_t), "tty");
init_list(&uidlist, addelem_uid, sizeof(uid_t), "user");
memf = nlistf = _PATH_DEVNULL;
memf = _PATH_DEVNULL;
nlistf = NULL;
while ((ch = getopt(argc, argv, PS_ARGS)) != -1)
switch ((char)ch) {
case 'A':
+5 -2
View File
@@ -21,12 +21,12 @@ LDADD= -ll -ledit -ltermcap
LFLAGS= -8 # 8-bit lex scanner for arithmetic
CFLAGS+=-DSHELL -I. -I${.CURDIR}
# for debug:
# CFLAGS+= -g -DDEBUG=2
# DEBUG_FLAGS+= -g -DDEBUG=2 -fno-inline
WARNS?= 2
WFORMAT=0
.PATH: ${.CURDIR}/bltin \
${.CURDIR}/../../bin/test
${.CURDIR}/../test
CLEANFILES+= mkinit mkinit.o mknodes mknodes.o \
mksyntax mksyntax.o
@@ -62,4 +62,7 @@ syntax.c syntax.h: mksyntax
token.h: mktokens
sh ${.CURDIR}/mktokens
regress:
cd ${.CURDIR}/../../tools/regression/bin/sh && ${MAKE} SH=${.OBJDIR}/sh
.include <bsd.prog.mk>
-114
View File
@@ -1,114 +0,0 @@
.\"-
.\" Copyright (c) 1991, 1993
.\" The Regents of the University of California. All rights reserved.
.\"
.\" This code is derived from software contributed to Berkeley by
.\" Kenneth Almquist.
.\" Copyright 1989 by Kenneth Almquist
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
.\" are met:
.\" 1. Redistributions of source code must retain the above copyright
.\" notice, this list of conditions and the following disclaimer.
.\" 2. Redistributions in binary form must reproduce the above copyright
.\" notice, this list of conditions and the following disclaimer in the
.\" documentation and/or other materials provided with the distribution.
.\" 4. Neither the name of the University nor the names of its contributors
.\" may be used to endorse or promote products derived from this software
.\" without specific prior written permission.
.\"
.\" THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
.\" ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
.\" IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
.\" ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
.\" FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
.\" DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
.\" OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
.\" HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
.\" LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
.\" OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
.\" SUCH DAMAGE.
.\"
.\" @(#)echo.1 8.2 (Berkeley) 5/4/95
.\" $FreeBSD$
.\"
.Dd May 4, 1995
.Dt ECHO 1
.Os
.Sh NAME
.Nm echo
.Nd produce message in a shell script
.Sh SYNOPSIS
.Nm
.Op Fl n | Fl e
.Ar args...
.Sh DESCRIPTION
The
.Nm
utility prints its arguments on the standard output, separated by spaces.
Unless the
.Fl n
option is present, a newline is output following the arguments.
The
.Fl e
option causes
.Nm
to treat the escape sequences specially, as described in the following
paragraph.
The
.Fl e
option is the default, and is provided solely for compatibility with
other systems.
Only one of the options
.Fl n
and
.Fl e
may be given.
.Pp
If any of the following sequences of characters is encountered during
output, the sequence is not output.
Instead, the specified action is
performed:
.Bl -tag -width indent
.It Li \eb
A backspace character is output.
.It Li \ec
Subsequent output is suppressed.
This is normally used at the end of the
last argument to suppress the trailing newline that
.Nm
would otherwise output.
.It Li \ef
Output a form feed.
.It Li \en
Output a newline character.
.It Li \er
Output a carriage return.
.It Li \et
Output a (horizontal) tab character.
.It Li \ev
Output a vertical tab.
.It Li \e0 Ns Ar digits
Output the character whose value is given by zero to three digits.
If there are zero digits, a
.Dv NUL
character is output.
.It Li \e\e
Output a backslash.
.El
.Sh HINTS
Remember that backslash is special to the shell and needs to be escaped.
To output a message to standard error, say
.Pp
.D1 echo message >&2
.Sh BUGS
The octal character escape mechanism
.Pq Li \e0 Ns Ar digits
differs from the
C language mechanism.
.Pp
There is no way to force
.Nm
to treat its arguments literally, rather than interpreting them as
options and escape sequences.
+28 -21
View File
@@ -70,7 +70,7 @@ STATIC int docd(char *, int, int);
STATIC char *getcomponent(void);
STATIC char *findcwd(char *);
STATIC void updatepwd(char *);
STATIC char *getpwd2(char *, size_t);
STATIC char *getpwd2(void);
STATIC char *curdir = NULL; /* current working directory */
STATIC char *prevdir; /* previous working directory */
@@ -263,10 +263,8 @@ findcwd(char *dir)
* any more because we traversed a symbolic link or something
* we couldn't stat().
*/
if (dir == NULL || curdir == NULL) {
p = stalloc(PATH_MAX);
return getpwd2(p, PATH_MAX);
}
if (dir == NULL || curdir == NULL)
return getpwd2();
cdcomppath = stalloc(strlen(dir) + 1);
scopy(dir, cdcomppath);
STARTSTACKSTR(new);
@@ -313,7 +311,7 @@ updatepwd(char *dir)
int
pwdcmd(int argc, char **argv)
{
char buf[PATH_MAX];
char *p;
int ch, phys;
optreset = 1; optind = 1; opterr = 0; /* initialize getopt */
@@ -341,9 +339,9 @@ pwdcmd(int argc, char **argv)
out1str(curdir);
out1c('\n');
} else {
if (getcwd(buf, sizeof(buf)) == NULL)
if ((p = getpwd2()) == NULL)
error(".: %s", strerror(errno));
out1str(buf);
out1str(p);
out1c('\n');
}
@@ -356,36 +354,45 @@ pwdcmd(int argc, char **argv)
char *
getpwd(void)
{
char buf[PATH_MAX];
char *p;
if (curdir)
return curdir;
p = getpwd2(buf, sizeof(buf));
p = getpwd2();
if (p != NULL)
curdir = savestr(p);
return curdir;
}
#define MAXPWD 256
/*
* Return the current directory.
*/
STATIC char *
getpwd2(char *buf, size_t size)
getpwd2(void)
{
if (getcwd(buf, size) == NULL) {
char *pwd = getenv("PWD");
struct stat stdot, stpwd;
struct stat stdot, stpwd;
char *pwd;
int i;
if (pwd && *pwd == '/' && stat(".", &stdot) != -1 &&
stat(pwd, &stpwd) != -1 &&
stdot.st_dev == stpwd.st_dev &&
stdot.st_ino == stpwd.st_ino) {
for (i = MAXPWD;; i *= 2) {
pwd = stalloc(i);
if (getcwd(pwd, i) != NULL)
return pwd;
}
return NULL;
stunalloc(pwd);
if (errno != ERANGE)
break;
}
return buf;
pwd = getenv("PWD");
if (pwd && *pwd == '/' && stat(".", &stdot) != -1 &&
stat(pwd, &stpwd) != -1 &&
stdot.st_dev == stpwd.st_dev &&
stdot.st_ino == stpwd.st_ino) {
return pwd;
}
return NULL;
}
+6 -3
View File
@@ -83,6 +83,7 @@ MKINIT int evalskip; /* set if we are skipping commands */
STATIC int skipcount; /* number of levels to skip */
MKINIT int loopnest; /* current loop nesting level */
int funcnest; /* depth of function calls */
STATIC int builtin_flags; /* evalcommand flags for builtins */
char *commandname;
@@ -147,7 +148,7 @@ evalcmd(int argc, char **argv)
STPUTC('\0', concat);
p = grabstackstr(concat);
}
evalstring(p);
evalstring(p, builtin_flags & EV_TESTED);
}
return exitstatus;
}
@@ -158,7 +159,7 @@ evalcmd(int argc, char **argv)
*/
void
evalstring(char *s)
evalstring(char *s, int flags)
{
union node *n;
struct stackmark smark;
@@ -166,7 +167,8 @@ evalstring(char *s)
setstackmark(&smark);
setinputstring(s, 1);
while ((n = parsecmd(0)) != NEOF) {
evaltree(n, 0);
if (n != NULL)
evaltree(n, flags);
popstackmark(&smark);
}
popfile();
@@ -840,6 +842,7 @@ evalcommand(union node *cmd, int flags, struct backcmd *backcmd)
commandname = argv[0];
argptr = argv + 1;
optptr = NULL; /* initialize nextopt */
builtin_flags = flags;
exitstatus = (*builtinfunc[cmdentry.u.index])(argc, argv);
flushall();
cmddone:
+1 -1
View File
@@ -46,7 +46,7 @@ struct backcmd { /* result of evalbackcmd */
};
int evalcmd(int, char **);
void evalstring(char *);
void evalstring(char *, int);
union node; /* BLETCH for ansi C */
void evaltree(union node *, int);
void evalbackcmd(union node *, struct backcmd *);
+65 -44
View File
@@ -1,6 +1,8 @@
/*-
* Copyright (c) 1991, 1993
* The Regents of the University of California. All rights reserved.
* Copyright (c) 1997-2005
* Herbert Xu <herbert@gondor.apana.org.au>. All rights reserved.
*
* This code is derived from software contributed to Berkeley by
* Kenneth Almquist.
@@ -137,12 +139,18 @@ expandhere(union node *arg, int fd)
/*
* Perform variable substitution and command substitution on an argument,
* placing the resulting list of arguments in arglist. If EXP_FULL is true,
* perform splitting and file name expansion. When arglist is NULL, perform
* here document expansion.
* Perform expansions on an argument, placing the resulting list of arguments
* in arglist. Parameter expansion, command substitution and arithmetic
* expansion are always performed; additional expansions can be requested
* via flag (EXP_*).
* The result is left in the stack string.
* When arglist is NULL, perform here document expansion. A partial result
* may be written to herefd, which is then not included in the stack string.
*
* Caution: this function uses global state and is not reentrant.
* However, a new invocation after an interrupted invocation is safe
* and will reset the global state for the new call.
*/
void
expandarg(union node *arg, struct arglist *arglist, int flag)
{
@@ -194,11 +202,14 @@ expandarg(union node *arg, struct arglist *arglist, int flag)
/*
* Perform variable and command substitution. If EXP_FULL is set, output CTLESC
* characters to allow for further processing. Otherwise treat
* $@ like $* since no splitting will be performed.
* Perform parameter expansion, command substitution and arithmetic
* expansion, and tilde expansion if requested via EXP_TILDE/EXP_VARTILDE.
* Processing ends at a CTLENDVAR character as well as '\0'.
* This is used to expand word in ${var+word} etc.
* If EXP_FULL, EXP_CASE or EXP_REDIR are set, keep and/or generate CTLESC
* characters to allow for further processing.
* If EXP_FULL is set, also preserve CTLQUOTEMARK characters.
*/
STATIC void
argstr(char *p, int flag)
{
@@ -211,7 +222,7 @@ argstr(char *p, int flag)
for (;;) {
switch (c = *p++) {
case '\0':
case CTLENDVAR: /* ??? */
case CTLENDVAR:
goto breakloop;
case CTLQUOTEMARK:
/* "$@" syntax adherence hack */
@@ -261,6 +272,10 @@ argstr(char *p, int flag)
breakloop:;
}
/*
* Perform tilde expansion, placing the result in the stack string and
* returning the next position in the input string to process.
*/
STATIC char *
exptilde(char *p, int flag)
{
@@ -361,12 +376,11 @@ expari(int flag)
int quotes = flag & (EXP_FULL | EXP_CASE | EXP_REDIR);
int quoted;
/*
* This routine is slightly over-complicated for
* efficiency. First we make sure there is
* enough space for the result, which may be bigger
* than the expression if we add exponentiation. Next we
* than the expression. Next we
* scan backwards looking for the start of arithmetic. If the
* next previous character is a CTLESC character, then we
* have to rescan starting from the beginning since CTLESC
@@ -405,9 +419,8 @@ expari(int flag)
/*
* Expand stuff in backwards quotes.
* Perform command substitution.
*/
STATIC void
expbackq(union node *cmd, int quoted, int flag)
{
@@ -959,6 +972,12 @@ recordregion(int start, int end, int nulonly)
* Break the argument string into pieces based upon IFS and add the
* strings to the argument list. The regions of the string to be
* searched for IFS characters have been stored by recordregion.
* CTLESC characters are preserved but have little effect in this pass
* other than escaping CTL* characters. In particular, they do not escape
* IFS characters: that should be done with the ifsregion mechanism.
* CTLQUOTEMARK characters are used to preserve empty quoted strings.
* This pass treats them as a regular character, making the string non-empty.
* Later, they are removed along with the other CTL* characters.
*/
STATIC void
ifsbreakup(char *string, struct arglist *arglist)
@@ -1046,15 +1065,14 @@ ifsbreakup(char *string, struct arglist *arglist)
}
STATIC char expdir[PATH_MAX];
#define expdir_end (expdir + sizeof(expdir))
/*
* Expand shell metacharacters. At this point, the only control characters
* should be escapes. The results are stored in the list exparg.
* Perform pathname generation and remove control characters.
* At this point, the only control characters should be CTLESC and CTLQUOTEMARK.
* The results are stored in the list exparg.
*/
STATIC char *expdir;
STATIC void
expandmeta(struct strlist *str, int flag __unused)
{
@@ -1076,14 +1094,7 @@ expandmeta(struct strlist *str, int flag __unused)
}
savelastp = exparg.lastp;
INTOFF;
if (expdir == NULL) {
int i = strlen(str->text);
expdir = ckmalloc(i < 2048 ? 2048 : i); /* XXX */
}
expmeta(expdir, str->text);
ckfree(expdir);
expdir = NULL;
INTON;
if (exparg.lastp == savelastp) {
/*
@@ -1122,10 +1133,11 @@ expmeta(char *enddir, char *name)
struct dirent *dp;
int atend;
int matchdot;
int esc;
metaflag = 0;
start = name;
for (p = name ; ; p++) {
for (p = name; esc = 0, *p; p += esc + 1) {
if (*p == '*' || *p == '?')
metaflag = 1;
else if (*p == '[') {
@@ -1150,12 +1162,14 @@ expmeta(char *enddir, char *name)
break;
else if (*p == CTLQUOTEMARK)
continue;
else if (*p == CTLESC)
p++;
if (*p == '/') {
if (metaflag)
break;
start = p + 1;
else {
if (*p == CTLESC)
esc++;
if (p[esc] == '/') {
if (metaflag)
break;
start = p + esc + 1;
}
}
}
if (metaflag == 0) { /* we've reached the end of the file name */
@@ -1169,6 +1183,8 @@ expmeta(char *enddir, char *name)
*enddir++ = *p;
if (*p == '\0')
break;
if (enddir == expdir_end)
return;
}
if (metaflag == 0 || lstat(expdir, &statb) >= 0)
addfname(expdir);
@@ -1183,6 +1199,8 @@ expmeta(char *enddir, char *name)
if (*p == CTLESC)
p++;
*enddir++ = *p++;
if (enddir == expdir_end)
return;
}
}
if (enddir == expdir) {
@@ -1201,7 +1219,8 @@ expmeta(char *enddir, char *name)
atend = 1;
} else {
atend = 0;
*endname++ = '\0';
*endname = '\0';
endname += esc + 1;
}
matchdot = 0;
p = start;
@@ -1215,21 +1234,23 @@ expmeta(char *enddir, char *name)
if (dp->d_name[0] == '.' && ! matchdot)
continue;
if (patmatch(start, dp->d_name, 0)) {
if (atend) {
scopy(dp->d_name, enddir);
if (enddir + dp->d_namlen + 1 > expdir_end)
continue;
memcpy(enddir, dp->d_name, dp->d_namlen + 1);
if (atend)
addfname(expdir);
} else {
for (p = enddir, q = dp->d_name;
(*p++ = *q++) != '\0';)
else {
if (enddir + dp->d_namlen + 2 > expdir_end)
continue;
p[-1] = '/';
expmeta(p, endname);
enddir[dp->d_namlen] = '/';
enddir[dp->d_namlen + 1] = '\0';
expmeta(enddir + dp->d_namlen + 1, endname);
}
}
}
closedir(dirp);
if (! atend)
endname[-1] = '/';
endname[-esc - 1] = esc ? CTLESC : '/';
}
@@ -1451,7 +1472,7 @@ breakloop:
/*
* Remove any CTLESC characters from a string.
* Remove any CTLESC and CTLQUOTEMARK characters from a string.
*/
void
+3 -3
View File
@@ -350,7 +350,7 @@ histcmd(int argc, char **argv)
if (displayhist) {
out2str(s);
}
evalstring(s);
evalstring(s, 0);
if (displayhist && hist) {
/*
* XXX what about recursive and
@@ -382,7 +382,7 @@ histcmd(int argc, char **argv)
fclose(efp);
editcmd = stalloc(strlen(editor) + strlen(editfile) + 2);
sprintf(editcmd, "%s %s", editor, editfile);
evalstring(editcmd); /* XXX - should use no JC command */
evalstring(editcmd, 0); /* XXX - should use no JC command */
INTON;
readcmdfile(editfile); /* XXX - should read back - quick tst */
unlink(editfile);
@@ -411,7 +411,7 @@ fc_replace(const char *s, char *p, char *r)
} else
STPUTC(*s++, dest);
}
STACKSTRNUL(dest);
STPUTC('\0', dest);
dest = grabstackstr(dest);
return (dest);
+1 -1
View File
@@ -178,7 +178,7 @@ state2:
state3:
state = 4;
if (minusc) {
evalstring(minusc);
evalstring(minusc, 0);
}
if (sflag || minusc == NULL) {
state4: /* XXX ??? - why isn't this before the "if" statement */
+10 -7
View File
@@ -295,6 +295,13 @@ grabstackblock(int len)
* is space for at least one character.
*/
static char *
growstrstackblock(int n)
{
growstackblock();
sstrnleft = stackblocksize() - n;
return stackblock() + n;
}
char *
growstackstr(void)
@@ -304,12 +311,10 @@ growstackstr(void)
len = stackblocksize();
if (herefd >= 0 && len >= 1024) {
xwrite(herefd, stackblock(), len);
sstrnleft = len - 1;
sstrnleft = len;
return stackblock();
}
growstackblock();
sstrnleft = stackblocksize() - len - 1;
return stackblock() + len;
return growstrstackblock(len);
}
@@ -323,9 +328,7 @@ makestrspace(void)
int len;
len = stackblocksize() - sstrnleft;
growstackblock();
sstrnleft = stackblocksize() - len;
return stackblock() + len;
return growstrstackblock(len);
}
+8 -1
View File
@@ -65,9 +65,16 @@ void ungrabstackstr(char *, char *);
#define stackblock() stacknxt
#define stackblocksize() stacknleft
#define STARTSTACKSTR(p) p = stackblock(), sstrnleft = stackblocksize()
#define STPUTC(c, p) (--sstrnleft >= 0? (*p++ = (c)) : (p = growstackstr(), *p++ = (c)))
#define STPUTC(c, p) (--sstrnleft >= 0? (*p++ = (c)) : (p = growstackstr(), --sstrnleft, *p++ = (c)))
#define CHECKSTRSPACE(n, p) { if (sstrnleft < n) p = makestrspace(); }
#define USTPUTC(c, p) (--sstrnleft, *p++ = (c))
/*
* STACKSTRNUL's use is where we want to be able to turn a stack
* (non-sentinel, character counting string) into a C string,
* and later pretend the NUL is not there.
* Note: Because of STACKSTRNUL's semantics, STACKSTRNUL cannot be used
* on a stack that will grabstackstr()ed.
*/
#define STACKSTRNUL(p) (sstrnleft == 0? (p = growstackstr(), *p = '\0') : (*p = '\0'))
#define STUNPUTC(p) (++sstrnleft, --p)
#define STTOPC(p) p[-1]
+77 -27
View File
@@ -32,7 +32,7 @@
.\" from: @(#)sh.1 8.6 (Berkeley) 5/4/95
.\" $FreeBSD$
.\"
.Dd October 7, 2006
.Dd October 31, 2010
.Dt SH 1
.Os
.Sh NAME
@@ -40,9 +40,24 @@
.Nd command interpreter (shell)
.Sh SYNOPSIS
.Nm
.Op Fl /+abCEefIimnPpsTuVvx
.Op Fl /+abCEefIimnPpTuVvx
.Op Fl /+o Ar longname
.Op Fl c Ar string
.Oo
.Ar script
.Op Ar arg ...
.Oc
.Nm
.Op Fl /+abCEefIimnPpTuVvx
.Op Fl /+o Ar longname
.Fl c Ar string
.Oo
.Ar name
.Op Ar arg ...
.Oc
.Nm
.Op Fl /+abCEefIimnPpTuVvx
.Op Fl /+o Ar longname
.Fl s
.Op Ar arg ...
.Sh DESCRIPTION
The
@@ -411,11 +426,11 @@ character, with the exception of the newline character
.Pq Ql \en .
A backslash preceding a newline is treated as a line continuation.
.El
.Ss Reserved Words
Reserved words are words that have special meaning to the
.Ss Keywords
Keywords or reserved words are words that have special meaning to the
shell and are recognized at the beginning of a line and
after a control operator.
The following are reserved words:
The following are keywords:
.Bl -column "doneXX" "elifXX" "elseXX" "untilXX" "whileX" -offset center
.It Li \&! Ta { Ta } Ta Ic case Ta Ic do
.It Ic done Ta Ic elif Ta Ic else Ta Ic esac Ta Ic fi
@@ -425,8 +440,8 @@ The following are reserved words:
An alias is a name and corresponding value set using the
.Ic alias
built-in command.
Whenever a reserved word may occur (see above),
and after checking for reserved words, the shell
Whenever a keyword may occur (see above),
and after checking for keywords, the shell
checks the word to see if it matches an alias.
If it does, it replaces it in the input stream with its value.
For example, if there is an alias called
@@ -465,7 +480,7 @@ of this man page (refer to the BNF in the
document).
Essentially though, a line is read and if
the first word of the line (or after a control operator)
is not a reserved word, then the shell has recognized a
is not a keyword, then the shell has recognized a
simple command.
Otherwise, a complex command or some
other special construct may have been recognized.
@@ -685,7 +700,7 @@ Signal numbers are defined in the header file
.In sys/signal.h .
.Ss Complex Commands
Complex commands are combinations of simple commands
with control operators or reserved words, together creating a larger complex
with control operators or keywords, together creating a larger complex
command.
More generally, a command is one of the following:
.Bl -item -offset indent
@@ -726,10 +741,17 @@ both of a command is considered to be assigned by the
pipeline before any redirection specified by redirection
operators that are part of the command.
.Pp
Note that unlike some other shells,
.Nm
executes each process in a pipeline with more than one command
in a subshell environment and as a child of the
.Nm
process.
.Pp
If the pipeline is not in the background (discussed later),
the shell waits for all commands to complete.
.Pp
If the reserved word
If the keyword
.Ic !\&
does not precede the pipeline, the
exit status is the exit status of the last command specified
@@ -763,15 +785,6 @@ to be executed sequentially;
an
.Ql &
causes asynchronous execution of the preceding AND-OR-list.
.Pp
Note that unlike some other shells,
.Nm
executes each process in the pipeline as a child of the
.Nm
process.
Shell built-in commands are the exception to this rule.
They are executed in the current shell, although they do not affect its
environment when used in pipelines.
.Ss Background Commands (&)
If a command is terminated by the control operator ampersand
.Pq Ql & ,
@@ -1101,7 +1114,12 @@ For a
pipeline, the process ID is that of the last command in the
pipeline.
.It Li $0
(zero) Expands to the name of the shell or shell script.
(zero) Expands to the name of the shell script if passed on the command line,
the
.Ar name
operand if given (with
.Fl c )
or otherwise argument 0 passed to the shell.
.El
.Ss Word Expansions
This clause describes the various expansions that are
@@ -1142,7 +1160,7 @@ Quote Removal.
The
.Ql $
character is used to introduce parameter expansion, command
substitution, or arithmetic evaluation.
substitution, or arithmetic expansion.
.Ss Tilde Expansion (substituting a user's home directory)
A word beginning with an unquoted tilde character
.Pq Ql ~
@@ -1221,6 +1239,9 @@ In all cases, the
final value of
.Ar parameter
is substituted.
Quoting inside
.Ar word
does not prevent field splitting or pathname expansion.
Only variables, not positional
parameters or special parameters, can be
assigned in this way.
@@ -1354,10 +1375,41 @@ The
shell expands all tokens in the
.Ar expression
for parameter expansion,
command substitution, and quote removal.
command substitution,
arithmetic expansion
and quote removal.
.Pp
Next, the shell treats this as an arithmetic expression and
substitutes the value of the expression.
The allowed expressions are a subset of C expressions,
summarized below.
.Bl -tag -width "Variables" -offset indent
.It Values
All values are of type
.Ft intmax_t .
.It Constants
Decimal, octal (starting with
.Li 0 )
and hexadecimal (starting with
.Li 0x )
integer constants.
.It Variables
Shell variables can be read and written
and contain integer constants.
.It Unary operators
.Li "! ~ + -"
.It Binary operators
.Li "* / % + - << >> < <= > >= == != & ^ | && ||"
.It Assignment operators
.Li "= += -= *= /= %= <<= >>= &= ^= |="
.It Short-circuit evaluation
The
.Li &&
and
.Li ||
operators always evaluate both sides.
This is a bug.
.El
.Pp
The result of the expression is substituted in decimal.
.Ss White Space Splitting (Field Splitting)
After parameter expansion, command substitution, and
arithmetic expansion the shell scans the results of
@@ -2352,8 +2404,6 @@ will return the argument.
.Xr echo 1 ,
.Xr ed 1 ,
.Xr emacs 1 ,
.Xr expr 1 ,
.Xr getopt 1 ,
.Xr pwd 1 ,
.Xr test 1 ,
.Xr vi 1 ,
+2 -2
View File
@@ -416,7 +416,7 @@ dotrap(void)
if (i == SIGCHLD)
ignore_sigchld++;
savestatus = exitstatus;
evalstring(trap[i]);
evalstring(trap[i], 0);
exitstatus = savestatus;
if (i == SIGCHLD)
ignore_sigchld--;
@@ -471,7 +471,7 @@ exitshell(int status)
handler = &loc1;
if ((p = trap[0]) != NULL && *p != '\0') {
trap[0] = NULL;
evalstring(p);
evalstring(p, 0);
}
l1: handler = &loc2; /* probably unnecessary */
flushall();
-24
View File
@@ -1,24 +0,0 @@
# $FreeBSD$
OS/shell syntax error failed
--------------------------------------------------------------------
bash 1.14.5 3 0
pdksh 5.2.5 7 0
zsh 2.6-beta17 6 4
FreeBSD 2.1 /bin/test 8 0
IRIX 5.3 ksh 3 0
IRIX 5.3 sh 3 0
IRIX 5.3 /usr/bin/test 11 3
SunOS 5.4 ksh 3 0
SunOS 5.4 sh 3 0
SunOS 5.4 /usr/ucb/test 3 0
SunOS 5.5 ksh 0 0
SunOS 5.5 sh 3 0
SunOS 5.5 /usr/ucb/test 3 0
SunOS 4.1.3_U1 sh 3 0
SunOS 4.1.3_U1 /usr/bin/test 3 0
ULTRIX 4.2 /bin/test 9 0
ULTRIX 4.2 ksh 1 0
ULTRIX 4.2 sh5 4 0
96/06/16
-152
View File
@@ -1,152 +0,0 @@
# @(#)TEST.csh 5.2 (Berkeley) 4/30/93
# $FreeBSD$
#alias t '/usr/src/bin/test/obj/test \!*; echo $status'
alias t '/bin/test \!*; echo $status'
echo 't -b /dev/ttyp2'
t -b /dev/ttyp2
echo 't -b /dev/jb1a'
t -b /dev/jb1a
echo 't -c test.c'
t -c test.c
echo 't -c /dev/tty'
t -c /dev/tty
echo 't -d test.c'
t -d test.c
echo 't -d /etc'
t -d /etc
echo 't -e noexist'
t -e noexist
echo 't -e test.c'
t -e test.c
echo 't -f noexist'
t -f noexist
echo 't -f /dev/tty'
t -f /dev/tty
echo 't -f test.c'
t -f test.c
echo 't -g test.c'
t -g test.c
echo 't -g /bin/ps'
t -g /bin/ps
echo 't -n ""'
t -n ""
echo 't -n "hello"'
t -n "hello"
echo 't -p test.c'
t -p test.c
echo 't -r noexist'
t -r noexist
echo 't -r /etc/master.passwd'
t -r /etc/master.passwd
echo 't -r test.c'
t -r test.c
echo 't -s noexist'
t -s noexist
echo 't -s /dev/null'
t -s /dev/null
echo 't -s test.c'
t -s test.c
echo 't -t 20'
t -t 20
echo 't -t 0'
t -t 0
echo 't -u test.c'
t -u test.c
echo 't -u /bin/rcp'
t -u /bin/rcp
echo 't -w noexist'
t -w noexist
echo 't -w /etc/master.passwd'
t -w /etc/master.passwd
echo 't -w /dev/null'
t -w /dev/null
echo 't -x noexist'
t -x noexist
echo 't -x /bin/ps'
t -x /bin/ps
echo 't -x /etc/motd'
t -x /etc/motd
echo 't -z ""'
t -z ""
echo 't -z "foo"'
t -z "foo"
echo 't "foo"'
t "foo"
echo 't ""'
t ""
echo 't "hello" = "hello"'
t "hello" = "hello"
echo 't "hello" = "goodbye"'
t "hello" = "goodbye"
echo 't "hello" != "hello"'
t "hello" != "hello"
echo 't "hello" != "goodbye"'
t "hello" != "goodbye"
echo 't 200 -eq 200'
t 200 -eq 200
echo 't 34 -eq 222'
t 34 -eq 222
echo 't 200 -ne 200'
t 200 -ne 200
echo 't 34 -ne 222'
t 34 -ne 222
echo 't 200 -gt 200'
t 200 -gt 200
echo 't 340 -gt 222'
t 340 -gt 222
echo 't 200 -ge 200'
t 200 -ge 200
echo 't 34 -ge 222'
t 34 -ge 222
echo 't 200 -lt 200'
t 200 -lt 200
echo 't 34 -lt 222'
t 34 -lt 222
echo 't 200 -le 200'
t 200 -le 200
echo 't 340 -le 222'
t 340 -le 222
echo 't 700 -le 1000 -a -n "1" -a "20" = "20"'
t 700 -le 1000 -a -n "1" -a "20" = "20"
echo 't ! \( 700 -le 1000 -a -n "1" -a "20" = "20" \)'
t ! \( 700 -le 1000 -a -n "1" -a "20" = "20" \)
echo 't -5 -eq 5'
t -5 -eq 5
echo 't foo -a ""'
t foo -a ""
echo 't "" -a foo'
t "" -a foo
echo 't "" -a ""'
t "" -a ""
echo 't "" -o ""'
t "" -o ""
+13 -6
View File
@@ -32,7 +32,7 @@
.\" @(#)test.1 8.1 (Berkeley) 5/31/93
.\" $FreeBSD$
.\"
.Dd July 31, 2006
.Dd September 10, 2010
.Dt TEST 1
.Os
.Sh NAME
@@ -282,7 +282,7 @@ True if either
or
.Ar expression2
are true.
.It Cm \&( Ns Ar expression Ns Cm \&)
.It Cm \&( Ar expression Cm \&)
True if expression is true.
.El
.Pp
@@ -310,6 +310,14 @@ are evaluated consistently according to the rules specified in the
standards document.
All other cases are subject to the ambiguity in the
command semantics.
.Pp
In particular, only expressions containing
.Fl a ,
.Fl o ,
.Cm \&(
or
.Cm \&)
can be ambiguous.
.Sh EXIT STATUS
The
.Nm
@@ -338,12 +346,11 @@ specification.
Both sides are always evaluated in
.Fl a
and
.Fl o ,
unlike in the logical operators of
.Xr sh 1 .
.Fl o .
For instance, the writable status of
.Pa file
will be tested by the following command even though the former expression
indicated false, which results in a gratuitous access to the file system:
.Pp
.Dl "[ -z abc -a -w file ]"
To avoid this, write
.Dl "[ -z abc ] && [ -w file ]"
+59 -9
View File
@@ -163,6 +163,7 @@ struct t_op {
struct t_op const *t_wp_op;
int nargc;
char **t_wp;
int parenlevel;
static int aexpr(enum token);
static int binop(void);
@@ -171,7 +172,9 @@ static int filstat(char *, enum token);
static int getn(const char *);
static intmax_t getq(const char *);
static int intcmp(const char *, const char *);
static int isoperand(void);
static int isunopoperand(void);
static int islparenoperand(void);
static int isrparenoperand(void);
static int newerf(const char *, const char *);
static int nexpr(enum token);
static int oexpr(enum token);
@@ -205,7 +208,14 @@ main(int argc, char **argv)
#endif
nargc = argc;
t_wp = &argv[1];
res = !oexpr(t_lex(*t_wp));
parenlevel = 0;
if (nargc == 4 && strcmp(*t_wp, "!") == 0) {
/* Things like ! "" -o x do not fit in the normal grammar. */
--nargc;
++t_wp;
res = oexpr(t_lex(*t_wp));
} else
res = !oexpr(t_lex(*t_wp));
if (--nargc > 0)
syntax(*t_wp, "unexpected operator");
@@ -268,12 +278,16 @@ primary(enum token n)
if (n == EOI)
return 0; /* missing expression */
if (n == LPAREN) {
parenlevel++;
if ((nn = t_lex(nargc > 0 ? (--nargc, *++t_wp) : NULL)) ==
RPAREN)
RPAREN) {
parenlevel--;
return 0; /* missing expression */
}
res = oexpr(nn);
if (t_lex(nargc > 0 ? (--nargc, *++t_wp) : NULL) != RPAREN)
syntax(NULL, "closing paren expected");
parenlevel--;
return res;
}
if (t_wp_op && t_wp_op->op_type == UNOP) {
@@ -410,8 +424,10 @@ t_lex(char *s)
}
while (op->op_text) {
if (strcmp(s, op->op_text) == 0) {
if ((op->op_type == UNOP && isoperand()) ||
(op->op_num == LPAREN && nargc == 1))
if (((op->op_type == UNOP || op->op_type == BUNOP)
&& isunopoperand()) ||
(op->op_num == LPAREN && islparenoperand()) ||
(op->op_num == RPAREN && isrparenoperand()))
break;
t_wp_op = op;
return op->op_num;
@@ -423,7 +439,7 @@ t_lex(char *s)
}
static int
isoperand(void)
isunopoperand(void)
{
struct t_op const *op = ops;
char *s;
@@ -431,19 +447,53 @@ isoperand(void)
if (nargc == 1)
return 1;
if (nargc == 2)
return 0;
s = *(t_wp + 1);
if (nargc == 2)
return parenlevel == 1 && strcmp(s, ")") == 0;
t = *(t_wp + 2);
while (op->op_text) {
if (strcmp(s, op->op_text) == 0)
return op->op_type == BINOP &&
(t[0] != ')' || t[1] != '\0');
(parenlevel == 0 || t[0] != ')' || t[1] != '\0');
op++;
}
return 0;
}
static int
islparenoperand(void)
{
struct t_op const *op = ops;
char *s;
if (nargc == 1)
return 1;
s = *(t_wp + 1);
if (nargc == 2)
return parenlevel == 1 && strcmp(s, ")") == 0;
if (nargc != 3)
return 0;
while (op->op_text) {
if (strcmp(s, op->op_text) == 0)
return op->op_type == BINOP;
op++;
}
return 0;
}
static int
isrparenoperand(void)
{
char *s;
if (nargc == 1)
return 0;
s = *(t_wp + 1);
if (nargc == 2)
return parenlevel == 1 && strcmp(s, ")") == 0;
return 0;
}
/* atoi with error detection */
static int
getn(const char *s)
+107 -1
View File
@@ -19,7 +19,7 @@
* CDDL HEADER END
*/
/*
* Copyright 2008 Sun Microsystems, Inc. All rights reserved.
* Copyright 2009 Sun Microsystems, Inc. All rights reserved.
* Use is subject to license terms.
*/
@@ -93,6 +93,7 @@
#include <sys/vdev_file.h>
#include <sys/spa_impl.h>
#include <sys/dsl_prop.h>
#include <sys/dsl_dataset.h>
#include <sys/refcount.h>
#include <stdio.h>
#include <stdio_ext.h>
@@ -174,6 +175,7 @@ ztest_func_t ztest_traverse;
ztest_func_t ztest_dsl_prop_get_set;
ztest_func_t ztest_dmu_objset_create_destroy;
ztest_func_t ztest_dmu_snapshot_create_destroy;
ztest_func_t ztest_dsl_dataset_promote_busy;
ztest_func_t ztest_spa_create_destroy;
ztest_func_t ztest_fault_inject;
ztest_func_t ztest_spa_rename;
@@ -208,6 +210,7 @@ ztest_info_t ztest_info[] = {
{ ztest_dsl_prop_get_set, 1, &zopt_sometimes },
{ ztest_dmu_objset_create_destroy, 1, &zopt_sometimes },
{ ztest_dmu_snapshot_create_destroy, 1, &zopt_sometimes },
{ ztest_dsl_dataset_promote_busy, 1, &zopt_sometimes },
{ ztest_spa_create_destroy, 1, &zopt_sometimes },
{ ztest_fault_inject, 1, &zopt_sometimes },
{ ztest_spa_rename, 1, &zopt_rarely },
@@ -1591,6 +1594,109 @@ ztest_traverse(ztest_args_t *za)
}
}
/*
* Verify dsl_dataset_promote handles EBUSY
*/
void
ztest_dsl_dataset_promote_busy(ztest_args_t *za)
{
int error;
objset_t *os = za->za_os;
objset_t *clone;
dsl_dataset_t *ds;
char snap1name[100];
char clone1name[100];
char snap2name[100];
char clone2name[100];
char snap3name[100];
char osname[MAXNAMELEN];
static uint64_t uniq = 0;
uint64_t curval;
curval = atomic_add_64_nv(&uniq, 5) - 5;
(void) rw_rdlock(&ztest_shared->zs_name_lock);
dmu_objset_name(os, osname);
(void) snprintf(snap1name, 100, "%s@s1_%llu", osname, curval++);
(void) snprintf(clone1name, 100, "%s/c1_%llu", osname, curval++);
(void) snprintf(snap2name, 100, "%s@s2_%llu", clone1name, curval++);
(void) snprintf(clone2name, 100, "%s/c2_%llu", osname, curval++);
(void) snprintf(snap3name, 100, "%s@s3_%llu", clone1name, curval++);
error = dmu_objset_snapshot(osname, strchr(snap1name, '@')+1, FALSE);
if (error == ENOSPC)
ztest_record_enospc("dmu_take_snapshot");
else if (error != 0 && error != EEXIST)
fatal(0, "dmu_take_snapshot = %d", error);
error = dmu_objset_open(snap1name, DMU_OST_OTHER,
DS_MODE_USER | DS_MODE_READONLY, &clone);
if (error)
fatal(0, "dmu_open_snapshot(%s) = %d", snap1name, error);
error = dmu_objset_create(clone1name, DMU_OST_OTHER, clone, 0,
NULL, NULL);
if (error)
fatal(0, "dmu_objset_create(%s) = %d", clone1name, error);
dmu_objset_close(clone);
error = dmu_objset_snapshot(clone1name, strchr(snap2name, '@')+1,
FALSE);
if (error == ENOSPC)
ztest_record_enospc("dmu_take_snapshot");
else if (error != 0 && error != EEXIST)
fatal(0, "dmu_take_snapshot = %d", error);
error = dmu_objset_snapshot(clone1name, strchr(snap3name, '@')+1,
FALSE);
if (error == ENOSPC)
ztest_record_enospc("dmu_take_snapshot");
else if (error != 0 && error != EEXIST)
fatal(0, "dmu_take_snapshot = %d", error);
error = dmu_objset_open(snap3name, DMU_OST_OTHER,
DS_MODE_USER | DS_MODE_READONLY, &clone);
if (error)
fatal(0, "dmu_open_snapshot(%s) = %d", snap3name, error);
error = dmu_objset_create(clone2name, DMU_OST_OTHER, clone, 0,
NULL, NULL);
if (error)
fatal(0, "dmu_objset_create(%s) = %d", clone2name, error);
dmu_objset_close(clone);
error = dsl_dataset_own(snap1name, 0, FTAG, &ds);
if (error)
fatal(0, "dsl_dataset_own(%s) = %d", snap1name, error);
error = dsl_dataset_promote(clone2name);
if (error != EBUSY)
fatal(0, "dsl_dataset_promote(%s), %d, not EBUSY", clone2name,
error);
dsl_dataset_disown(ds, FTAG);
error = dmu_objset_destroy(clone2name);
if (error)
fatal(0, "dmu_objset_destroy(%s) = %d", clone2name, error);
error = dmu_objset_destroy(snap3name);
if (error)
fatal(0, "dmu_objset_destroy(%s) = %d", snap2name, error);
error = dmu_objset_destroy(snap2name);
if (error)
fatal(0, "dmu_objset_destroy(%s) = %d", snap2name, error);
error = dmu_objset_destroy(clone1name);
if (error)
fatal(0, "dmu_objset_destroy(%s) = %d", clone1name, error);
error = dmu_objset_destroy(snap1name);
if (error)
fatal(0, "dmu_objset_destroy(%s) = %d", snap1name, error);
(void) rw_unlock(&ztest_shared->zs_name_lock);
}
/*
* Verify that dmu_object_{alloc,free} work as expected.
*/
@@ -137,6 +137,7 @@ typedef struct dt_module {
dt_idhash_t *dm_extern; /* external symbol definitions */
#if !defined(sun)
caddr_t dm_reloc_offset; /* Symbol relocation offset. */
uintptr_t *dm_sec_offsets;
#endif
} dt_module_t;
@@ -83,6 +83,14 @@ dt_module_syminit32(dt_module_t *dmp)
uint_t i, n = dmp->dm_nsymelems;
uint_t asrsv = 0;
#if defined(__FreeBSD__)
GElf_Ehdr ehdr;
int is_elf_obj;
gelf_getehdr(dmp->dm_elf, &ehdr);
is_elf_obj = (ehdr.e_type == ET_REL);
#endif
for (i = 0; i < n; i++, sym++) {
const char *name = base + sym->st_name;
uchar_t type = ELF32_ST_TYPE(sym->st_info);
@@ -97,8 +105,12 @@ dt_module_syminit32(dt_module_t *dmp)
(ELF32_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size)) {
asrsv++; /* reserve space in the address map */
#if !defined(sun)
#if defined(__FreeBSD__)
sym->st_value += (Elf_Addr) dmp->dm_reloc_offset;
if (is_elf_obj && sym->st_shndx != SHN_UNDEF &&
sym->st_shndx < ehdr.e_shnum)
sym->st_value +=
dmp->dm_sec_offsets[sym->st_shndx];
#endif
}
@@ -117,6 +129,14 @@ dt_module_syminit64(dt_module_t *dmp)
uint_t i, n = dmp->dm_nsymelems;
uint_t asrsv = 0;
#if defined(__FreeBSD__)
GElf_Ehdr ehdr;
int is_elf_obj;
gelf_getehdr(dmp->dm_elf, &ehdr);
is_elf_obj = (ehdr.e_type == ET_REL);
#endif
for (i = 0; i < n; i++, sym++) {
const char *name = base + sym->st_name;
uchar_t type = ELF64_ST_TYPE(sym->st_info);
@@ -130,9 +150,12 @@ dt_module_syminit64(dt_module_t *dmp)
if (sym->st_value != 0 &&
(ELF64_ST_BIND(sym->st_info) != STB_LOCAL || sym->st_size)) {
asrsv++; /* reserve space in the address map */
#if !defined(sun)
#if defined(__FreeBSD__)
sym->st_value += (Elf_Addr) dmp->dm_reloc_offset;
if (is_elf_obj && sym->st_shndx != SHN_UNDEF &&
sym->st_shndx < ehdr.e_shnum)
sym->st_value +=
dmp->dm_sec_offsets[sym->st_shndx];
#endif
}
@@ -722,7 +745,12 @@ dt_module_unload(dtrace_hdl_t *dtp, dt_module_t *dmp)
free(dmp->dm_asmap);
dmp->dm_asmap = NULL;
}
#if defined(__FreeBSD__)
if (dmp->dm_sec_offsets != NULL) {
free(dmp->dm_sec_offsets);
dmp->dm_sec_offsets = NULL;
}
#endif
dmp->dm_symfree = 0;
dmp->dm_nsymbuckets = 0;
dmp->dm_nsymelems = 0;
@@ -846,9 +874,12 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat)
(void) snprintf(fname, sizeof (fname),
"%s/%s/object", OBJFS_ROOT, name);
#else
GElf_Ehdr ehdr;
GElf_Phdr ph;
char name[MAXPATHLEN];
uintptr_t mapbase, alignmask;
int i = 0;
int is_elf_obj;
(void) strlcpy(name, k_stat->name, sizeof(name));
(void) strlcpy(fname, k_stat->pathname, sizeof(fname));
@@ -893,7 +924,20 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat)
dt_module_destroy(dtp, dmp);
return;
}
#if defined(__FreeBSD__)
mapbase = (uintptr_t)k_stat->address;
gelf_getehdr(dmp->dm_elf, &ehdr);
is_elf_obj = (ehdr.e_type == ET_REL);
if (is_elf_obj) {
dmp->dm_sec_offsets =
malloc(ehdr.e_shnum * sizeof(*dmp->dm_sec_offsets));
if (dmp->dm_sec_offsets == NULL) {
dt_dprintf("failed to allocate memory\n");
dt_module_destroy(dtp, dmp);
return;
}
}
#endif
/*
* Iterate over the section headers locating various sections of
* interest and use their attributes to flesh out the dt_module_t.
@@ -902,7 +946,19 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat)
if (gelf_getshdr(sp, &sh) == NULL || sh.sh_type == SHT_NULL ||
(s = elf_strptr(dmp->dm_elf, shstrs, sh.sh_name)) == NULL)
continue; /* skip any malformed sections */
#if defined(__FreeBSD__)
if (sh.sh_size == 0)
continue;
if (is_elf_obj && (sh.sh_type == SHT_PROGBITS ||
sh.sh_type == SHT_NOBITS)) {
alignmask = sh.sh_addralign - 1;
mapbase += alignmask;
mapbase &= ~alignmask;
sh.sh_addr = mapbase;
dmp->dm_sec_offsets[elf_ndxscn(sp)] = sh.sh_addr;
mapbase += sh.sh_size;
}
#endif
if (strcmp(s, ".text") == 0) {
dmp->dm_text_size = sh.sh_size;
dmp->dm_text_va = sh.sh_addr;
@@ -927,6 +983,13 @@ dt_module_update(dtrace_hdl_t *dtp, struct kld_file_stat *k_stat)
#if defined(sun)
dmp->dm_modid = (int)OBJFS_MODID(st.st_ino);
#else
/*
* Include .rodata and special sections into .text.
* This depends on default section layout produced by GNU ld
* for ELF objects and libraries:
* [Text][R/O data][R/W data][Dynamic][BSS][Non loadable]
*/
dmp->dm_text_size = dmp->dm_data_va - dmp->dm_text_va;
#if defined(__i386__)
/*
* Find the first load section and figure out the relocation
@@ -644,7 +644,7 @@ write_file(Elf *src, const char *srcname, Elf *dst, const char *dstname,
}
#if !defined(sun)
if (ddata->d_buf == NULL) {
if (ddata->d_buf == NULL && sdata->d_buf != NULL) {
ddata->d_buf = xmalloc(shdr.sh_size);
bcopy(sdata->d_buf, ddata->d_buf, shdr.sh_size);
}
+1 -1
View File
@@ -11,7 +11,7 @@
# LIST_SRCS
.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/uts/common/os
# ATOMIC_SRCS
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64"
.if ${MACHINE_ARCH} == "i386" || ${MACHINE_ARCH} == "amd64" || ${MACHINE_ARCH} == "ia64" || ${MACHINE_ARCH} == "sparc64"
.PATH: ${.CURDIR}/../../../sys/cddl/contrib/opensolaris/common/atomic/${MACHINE_ARCH}
ATOMIC_SRCS= opensolaris_atomic.S
.else
+345 -8
View File
@@ -1,28 +1,360 @@
--- 9.4.3-P4 released ---
--- 9.4-ESV-R4 released ---
2970. [security] Adding a NO DATA negative cache entry failed to clear
any matching RRSIG records. A subsequent lookup of
of NO DATA cache entry could trigger a INSIST when the
unexpected RRSIG was also returned with the NO DATA
cache entry.
CVE-2010-3613, VU#706148. [RT #22288]
2968. [security] Named could fail to prove a data set was insecure
before marking it as insecure. One set of conditions
that can trigger this occurs naturally when rolling
DNSKEY algorithms.
CVE-2010-3614, VU#837744. [RT #22309]
2966. [bug] isc_print_vsnprintf() failed to check if there was
space available in the buffer when adding a left
justified character with a non zero width,
(e.g. "%-1c"). [RT #22270]
2962. [port] win32: add more dependancies to BINDBuild.dsw.
[RT #22062]
2786. [bug] Additional could be promoted to answer. [RT #20663]
--- 9.4-ESV-R3 released ---
2925. [bug] Named failed to accept uncachable negative responses
from insecure zones. [RT# 21555]
2921. [bug] The resolver could attempt to destroy a fetch context
too soon. [RT #19878]
2904. [bug] When using DLV, sub-zones of the zones in the DLV,
could be incorrectly marked as insecure instead of
secure leading to negative proofs failing. This was
a unintended outcome from change 2890. [RT# 21392]
2900. [bug] The placeholder negative caching element was not
properly constructed triggering a INSIST in
dns_ncache_towire(). [RT #21346]
2890. [bug] Handle the introduction of new trusted-keys and
DS, DLV RRsets better. [RT #21097]
2869. [bug] Fix arguments to dns_keytable_findnextkeynode() call.
[RT #20877]
2678. [func] Treat DS queries as if "minimal-response yes;"
was set. [RT #20258]
2427. [func] Treat DNSKEY queries as if "minimal-response yes;"
was set. [RT #18528]
--- 9.4-ESV-R2 released ---
2876. [bug] Named could return SERVFAIL for negative responses
from unsigned zones. [RT #21131]
--- 9.4-ESV-R1 released ---
2852. [bug] Handle broken DNSSEC trust chains better. [RT #15619]
--- 9.4-ESV released ---
2831. [security] Do not attempt to validate or cache
out-of-bailiwick data returned with a secure
answer; it must be re-fetched from its original
source and validated in that context. [RT #20819]
2828. [security] Cached CNAME or DNAME RR could be returned to clients
without DNSSEC validation. [RT #20737]
2827. [security] Bogus NXDOMAIN could be cached as if valid. [RT #20712]
2797. [bug] Don't decrement the dispatch manager's maxbuffers.
[RT #20613]
2790. [bug] Handle DS queries to stub zones. [RT #20440]
2772. [security] When validating, track whether pending data was from
the additional section or not and only return it if
validates as secure. [RT #20438]
--- 9.4.3-P3 released ---
--- 9.4-ESVb1 released ---
2698. [cleanup] configure --enable-libbind is deprecated. [RT #20090]
2697. [port] win32: ensure that S_IFMT, S_IFDIR, S_IFCHR and
S_IFREG are defined after including <isc/stat.h>.
[RT #20309]
2690. [bug] win32: fix isc_thread_key_getspecific() prototype.
[RT #20315]
2689. [bug] Correctly handle snprintf result. [RT #20306]
2688. [bug] Use INTERFACE_F_POINTTOPOINT, not IFF_POINTOPOINT,
to decide to fetch the destination address. [RT #20305]
2681. [bug] IPSECKEY RR of gateway type 3 was not correctly
decoded. [RT #20269]
2672. [bug] Don't enable searching in 'host' when doing reverse
lookups. [RT #20218]
2525. [experimental] New logging category "query-errors" to provide detailed
internal information about query failures, especially
about server failures. (backported as a special
exception to the general policy) [RT #19027]
2670. [bug] Unexpected connect failures failed to log enough
information to be useful. [RT #20205]
2649. [bug] Set the domain for forward only zones. [RT #19944]
2648. [port] win32: isc_time_seconds() was broken. [RT #19900]
2646. [bug] Incorrect cleanup on error in socket.c. [RT #19987]
2642. [bug] nsupdate could dump core on solaris when reading
improperly formatted key files. [RT #20015]
2640. [security] A specially crafted update packet will cause named
to exit. [RT #20000]
--- 9.4.3-P2 released ---
2637. [func] Rationalize dnssec-signzone's signwithkey() calling.
[RT #19959]
2635. [bug] isc_inet_ntop() incorrectly handled 0.0/16 addresses.
[RT #19716]
2633. [bug] Handle 15 bit rand() functions. [RT #19783]
2632. [func] util/kit.sh: warn if documentation appears to be out of
date. [RT #19922]
2623. [bug] Named started seaches for DS non-optimally. [RT #19915]
2621. [doc] Made copyright boilterplate consistent. [RT #19833]
2920. [bug] Delay thawing the zone until the reload of it has
completed successfully. [RT #19750]
2618. [bug] The sdb and sdlz db_interator_seek() methods could
loop infinitely. [RT #19847]
2617. [bug] ifconfig.sh failed to emit an error message when
run from the wrong location. [RT #19375]
2616. [bug] 'host' used the nameservers from resolv.conf even
when a explicit nameserver was specified. [RT #19852]
2615. [bug] "__attribute__((unused))" was in the wrong place
for ia64 gcc builds. [RT #19854]
2614. [port] win32: 'named -v' should automatically be executed
in the foreground. [RT #19844]
2610. [port] sunos: Change #2363 was not complete. [RT #19796]
2606. [bug] "delegation-only" was not being accepted in
delegation-only type zones. [RT #19717]
2605. [bug] Accept DS responses from delegation only zones.
[RT # 19296]
2603. [port] win32: handle .exe extension of named-checkzone and
named-comilezone argv[0] names under windows.
[RT #19767]
2602. [port] win32: fix debugging command line build of libisccfg.
[RT #19767]
2599. [bug] Address rapid memory growth when validation fails.
[RT #19654]
2595. [bug] Fix unknown extended rcodes in dig. [RT #19625]
2592. [bug] Treat "any" as a type in nsupdate. [RT #19455]
2591. [bug] named could die when processing a update in
removed_orphaned_ds(). [RT #19507]
2589. [bug] dns_db_unregister() failed to clear '*dbimp'.
[RT #19626]
2586. [bug] Missing cleanup of SIG rdataset in searching a DLZ DB
or SDB. [RT #19577]
2584. [bug] alpha: gcc optimization could break atomic operations.
[RT #19227]
2583. [port] netbsd: provide a control to not add the compile
date to the version string, -DNO_VERSION_DATE.
2582. [bug] Don't emit warning log message when we attempt to
remove non-existant journal. [RT #19516]
2581. [contrib] dlz/mysql set MYSQL_OPT_RECONNECT option on connection.
Requires MySQL 5.0.19 or later. [RT #19084]
2579. [bug] DNSSEC lookaside validation failed to handle unknown
algorithms. [RT #19479]
--- 9.4.3-P1 released ---
2573. [bug] Replacing a non-CNAME record with a CNAME record in a
single transaction in a signed zone failed. [RT #19397]
2568. [bug] Report when the write to indicate a otherwise
successful start fails. [RT #19360]
2567. [bug] dst__privstruct_writefile() could miss write errors.
write_public_key() could miss write errors.
[RT #19360]
2564. [bug] Only take EDNS fallback steps when processing timeouts.
[RT #19405]
2563. [bug] Dig could leak a socket causing it to wait forever
to exit. [RT #19359]
2562. [doc] ARM: miscellaneous improvements, reorganization,
and some new content.
2561. [doc] Add isc-config.sh(1) man page. [RT #16378]
2557. [cleanup] PCI compliance:
* new libisc log module file
* isc_dir_chroot() now also changes the working
directory to "/".
* additional INSISTs
* additional logging when files can't be removed.
2553. [bug] Reference leak on DNSSEC validation errors. [RT #19291]
2552. [bug] zero-no-soa-ttl-cache was not being honoured.
[RT #19340]
2551. [bug] Potential Reference leak on return. [RT #19341]
2550. [bug] Check --with-openssl=<path> finds <openssl/opensslv.h>.
[RT #19343]
2549. [port] linux: define NR_OPEN if not currently defined.
[RT #19344]
2547. [bug] openssl_link.c:mem_realloc() could reference an
out-of-range area of the source buffer. New public
function isc_mem_reallocate() was introduced to address
this bug. [RT #19313]
2545. [doc] ARM: Legal hostname checking (check-names) is
for SRV RDATA too. [RT #19304]
2544. [cleanup] Removed unused structure members in adb.c. [RT #19225]
2542. [doc] Update the description of dig +adflag. [RT #19290]
2539. [security] Update the interaction between recursion, allow-query,
allow-query-cache and allow-recursion. [RT #19198]
2536. [cleanup] Silence some warnings when -Werror=format-security is
specified. [RT #19083]
2535. [bug] dig +showsearch and +trace interacted badly. [RT #19091]
2532. [bug] dig: check the question section of the response to
see if it matches the asked question. [RT #18495]
2531. [bug] Change #2207 was incomplete. [RT #19098]
2529. [cleanup] Upgrade libtool to silence complaints from recent
version of autoconf. [RT #18657]
2528. [cleanup] Silence spurious configure warning about
--datarootdir [RT #19096]
2527. [bug] named could reuse cache on reload with
enabling/disabling validation. [RT #19119]
2523. [bug] Random type rdata freed by dns_nsec_typepresent().
[RT #19112]
2522. [security] Handle -1 from DSA_do_verify().
2521. [bug] Improve epoll cross compilation support. [RT #19047]
2519. [bug] dig/host with -4 or -6 didn't work if more than two
nameserver addresses of the excluded address family
preceded in resolv.conf. [RT #19081]
2517. [bug] dig +trace with -4 or -6 failed when it chose a
nameserver address of the excluded address type.
[RT #18843]
2516. [bug] glue sort for responses was performed even when not
needed. [RT #19039]
2514. [bug] dig/host failed with -4 or -6 when resolv.conf contains
a nameserver of the excluded address family.
[RT #18848]
2511. [cleanup] dns_rdata_tofmttext() add const to linebreak.
[RT #18885]
2510. [bug] "dig +sigchase" could trigger REQUIRE failures.
[RT #19033]
2509. [bug] Specifying a fixed query source port was broken.
[RT #19051]
2506. [port] solaris: Check at configure time if
hack_shutup_pthreadonceinit is needed. [RT #19037]
2505. [port] Treat amd64 similarly to x86_64 when determining
atomic operation support. [RT #19031]
2504. [bug] Address race condition in the socket code. [RT #18899]
2503. [port] linux: improve compatibility with Linux Standard
Base. [RT #18793]
2500. [contrib] contrib/sdb/pgsql/zonetodb.c called non-existent
function. [RT #18582]
2499. [port] solaris: lib/lwres/getaddrinfo.c namespace clash.
[RT #18837]
2498. [bug] Removed a bogus function argument used with
ISC_SOCKET_USE_POLLWATCH: it could cause compiler
warning or crash named with the debug 1 level
of logging. [RT #18917]
2495. [bug] Tighten RRSIG checks. [RT #18795]
2494. [bug] dns/sdlz.h and dns/dlz.h were not being installed.
[RT #18826]
2487. [bug] Give TCP connections longer to complete. [RT #18675]
2485. [bug] Change update's the handling of obscured RRSIG
records. Not all orphand DS records were being
removed. [RT #18828]
2479. [bug] xfrout:covers was not properly initalized. [RT #18801]
2478. [bug] 'addresses' could be used uninitalized in
configure_forward(). [RT #18800]
2476. [doc] ARM: improve documentation for max-journal-size and
ixfr-from-differences. [RT #15909] [RT #18541]
2400. [bug] Log if kqueue()/epoll_create()/open(/dev/poll) fails.
[RT #18297]
--- 9.4.3 released ---
2490. [port] aix: work around a kernel bug where IPV6_RECVPKTINFO
@@ -38,7 +370,7 @@
2473. [port] linux: raise the limit on open files to the possible
maximum value before spawning threads; 'files'
specified in named.conf doesn't seem to work with
specified in named.conf doesn't seem to work with
threads as expected. [RT #18784]
2472. [port] linux: check the number of available cpu's before
@@ -61,10 +393,11 @@
2465. [bug] Adb's handling of lame addresses was different
for IPv4 and IPv6. [RT #18738]
2463. [port] linux: POSIX doesn't include the IPv6 Advanced Socket
2463. [port] linux: POSIX doesn't include the IPv6 Advanced Socket
API and glibc hides parts of the IPv6 Advanced Socket
API as a result. This is stupid as it breaks how the
two halves (Basic and Advanced) of the IPv6 Socket API were designed to be used but we have to live with it.
two halves (Basic and Advanced) of the IPv6 Socket API
were designed to be used but we have to live with it.
Define _GNU_SOURCE to pull in the IPv6 Advanced Socket
API. [RT #18388]
@@ -170,6 +503,10 @@
for select(). To enable this, set ISC_SOCKET_MAXSOCKETS
at compilation time. [RT #18433]
Note: with changes #2469 and #2421 above, there is no
need to tweak ISC_SOCKET_MAXSOCKETS at compilation time
any more.
2410. [bug] Correctly delete m_versionInfo. [RT #18432]
2408. [bug] A duplicate TCP dispatch event could be sent, which
@@ -241,7 +578,7 @@
2380. [bug] dns_view_find() was not returning NXDOMAIN/NXRRSET
proofs which, in turn, caused validation failures
for insecure zones immediately below a secure zone
the server was authoritative for. [RT #18112]
the server was authoritative for. [RT #18112]
2379. [contrib] queryperf/gen-data-queryperf.py: removed redundant
TLDs and supported RRs with TTLs [RT #17972]
+2 -2
View File
@@ -1,4 +1,4 @@
Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC")
Copyright (C) 1996-2003 Internet Software Consortium.
Permission to use, copy, modify, and/or distribute this software for any
@@ -13,7 +13,7 @@ LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
$Id: COPYRIGHT,v 1.9.18.5 2008/01/02 23:46:02 tbox Exp $
$Id: COPYRIGHT,v 1.9.18.7 2010/01/07 23:46:07 tbox Exp $
Portions Copyright (C) 1996-2001 Nominum, Inc.
+17 -13
View File
@@ -1,6 +1,6 @@
Frequently Asked Questions about BIND 9
Copyright © 2004-2008 Internet Systems Consortium, Inc. ("ISC")
Copyright © 2004-2009 Internet Systems Consortium, Inc. ("ISC")
Copyright © 2000-2003 Internet Software Consortium.
@@ -153,24 +153,29 @@ A: BIND 9.3 and later: Use TSIG to select the appropriate view.
Master 10.0.1.1:
key "external" {
algorithm hmac-md5;
secret "xxxxxxxx";
algorithm hmac-sha256;
secret "xxxxxxxxxxxxxxxxxxxxxxxx";
};
view "internal" {
match-clients { !key external; 10.0.1/24; };
match-clients { !key external; // reject message ment for the
// external view.
10.0.1/24; }; // accept from these addresses.
...
};
view "external" {
match-clients { key external; any; };
server 10.0.1.2 { keys external; };
server 10.0.1.2 { keys external; }; // tag messages from the
// external view to the
// other servers for the
// view.
recursion no;
...
};
Slave 10.0.1.2:
key "external" {
algorithm hmac-md5;
secret "xxxxxxxx";
algorithm hmac-sha256;
secret "xxxxxxxxxxxxxxxxxxxxxxxx";
};
view "internal" {
match-clients { !key external; 10.0.1/24; };
@@ -220,13 +225,13 @@ A: You choose one view to be master and the second a slave and transfer
Master 10.0.1.1:
key "external" {
algorithm hmac-md5;
secret "xxxxxxxx";
algorithm hmac-sha256;
secret "xxxxxxxxxxxxxxxxxxxxxxxx";
};
key "mykey" {
algorithm hmac-md5;
secret "yyyyyyyy";
algorithm hmac-sha256;
secret "yyyyyyyyyyyyyyyyyyyyyyyy";
};
view "internal" {
@@ -600,7 +605,7 @@ Q: Why do queries for NSEC3 records fail to return the NSEC3 record?
A: NSEC3 records are strictly meta data and can only be returned in the
authority section. This is done so that signing the zone using NSEC3
records does not bring names into existance that do not exist in the
records does not bring names into existence that do not exist in the
unsigned version of the zone.
5. Operating-System Specific Questions
@@ -825,7 +830,6 @@ A: /dev/random is not configured. Use rndcontrol(8) to tell the kernel to
use certain interrupts as a source of random events. You can make this
permanent by setting rand_irqs in /etc/rc.conf.
/etc/rc.conf
rand_irqs="3 14 15"
See also <http://people.freebsd.org/~dougb/randomness.html>.
+19 -14
View File
@@ -1,7 +1,7 @@
<!DOCTYPE article PUBLIC "-//OASIS//DTD DocBook XML V4.2//EN"
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd" []>
<!--
- Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2000-2003 Internet Software Consortium.
-
- Permission to use, copy, modify, and/or distribute this software for any
@@ -17,7 +17,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: FAQ.xml,v 1.4.4.24 2008/09/10 01:32:25 tbox Exp $ -->
<!-- $Id: FAQ.xml,v 1.4.4.29 2009/10/06 01:33:54 tbox Exp $ -->
<article class="faq">
<title>Frequently Asked Questions about BIND 9</title>
@@ -28,6 +28,7 @@
<year>2006</year>
<year>2007</year>
<year>2008</year>
<year>2009</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
<copyright>
@@ -318,24 +319,29 @@ Slave: 10.0.1.3 (internal), 10.0.1.4 (external, IP alias)
<programlisting>
Master 10.0.1.1:
key "external" {
algorithm hmac-md5;
secret "xxxxxxxx";
algorithm hmac-sha256;
secret "xxxxxxxxxxxxxxxxxxxxxxxx";
};
view "internal" {
match-clients { !key external; 10.0.1/24; };
match-clients { !key external; // reject message ment for the
// external view.
10.0.1/24; }; // accept from these addresses.
...
};
view "external" {
match-clients { key external; any; };
server 10.0.1.2 { keys external; };
server 10.0.1.2 { keys external; }; // tag messages from the
// external view to the
// other servers for the
// view.
recursion no;
...
};
Slave 10.0.1.2:
key "external" {
algorithm hmac-md5;
secret "xxxxxxxx";
algorithm hmac-sha256;
secret "xxxxxxxxxxxxxxxxxxxxxxxx";
};
view "internal" {
match-clients { !key external; 10.0.1/24; };
@@ -423,13 +429,13 @@ named-checkzone example.com tmp</programlisting>
<programlisting>
Master 10.0.1.1:
key "external" {
algorithm hmac-md5;
secret "xxxxxxxx";
algorithm hmac-sha256;
secret "xxxxxxxxxxxxxxxxxxxxxxxx";
};
key "mykey" {
algorithm hmac-md5;
secret "yyyyyyyy";
algorithm hmac-sha256;
secret "yyyyyyyyyyyyyyyyyyyyyyyy";
};
view "internal" {
@@ -1067,7 +1073,7 @@ empty:
NSEC3 records are strictly meta data and can only be
returned in the authority section. This is done so that
signing the zone using NSEC3 records does not bring names
into existance that do not exist in the unsigned version
into existence that do not exist in the unsigned version
of the zone.
</para>
</answer>
@@ -1470,7 +1476,6 @@ options {
</para>
<informalexample>
<programlisting>
/etc/rc.conf
rand_irqs="3 14 15"</programlisting>
</informalexample>
<para>
+15 -2
View File
@@ -1,4 +1,4 @@
# Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
# Copyright (C) 1998-2002 Internet Software Consortium.
#
# Permission to use, copy, modify, and/or distribute this software for any
@@ -13,7 +13,7 @@
# OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
# PERFORMANCE OF THIS SOFTWARE.
# $Id: Makefile.in,v 1.43.18.6 2007/09/03 23:46:21 tbox Exp $
# $Id: Makefile.in,v 1.43.18.8 2009/02/20 23:46:01 tbox Exp $
srcdir = @srcdir@
VPATH = @srcdir@
@@ -24,6 +24,12 @@ top_srcdir = @top_srcdir@
SUBDIRS = make lib bin doc @LIBBIND@
TARGETS =
MANPAGES = isc-config.sh.1
HTMLPAGES = isc-config.sh.html
MANOBJS = ${MANPAGES} ${HTMLPAGES}
@BIND9_MAKE_RULES@
distclean::
@@ -43,12 +49,19 @@ distclean::
maintainer-clean::
rm -f configure
docclean manclean maintainer-clean::
rm -f ${MANOBJS}
doc man:: ${MANOBJS}
installdirs:
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${bindir} \
${DESTDIR}${localstatedir}/run ${DESTDIR}${sysconfdir}
$(SHELL) ${top_srcdir}/mkinstalldirs ${DESTDIR}${mandir}/man1
install:: isc-config.sh installdirs
${INSTALL_SCRIPT} isc-config.sh ${DESTDIR}${bindir}
${INSTALL_DATA} ${srcdir}/isc-config.sh.1 ${DESTDIR}${mandir}/man1
tags:
rm -f TAGS
+23 -12
View File
@@ -27,8 +27,8 @@ BIND 9
- Improved Portability Architecture
BIND version 9 development has been underwritten by the following
organizations:
BIND version 9 development has been under written by the following
organisations:
Sun Microsystems, Inc.
Hewlett Packard
@@ -42,6 +42,16 @@ BIND 9
Stichting NLnet - NLnet Foundation
Nominum, Inc.
BIND 9.4-ESV (Extended Support Version)
BIND 9.4-ESV is the Extended Support Version of BIND 9.4
and incorporates the final maintenance release fixing bugs
in BIND 9.4.3.
BIND 9.4-ESV will be supported until December 31, 2010, at
which time you will need to upgrade to the current release
of BIND.
BIND 9.4.3
BIND 9.4.3 is a maintenance release, fixing bugs in 9.4.2.
@@ -67,7 +77,7 @@ BIND 9.4.0
Implemented "additional section caching" (or "acache"), an
internal cache framework for additional section content to
improve response performance. Several configuration options
were provided to control the behavior.
were provided to control the behaviour.
New notify type 'master-only'. Enable notify for master
zones only.
@@ -76,13 +86,14 @@ BIND 9.4.0
rndc now allows addresses to be set in the server clauses.
New option "allow-query-cache". This lets allow-query be
used to specify the default zone access level rather than
having to have every zone override the global value.
allow-query-cache can be set at both the options and view
levels. If allow-query-cache is not set then allow-recursion
is used if set, otherwise allow-query is used if set, otherwise
the default (localhost; localnets;) is used.
New option "allow-query-cache". This lets "allow-query"
be used to specify the default zone access level rather
than having to have every zone override the global value.
"allow-query-cache" can be set at both the options and view
levels. If "allow-query-cache" is not set then "allow-recursion"
is used if set, otherwise "allow-query" is used if set
unless "recursion no;" is set in which case "none;" is used,
otherwise the default (localhost; localnets;) is used.
rndc: the source address can now be specified.
@@ -150,12 +161,12 @@ BIND 9.4.0
options for dnssec-signzone specify the input and output
formats.
dnssec-signzone can now randomize signature end times
dnssec-signzone can now randomise signature end times
(dnssec-signzone -j jitter).
Add support for CH A record.
Add additional zone data consistancy checks. named-checkzone
Add additional zone data consistency checks. named-checkzone
has extended checking of NS, MX and SRV record and the hosts
they reference. named has extended post zone load checks.
New zone options: check-mx and integrity-check.
+4 -4
View File
@@ -55,7 +55,7 @@ at least specify `--with-idn' option to enable IDN support.
`--with-libiconv' assumes that your C compiler has `-R'
option, and that the option adds the specified run-time path
to an exacutable binary. If `-R' option of your compiler has
to an executable binary. If `-R' option of your compiler has
different meaning, or your compiler lacks the option, you
should use `--with-iconv' option instead. Binary command
without run-time path information might be unexecutable.
@@ -68,7 +68,7 @@ at least specify `--with-idn' option to enable IDN support.
specified, `--with-iconv' is prior to `--with-libiconv'.
--with-iconv=ICONV_LIBSPEC
If your libc doens't provide iconv(), you need to specify the
If your libc doesn't provide iconv(), you need to specify the
library containing iconv() with this option. `ICONV_LIBSPEC'
is the argument(s) to `cc' or `ld' to link the library, for
example, `--with-iconv="-L/usr/local/lib -liconv"'.
@@ -82,7 +82,7 @@ at least specify `--with-idn' option to enable IDN support.
this option is not specified, `-L${PREFIX}/lib -lidnkit' is
assumed, where ${PREFIX} is the installation prefix specified
with `--with-idn' option above. You may need to use this
option to specify extra argments, for example,
option to specify extra arguments, for example,
`--with-idnlib="-L/usr/local/lib -R/usr/local/lib -lidnkit"'.
Please consult `README' for other configuration options.
@@ -109,4 +109,4 @@ about idnkit and this patch.
Bug reports and comments on this kit should be sent to
[email protected] and [email protected], respectively.
; $Id: README.idnkit,v 1.2.2.2 2005/09/12 02:12:08 marka Exp $
; $Id: README.idnkit,v 1.2.2.3 2009/01/19 00:36:25 marka Exp $
@@ -0,0 +1,123 @@
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<!--
- Copyright (C) 2010 Internet Systems Consortium, Inc. ("ISC")
-
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
-
- THE SOFTWARE IS PROVIDED "AS IS" AND ISC DISCLAIMS ALL WARRANTIES WITH
- REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
- AND FITNESS. IN NO EVENT SHALL ISC BE LIABLE FOR ANY SPECIAL, DIRECT,
- INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
- LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: RELEASE-NOTES-BIND-9.4-ESV.html,v 1.1.2.2 2010/11/29 01:15:44 tbox Exp $ -->
<html xmlns="http://www.w3.org/1999/xhtml"><head><meta http-equiv="Content-Type" content="text/html; charset=UTF-8" /><title></title><link rel="stylesheet" type="text/css" href="release-notes.css" /><meta name="generator" content="DocBook XSL Stylesheets V1.76.1" /></head><body><div class="article"><div class="titlepage"><hr /></div>
<div class="section" title="Introduction"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id36111797"></a>Introduction</h2></div></div></div>
<p>
BIND 9.3-ESV-R4 is a maintenance release for BIND 9.4-ESV.
</p>
<p>
This document summarizes changes from BIND 9.4-ESV-R3 to BIND 9.4-ESV-R4.
Please see the CHANGES file in the source code release for a
complete list of all changes.
</p>
</div>
<div class="section" title="Download"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id36111880"></a>Download</h2></div></div></div>
<p>
The latest release of BIND 9 software can always be found
on our web site at
<a class="ulink" href="http://www.isc.org/software/bind" target="_top">http://www.isc.org/software/bind</a>.
There you will find additional information about each release,
source code, and some pre-compiled versions for certain operating
systems.
</p>
</div>
<div class="section" title="Support"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id36111815"></a>Support</h2></div></div></div>
<p>Product support information is available on
<a class="ulink" href="http://www.isc.org/services/support" target="_top">http://www.isc.org/services/support</a>
for paid support options. Free support is provided by our user
community via a mailing list. Information on all public email
lists is available at
<a class="ulink" href="https://lists.isc.org/mailman/listinfo" target="_top">https://lists.isc.org/mailman/listinfo</a>.
</p>
</div>
<div class="section" title="New Features"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id36111957"></a>New Features</h2></div></div></div>
<div class="section" title="9.4-ESV-R4"><div class="titlepage"><div><div><h3 class="title"><a id="id36111972"></a>9.4-ESV-R4</h3></div></div></div>
<p>None.</p>
</div>
</div>
<div class="section" title="Feature Changes"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id36111905"></a>Feature Changes</h2></div></div></div>
<div class="section" title="9.4-ESV-R4"><div class="titlepage"><div><div><h3 class="title"><a id="id36111988"></a>9.4-ESV-R4</h3></div></div></div>
<p>None.</p>
</div>
</div>
<div class="section" title="Security Fixes"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id36111999"></a>Security Fixes</h2></div></div></div>
<div class="section" title="9.4-ESV-R4"><div class="titlepage"><div><div><h3 class="title"><a id="id36112004"></a>9.4-ESV-R4</h3></div></div></div>
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
Adding a NO DATA signed negative response to cache failed to clear
any matching RRSIG records already in cache. A subsequent lookup
of the cached NO DATA entry could crash named (INSIST) when the
unexpected RRSIG was also returned with the NO DATA cache entry.
[RT #22288] [CVE-2010-3613] [VU#706148]
</li><li class="listitem">
BIND, acting as a DNSSEC validator, was determining if the NS RRset
is insecure based on a value that could mean either that the RRset
is actually insecure or that there wasn't a matching key for the RRSIG
in the DNSKEY RRset when resuming from validating the DNSKEY RRset.
This can happen when in the middle of a DNSKEY algorithm rollover,
when two different algorithms were used to sign a zone but only the
new set of keys are in the zone DNSKEY RRset.
[RT #22309] [CVE-2010-3614] [VU#837744]
</li></ul></div>
</div>
</div>
<div class="section" title="Bug Fixes"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id36112029"></a>Bug Fixes</h2></div></div></div>
<div class="section" title="9.4-ESV-R4"><div class="titlepage"><div><div><h3 class="title"><a id="id36112035"></a>9.4-ESV-R4</h3></div></div></div>
<div class="itemizedlist"><ul class="itemizedlist" type="disc"><li class="listitem">
isc_print_vsnprintf() failed to check if there was
space available in the buffer when adding a left
justified character with a non zero width,
(e.g. "%-1c").
[RT #22270]
</li><li class="listitem">
win32: add more dependencies to BINDBuild.dsw.
[RT #22062]
</li></ul></div>
</div>
</div>
<div class="section" title="Thank You"><div class="titlepage"><div><div><h2 class="title" style="clear: both"><a id="id36112054"></a>Thank You</h2></div></div></div>
<p>
Thank you to everyone who assisted us in making this release possible.
If you would like to contribute to ISC to assist us in continuing to make
quality open source software, please visit our donations page at
<a class="ulink" href="http://www.isc.org/supportisc" target="_top">http://www.isc.org/supportisc</a>.
</p>
</div>
</div></body></html>
Binary file not shown.
@@ -0,0 +1,70 @@
__________________________________________________________________
Introduction
BIND 9.3-ESV-R4 is a maintenance release for BIND 9.4-ESV.
This document summarizes changes from BIND 9.4-ESV-R3 to BIND
9.4-ESV-R4. Please see the CHANGES file in the source code release for
a complete list of all changes.
Download
The latest release of BIND 9 software can always be found on our web
site at http://www.isc.org/software/bind. There you will find
additional information about each release, source code, and some
pre-compiled versions for certain operating systems.
Support
Product support information is available on
http://www.isc.org/services/support for paid support options. Free
support is provided by our user community via a mailing list.
Information on all public email lists is available at
https://lists.isc.org/mailman/listinfo.
New Features
9.4-ESV-R4
None.
Feature Changes
9.4-ESV-R4
None.
Security Fixes
9.4-ESV-R4
* Adding a NO DATA signed negative response to cache failed to clear
any matching RRSIG records already in cache. A subsequent lookup of
the cached NO DATA entry could crash named (INSIST) when the
unexpected RRSIG was also returned with the NO DATA cache entry.
[RT #22288] [CVE-2010-3613] [VU#706148]
* BIND, acting as a DNSSEC validator, was determining if the NS RRset
is insecure based on a value that could mean either that the RRset
is actually insecure or that there wasn't a matching key for the
RRSIG in the DNSKEY RRset when resuming from validating the DNSKEY
RRset. This can happen when in the middle of a DNSKEY algorithm
rollover, when two different algorithms were used to sign a zone
but only the new set of keys are in the zone DNSKEY RRset. [RT
#22309] [CVE-2010-3614] [VU#837744]
Bug Fixes
9.4-ESV-R4
* isc_print_vsnprintf() failed to check if there was space available
in the buffer when adding a left justified character with a non
zero width, (e.g. "%-1c"). [RT #22270]
* win32: add more dependencies to BINDBuild.dsw. [RT #22062]
Thank You
Thank you to everyone who assisted us in making this release possible.
If you would like to contribute to ISC to assist us in continuing to
make quality open source software, please visit our donations page at
http://www.isc.org/supportisc.
+4 -10
View File
@@ -1,8 +1,8 @@
/*
* Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2004, 2005, 2008 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: acconfig.h,v 1.44.18.5 2005/04/29 00:15:20 marka Exp $ */
/* $Id: acconfig.h,v 1.44.18.7 2008/12/01 23:45:56 tbox Exp $ */
/*! \file */
@@ -25,9 +25,6 @@
***/
@TOP@
/** define to `int' if <sys/types.h> doesn't define. */
#undef ssize_t
/** define on DEC OSF to enable 4.4BSD style sa_len support */
#undef _SOCKADDR_LEN
@@ -61,9 +58,6 @@
/** define if you have the NET_RT_IFLIST sysctl variable and sys/sysctl.h */
#undef HAVE_IFLIST_SYSCTL
/** define if chroot() is available */
#undef HAVE_CHROOT
/** define if tzset() is available */
#undef HAVE_TZSET
@@ -115,7 +109,7 @@ int sigwait(const unsigned int *set, int *sig);
* The silly continuation line is to keep configure from
* commenting out the #undef.
*/
#undef \
va_start
#define va_start(ap, last) \
+4 -3
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: check-tool.c,v 1.10.18.20 2008/10/24 01:43:17 tbox Exp $ */
/* $Id: check-tool.c,v 1.10.18.23 2009/09/24 21:38:50 jinmei Exp $ */
/*! \file */
@@ -105,6 +105,7 @@ static isc_logcategory_t categories[] = {
{ "queries", 0 },
{ "unmatched", 0 },
{ "update-security", 0 },
{ "query-errors", 0 },
{ NULL, 0 }
};
@@ -156,7 +157,7 @@ checkns(dns_zone_t *zone, dns_name_t *name, dns_name_t *owner,
cur->ai_next != NULL)
cur = cur->ai_next;
if (cur != NULL && cur->ai_canonname != NULL &&
strcasecmp(ai->ai_canonname, namebuf) != 0) {
strcasecmp(cur->ai_canonname, namebuf) != 0) {
dns_zone_log(zone, ISC_LOG_ERROR,
"%s/NS '%s' (out of zone) "
"is a CNAME (illegal)",
+2 -2
View File
@@ -1,7 +1,7 @@
.\" Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
.\" Copyright (C) 2000-2002 Internet Software Consortium.
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" Permission to use, copy, modify, and/or distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
.\" $Id: named-checkconf.8,v 1.16.18.13 2007/06/20 02:26:58 marka Exp $
.\" $Id: named-checkconf.8,v 1.16.18.14 2009/07/11 01:31:43 tbox Exp $
.\"
.hy 0
.ad l
+13 -19
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: named-checkconf.c,v 1.28.18.16 2007/11/26 23:46:18 tbox Exp $ */
/* $Id: named-checkconf.c,v 1.28.18.18 2009/02/16 23:46:03 tbox Exp $ */
/*! \file */
@@ -59,9 +59,9 @@ isc_log_t *logc = NULL;
/*% usage */
static void
usage(void) {
fprintf(stderr, "usage: named-checkconf [-j] [-v] [-z] [-t directory] "
fprintf(stderr, "usage: named-checkconf [-j] [-v] [-z] [-t directory] "
"[named.conf]\n");
exit(1);
exit(1);
}
/*% directory callback */
@@ -171,9 +171,9 @@ configure_zone(const char *vclass, const char *view,
zname = cfg_obj_asstring(cfg_tuple_get(zconfig, "name"));
classobj = cfg_tuple_get(zconfig, "class");
if (!cfg_obj_isstring(classobj))
zclass = vclass;
else
if (!cfg_obj_isstring(classobj))
zclass = vclass;
else
zclass = cfg_obj_asstring(classobj);
zoptions = cfg_tuple_get(zconfig, "options");
@@ -192,9 +192,9 @@ configure_zone(const char *vclass, const char *view,
return (ISC_R_FAILURE);
if (strcasecmp(cfg_obj_asstring(typeobj), "master") != 0)
return (ISC_R_SUCCESS);
cfg_map_get(zoptions, "database", &dbobj);
if (dbobj != NULL)
return (ISC_R_SUCCESS);
cfg_map_get(zoptions, "database", &dbobj);
if (dbobj != NULL)
return (ISC_R_SUCCESS);
cfg_map_get(zoptions, "file", &fileobj);
if (fileobj == NULL)
return (ISC_R_FAILURE);
@@ -285,8 +285,8 @@ configure_zone(const char *vclass, const char *view,
} else
INSIST(0);
} else {
zone_options |= DNS_ZONEOPT_CHECKNAMES;
zone_options |= DNS_ZONEOPT_CHECKNAMESFAIL;
zone_options |= DNS_ZONEOPT_CHECKNAMES;
zone_options |= DNS_ZONEOPT_CHECKNAMESFAIL;
}
masterformat = dns_masterformat_text;
@@ -397,7 +397,7 @@ main(int argc, char **argv) {
int exit_status = 0;
isc_entropy_t *ectx = NULL;
isc_boolean_t load_zones = ISC_FALSE;
while ((c = isc_commandline_parse(argc, argv, "djt:vz")) != EOF) {
switch (c) {
case 'd':
@@ -415,12 +415,6 @@ main(int argc, char **argv) {
isc_result_totext(result));
exit(1);
}
result = isc_dir_chdir("/");
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "isc_dir_chdir: %s\n",
isc_result_totext(result));
exit(1);
}
break;
case 'v':
+2 -2
View File
@@ -2,7 +2,7 @@
- Copyright (C) 2004, 2005, 2007 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2000-2002 Internet Software Consortium.
-
- Permission to use, copy, modify, and distribute this software for any
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
-
@@ -14,7 +14,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: named-checkconf.html,v 1.9.18.20 2007/06/20 02:26:58 marka Exp $ -->
<!-- $Id: named-checkconf.html,v 1.9.18.21 2009/07/11 01:31:43 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+5 -5
View File
@@ -1,7 +1,7 @@
.\" Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
.\" Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
.\" Copyright (C) 2000-2002 Internet Software Consortium.
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" Permission to use, copy, modify, and/or distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
.\" $Id: named-checkzone.8,v 1.18.18.23 2007/06/20 02:26:58 marka Exp $
.\" $Id: named-checkzone.8,v 1.18.18.25 2009/07/11 01:31:43 tbox Exp $
.\"
.hy 0
.ad l
@@ -77,7 +77,7 @@ When loading the zone file read the journal if it exists.
.PP
\-c \fIclass\fR
.RS 4
Specify the class of the zone. If not specified "IN" is assumed.
Specify the class of the zone. If not specified, "IN" is assumed.
.RE
.PP
\-i \fImode\fR
@@ -263,7 +263,7 @@ BIND 9 Administrator Reference Manual.
.PP
Internet Systems Consortium
.SH "COPYRIGHT"
Copyright \(co 2004\-2007 Internet Systems Consortium, Inc. ("ISC")
Copyright \(co 2004\-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
.br
Copyright \(co 2000\-2002 Internet Software Consortium.
.br
+8 -10
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: named-checkzone.c,v 1.29.18.21 2008/10/24 01:43:17 tbox Exp $ */
/* $Id: named-checkzone.c,v 1.29.18.24 2009/05/29 02:19:20 marka Exp $ */
/*! \file */
@@ -122,9 +122,13 @@ main(int argc, char **argv) {
*/
if (strncmp(prog_name, "lt-", 3) == 0)
prog_name += 3;
if (strcmp(prog_name, "named-checkzone") == 0)
#define PROGCMP(X) \
(strcasecmp(prog_name, X) == 0 || strcasecmp(prog_name, X ".exe") == 0)
if (PROGCMP("named-checkzone"))
progmode = progmode_check;
else if (strcmp(prog_name, "named-compilezone") == 0)
else if (PROGCMP("named-compilezone"))
progmode = progmode_compile;
else
INSIST(0);
@@ -265,12 +269,6 @@ main(int argc, char **argv) {
isc_result_totext(result));
exit(1);
}
result = isc_dir_chdir("/");
if (result != ISC_R_SUCCESS) {
fprintf(stderr, "isc_dir_chdir: %s\n",
isc_result_totext(result));
exit(1);
}
break;
case 's':
@@ -2,7 +2,7 @@
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
[<!ENTITY mdash "&#8212;">]>
<!--
- Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2000-2002 Internet Software Consortium.
-
- Permission to use, copy, modify, and/or distribute this software for any
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: named-checkzone.docbook,v 1.11.18.21 2007/08/28 07:19:55 tbox Exp $ -->
<!-- $Id: named-checkzone.docbook,v 1.11.18.23 2009/01/22 23:45:59 tbox Exp $ -->
<refentry id="man.named-checkzone">
<refentryinfo>
<date>June 13, 2000</date>
@@ -36,6 +36,7 @@
<year>2005</year>
<year>2006</year>
<year>2007</year>
<year>2009</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
<copyright>
@@ -168,7 +169,7 @@
<term>-c <replaceable class="parameter">class</replaceable></term>
<listitem>
<para>
Specify the class of the zone. If not specified "IN" is assumed.
Specify the class of the zone. If not specified, "IN" is assumed.
</para>
</listitem>
</varlistentry>
+9 -9
View File
@@ -1,8 +1,8 @@
<!--
- Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2000-2002 Internet Software Consortium.
-
- Permission to use, copy, modify, and distribute this software for any
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
-
@@ -14,7 +14,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: named-checkzone.html,v 1.11.18.30 2007/06/20 02:26:58 marka Exp $ -->
<!-- $Id: named-checkzone.html,v 1.11.18.32 2009/07/11 01:31:43 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
@@ -33,7 +33,7 @@
<div class="cmdsynopsis"><p><code class="command">named-compilezone</code> [<code class="option">-d</code>] [<code class="option">-j</code>] [<code class="option">-q</code>] [<code class="option">-v</code>] [<code class="option">-c <em class="replaceable"><code>class</code></em></code>] [<code class="option">-C <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-f <em class="replaceable"><code>format</code></em></code>] [<code class="option">-F <em class="replaceable"><code>format</code></em></code>] [<code class="option">-i <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-k <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-m <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-n <em class="replaceable"><code>mode</code></em></code>] [<code class="option">-o <em class="replaceable"><code>filename</code></em></code>] [<code class="option">-s <em class="replaceable"><code>style</code></em></code>] [<code class="option">-t <em class="replaceable"><code>directory</code></em></code>] [<code class="option">-w <em class="replaceable"><code>directory</code></em></code>] [<code class="option">-D</code>] [<code class="option">-W <em class="replaceable"><code>mode</code></em></code>] {zonename} {filename}</p></div>
</div>
<div class="refsect1" lang="en">
<a name="id2543665"></a><h2>DESCRIPTION</h2>
<a name="id2543668"></a><h2>DESCRIPTION</h2>
<p><span><strong class="command">named-checkzone</strong></span>
checks the syntax and integrity of a zone file. It performs the
same checks as <span><strong class="command">named</strong></span> does when loading a
@@ -53,7 +53,7 @@
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2543700"></a><h2>OPTIONS</h2>
<a name="id2543703"></a><h2>OPTIONS</h2>
<div class="variablelist"><dl>
<dt><span class="term">-d</span></dt>
<dd><p>
@@ -74,7 +74,7 @@
</p></dd>
<dt><span class="term">-c <em class="replaceable"><code>class</code></em></span></dt>
<dd><p>
Specify the class of the zone. If not specified "IN" is assumed.
Specify the class of the zone. If not specified, "IN" is assumed.
</p></dd>
<dt><span class="term">-i <em class="replaceable"><code>mode</code></em></span></dt>
<dd>
@@ -233,14 +233,14 @@
</dl></div>
</div>
<div class="refsect1" lang="en">
<a name="id2544299"></a><h2>RETURN VALUES</h2>
<a name="id2544302"></a><h2>RETURN VALUES</h2>
<p><span><strong class="command">named-checkzone</strong></span>
returns an exit status of 1 if
errors were detected and 0 otherwise.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2544311"></a><h2>SEE ALSO</h2>
<a name="id2544314"></a><h2>SEE ALSO</h2>
<p><span class="citerefentry"><span class="refentrytitle">named</span>(8)</span>,
<span class="citerefentry"><span class="refentrytitle">named-checkconf</span>(8)</span>,
<em class="citetitle">RFC 1035</em>,
@@ -248,7 +248,7 @@
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2544344"></a><h2>AUTHOR</h2>
<a name="id2544347"></a><h2>AUTHOR</h2>
<p><span class="corpauthor">Internet Systems Consortium</span>
</p>
</div>
+6 -6
View File
@@ -1,7 +1,7 @@
.\" Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
.\" Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
.\" Copyright (C) 2000-2003 Internet Software Consortium.
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" Permission to use, copy, modify, and/or distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
.\" $Id: dig.1,v 1.23.18.24 2008/10/14 01:30:11 tbox Exp $
.\" $Id: dig.1,v 1.23.18.27 2009/07/11 01:31:43 tbox Exp $
.\"
.hy 0
.ad l
@@ -291,7 +291,7 @@ A synonym for
.PP
\fB+[no]adflag\fR
.RS 4
Set [do not set] the AD (authentic data) bit in the query. The AD bit currently has a standard meaning only in responses, not in queries, but the ability to set the bit in the query is provided for completeness.
Set [do not set] the AD (authentic data) bit in the query. This requests the server to return whether all of the answer and authority sections have all been validated as secure according to the security policy of the server. AD=1 indicates that all records have been validated as secure and the answer is not from a OPT\-OUT range. AD=0 indicate that some part of the answer was insecure or not validated.
.RE
.PP
\fB+[no]cdflag\fR
@@ -480,7 +480,7 @@ Chase DNSSEC signature chains. Requires dig be compiled with \-DDIG_SIGCHASE.
Specifies a file containing trusted keys to be used with
\fB+sigchase\fR. Each DNSKEY record must be on its own line.
.sp
If not specified
If not specified,
\fBdig\fR
will look for
\fI/etc/trusted\-key.key\fR
@@ -557,7 +557,7 @@ RFC1035.
.PP
There are probably too many query options.
.SH "COPYRIGHT"
Copyright \(co 2004\-2008 Internet Systems Consortium, Inc. ("ISC")
Copyright \(co 2004\-2009 Internet Systems Consortium, Inc. ("ISC")
.br
Copyright \(co 2000\-2003 Internet Software Consortium.
.br
+34 -8
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dig.c,v 1.186.18.33 2008/10/15 02:19:18 marka Exp $ */
/* $Id: dig.c,v 1.186.18.37 2009/05/06 10:21:00 fdupont Exp $ */
/*! \file */
@@ -111,6 +111,24 @@ static const char * const rcodetext[] = {
"BADVERS"
};
/*% safe rcodetext[] */
static char *
rcode_totext(dns_rcode_t rcode)
{
static char buf[sizeof("?65535")];
union {
const char *consttext;
char *deconsttext;
} totext;
if (rcode >= (sizeof(rcodetext)/sizeof(rcodetext[0]))) {
snprintf(buf, sizeof(buf), "?%u", rcode);
totext.deconsttext = buf;
} else
totext.consttext = rcodetext[rcode];
return totext.deconsttext;
}
/*% print usage */
static void
print_usage(FILE *fp) {
@@ -468,7 +486,8 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
if (headers) {
printf(";; ->>HEADER<<- opcode: %s, status: %s, "
"id: %u\n",
opcodetext[msg->opcode], rcodetext[msg->rcode],
opcodetext[msg->opcode],
rcode_totext(msg->rcode),
msg->id);
printf(";; flags:");
if ((msg->flags & DNS_MESSAGEFLAG_QR) != 0)
@@ -800,7 +819,9 @@ plus_option(char *option, isc_boolean_t is_batchfile,
switch (cmd[1]) {
case 'e': /* defname */
FULLCHECK("defname");
usesearch = state;
if (!lookup->trace) {
usesearch = state;
}
break;
case 'n': /* dnssec */
FULLCHECK("dnssec");
@@ -842,7 +863,7 @@ plus_option(char *option, isc_boolean_t is_batchfile,
lookup->identify = state;
break;
case 'g': /* ignore */
default: /* Inherets default for compatibility */
default: /* Inherits default for compatibility */
FULLCHECK("ignore");
lookup->ignore = ISC_TRUE;
}
@@ -928,7 +949,9 @@ plus_option(char *option, isc_boolean_t is_batchfile,
switch (cmd[1]) {
case 'e': /* search */
FULLCHECK("search");
usesearch = state;
if (!lookup->trace) {
usesearch = state;
}
break;
case 'h':
if (cmd[2] != 'o')
@@ -949,8 +972,10 @@ plus_option(char *option, isc_boolean_t is_batchfile,
break;
case 'w': /* showsearch */
FULLCHECK("showsearch");
showsearch = state;
usesearch = state;
if (!lookup->trace) {
showsearch = state;
usesearch = state;
}
break;
default:
goto invalid_option;
@@ -1009,6 +1034,7 @@ plus_option(char *option, isc_boolean_t is_batchfile,
lookup->section_additional = ISC_FALSE;
lookup->section_authority = ISC_TRUE;
lookup->section_question = ISC_FALSE;
usesearch = ISC_FALSE;
}
break;
case 'i': /* tries */
+17 -14
View File
@@ -2,7 +2,7 @@
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
[<!ENTITY mdash "&#8212;">]>
<!--
- Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2000-2003 Internet Software Consortium.
-
- Permission to use, copy, modify, and/or distribute this software for any
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: dig.docbook,v 1.17.18.24 2008/10/14 00:54:40 marka Exp $ -->
<!-- $Id: dig.docbook,v 1.17.18.27 2009/02/02 04:45:22 marka Exp $ -->
<refentry id="man.dig">
<refentryinfo>
@@ -43,6 +43,7 @@
<year>2006</year>
<year>2007</year>
<year>2008</year>
<year>2009</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
<copyright>
@@ -449,17 +450,19 @@
<varlistentry>
<term><option>+[no]adflag</option></term>
<listitem>
<para>
Set [do not set] the AD (authentic data) bit in the query. The
AD bit
currently has a standard meaning only in responses, not in
queries,
but the ability to set the bit in the query is provided for
completeness.
</para>
</listitem>
</varlistentry>
<listitem>
<para>
Set [do not set] the AD (authentic data) bit in the
query. This requests the server to return whether
all of the answer and authority sections have all
been validated as secure according to the security
policy of the server. AD=1 indicates that all records
have been validated as secure and the answer is not
from a OPT-OUT range. AD=0 indicate that some part
of the answer was insecure or not validated.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><option>+[no]cdflag</option></term>
@@ -816,7 +819,7 @@
on its own line.
</para>
<para>
If not specified <command>dig</command> will look for
If not specified, <command>dig</command> will look for
<filename>/etc/trusted-key.key</filename> then
<filename>trusted-key.key</filename> in the current directory.
</para>
+22 -20
View File
@@ -1,8 +1,8 @@
<!--
- Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2000-2003 Internet Software Consortium.
-
- Permission to use, copy, modify, and distribute this software for any
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
-
@@ -14,7 +14,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: dig.html,v 1.13.18.30 2008/10/14 01:30:11 tbox Exp $ -->
<!-- $Id: dig.html,v 1.13.18.33 2009/07/11 01:31:44 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
@@ -34,7 +34,7 @@
<div class="cmdsynopsis"><p><code class="command">dig</code> [global-queryopt...] [query...]</p></div>
</div>
<div class="refsect1" lang="en">
<a name="id2543515"></a><h2>DESCRIPTION</h2>
<a name="id2543518"></a><h2>DESCRIPTION</h2>
<p><span><strong class="command">dig</strong></span>
(domain information groper) is a flexible tool
for interrogating DNS name servers. It performs DNS lookups and
@@ -80,7 +80,7 @@
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2543589"></a><h2>SIMPLE USAGE</h2>
<a name="id2543592"></a><h2>SIMPLE USAGE</h2>
<p>
A typical invocation of <span><strong class="command">dig</strong></span> looks like:
</p>
@@ -126,7 +126,7 @@
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2543680"></a><h2>OPTIONS</h2>
<a name="id2543683"></a><h2>OPTIONS</h2>
<p>
The <code class="option">-b</code> option sets the source IP address of the query
to <em class="parameter"><code>address</code></em>. This must be a valid
@@ -230,7 +230,7 @@
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2544028"></a><h2>QUERY OPTIONS</h2>
<a name="id2544032"></a><h2>QUERY OPTIONS</h2>
<p><span><strong class="command">dig</strong></span>
provides a number of query options which affect
the way in which lookups are made and the results displayed. Some of
@@ -308,13 +308,15 @@
</p></dd>
<dt><span class="term"><code class="option">+[no]adflag</code></span></dt>
<dd><p>
Set [do not set] the AD (authentic data) bit in the query. The
AD bit
currently has a standard meaning only in responses, not in
queries,
but the ability to set the bit in the query is provided for
completeness.
</p></dd>
Set [do not set] the AD (authentic data) bit in the
query. This requests the server to return whether
all of the answer and authority sections have all
been validated as secure according to the security
policy of the server. AD=1 indicates that all records
have been validated as secure and the answer is not
from a OPT-OUT range. AD=0 indicate that some part
of the answer was insecure or not validated.
</p></dd>
<dt><span class="term"><code class="option">+[no]cdflag</code></span></dt>
<dd><p>
Set [do not set] the CD (checking disabled) bit in the query.
@@ -529,7 +531,7 @@
on its own line.
</p>
<p>
If not specified <span><strong class="command">dig</strong></span> will look for
If not specified, <span><strong class="command">dig</strong></span> will look for
<code class="filename">/etc/trusted-key.key</code> then
<code class="filename">trusted-key.key</code> in the current directory.
</p>
@@ -549,7 +551,7 @@
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2545149"></a><h2>MULTIPLE QUERIES</h2>
<a name="id2545153"></a><h2>MULTIPLE QUERIES</h2>
<p>
The BIND 9 implementation of <span><strong class="command">dig </strong></span>
supports
@@ -595,7 +597,7 @@ dig +qr www.isc.org any -x 127.0.0.1 isc.org ns +noqr
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2545211"></a><h2>IDN SUPPORT</h2>
<a name="id2545214"></a><h2>IDN SUPPORT</h2>
<p>
If <span><strong class="command">dig</strong></span> has been built with IDN (internationalized
domain name) support, it can accept and display non-ASCII domain names.
@@ -609,14 +611,14 @@ dig +qr www.isc.org any -x 127.0.0.1 isc.org ns +noqr
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2545234"></a><h2>FILES</h2>
<a name="id2545237"></a><h2>FILES</h2>
<p><code class="filename">/etc/resolv.conf</code>
</p>
<p><code class="filename">${HOME}/.digrc</code>
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2545251"></a><h2>SEE ALSO</h2>
<a name="id2545322"></a><h2>SEE ALSO</h2>
<p><span class="citerefentry"><span class="refentrytitle">host</span>(1)</span>,
<span class="citerefentry"><span class="refentrytitle">named</span>(8)</span>,
<span class="citerefentry"><span class="refentrytitle">dnssec-keygen</span>(8)</span>,
@@ -624,7 +626,7 @@ dig +qr www.isc.org any -x 127.0.0.1 isc.org ns +noqr
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2545356"></a><h2>BUGS</h2>
<a name="id2545360"></a><h2>BUGS</h2>
<p>
There are probably too many query options.
</p>
+150 -48
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dighost.c,v 1.259.18.49 2008/07/23 23:33:02 marka Exp $ */
/* $Id: dighost.c,v 1.259.18.58 2009/06/24 03:44:52 marka Exp $ */
/*! \file
* \note
@@ -583,6 +583,11 @@ copy_server_list(lwres_conf_t *confdata, dig_serverlist_t *dest) {
for (i = 0; i < confdata->nsnext; i++) {
af = addr2af(confdata->nameservers[i].family);
if (af == AF_INET && !have_ipv4)
continue;
if (af == AF_INET6 && !have_ipv6)
continue;
lwres_net_ntop(af, confdata->nameservers[i].address,
tmp, sizeof(tmp));
newsrv = make_server(tmp, tmp);
@@ -770,7 +775,7 @@ make_empty_lookup(void) {
* the query list, since it will be regenerated by the setup_lookup()
* function, nor does it queue up the new lookup for processing.
* Caution: If you don't clone the servers, you MUST clone the server
* list seperately from somewhere else, or construct it by hand.
* list separately from somewhere else, or construct it by hand.
*/
dig_lookup_t *
clone_lookup(dig_lookup_t *lookold, isc_boolean_t servers) {
@@ -1004,10 +1009,18 @@ void
setup_system(void) {
dig_searchlist_t *domain = NULL;
lwres_result_t lwresult;
unsigned int lwresflags;
debug("setup_system()");
lwresult = lwres_context_create(&lwctx, mctx, mem_alloc, mem_free, 1);
lwresflags = LWRES_CONTEXT_SERVERMODE;
if (have_ipv4)
lwresflags |= LWRES_CONTEXT_USEIPV4;
if (have_ipv6)
lwresflags |= LWRES_CONTEXT_USEIPV6;
lwresult = lwres_context_create(&lwctx, mctx, mem_alloc, mem_free,
lwresflags);
if (lwresult != LWRES_R_SUCCESS)
fatal("lwres_context_create failed");
@@ -1033,8 +1046,12 @@ setup_system(void) {
debug("ndots is %d.", ndots);
}
/* If user doesn't specify server use nameservers from resolv.conf. */
if (ISC_LIST_EMPTY(server_list))
copy_server_list(lwconf, &server_list);
/* If we don't find a nameserver fall back to localhost */
if (lwconf->nsnext == 0) {
if (ISC_LIST_EMPTY(server_list)) {
if (have_ipv4) {
lwresult = add_nameserver(lwconf, "127.0.0.1", AF_INET);
if (lwresult != ISC_R_SUCCESS)
@@ -1045,10 +1062,9 @@ setup_system(void) {
if (lwresult != ISC_R_SUCCESS)
fatal("add_nameserver failed");
}
}
if (ISC_LIST_EMPTY(server_list))
copy_server_list(lwconf, &server_list);
}
#ifdef WITH_IDN
initialize_idn();
@@ -1387,7 +1403,7 @@ start_lookup(void) {
key_name) == ISC_TRUE)
trustedkey = tk_list.key[i];
/*
* Verifier que la temp est bien la plus basse
* Verify temp is really the lowest
* WARNING
*/
}
@@ -2174,6 +2190,21 @@ bringup_timer(dig_query_t *query, unsigned int default_timeout) {
check_result(result, "isc_timer_create");
}
static void
force_timeout(dig_lookup_t *l, dig_query_t *query) {
isc_event_t *event;
event = isc_event_allocate(mctx, query, ISC_TIMEREVENT_IDLE,
connect_timeout, l,
sizeof(isc_event_t));
if (event == NULL) {
fatal("isc_event_allocate: %s",
isc_result_totext(ISC_R_NOMEMORY));
}
isc_task_send(global_task, &event);
}
static void
connect_done(isc_task_t *task, isc_event_t *event);
@@ -2193,7 +2224,16 @@ send_tcp_connect(dig_query_t *query) {
l = query->lookup;
query->waiting_connect = ISC_TRUE;
query->lookup->current_query = query;
get_address(query->servname, port, &query->sockaddr);
result = get_address(query->servname, port, &query->sockaddr);
if (result == ISC_R_NOTFOUND) {
/*
* This servname doesn't have an address. Try the next server
* by triggering an immediate 'timeout' (we lie, but the effect
* is the same).
*/
force_timeout(l, query);
return;
}
if (specified_source &&
(isc_sockaddr_pf(&query->sockaddr) !=
@@ -2266,7 +2306,12 @@ send_udp(dig_query_t *query) {
if (!query->recv_made) {
/* XXX Check the sense of this, need assertion? */
query->waiting_connect = ISC_FALSE;
get_address(query->servname, port, &query->sockaddr);
result = get_address(query->servname, port, &query->sockaddr);
if (result == ISC_R_NOTFOUND) {
/* This servname doesn't have an address. */
force_timeout(l, query);
return;
}
result = isc_socket_create(socketmgr,
isc_sockaddr_pf(&query->sockaddr),
@@ -2337,8 +2382,14 @@ connect_timeout(isc_task_t *task, isc_event_t *event) {
cq = query->lookup->current_query;
if (!l->tcp_mode)
send_udp(ISC_LIST_NEXT(cq, link));
else
else {
isc_socket_cancel(query->sock, NULL,
ISC_SOCKCANCEL_ALL);
isc_socket_detach(&query->sock);
sockcount--;
debug("sockcount=%d", sockcount);
send_tcp_connect(ISC_LIST_NEXT(cq, link));
}
UNLOCK_LOOKUP;
return;
}
@@ -2894,18 +2945,8 @@ recv_done(isc_task_t *task, isc_event_t *event) {
if (result == ISC_R_SUCCESS && (msgflags & DNS_MESSAGEFLAG_QR) == 0)
printf(";; Warning: query response not set\n");
if (!match) {
isc_buffer_invalidate(&query->recvbuf);
isc_buffer_init(&query->recvbuf, query->recvspace, COMMSIZE);
ISC_LIST_ENQUEUE(query->recvlist, &query->recvbuf, link);
result = isc_socket_recvv(query->sock, &query->recvlist, 1,
global_task, recv_done, query);
check_result(result, "isc_socket_recvv");
recvcount++;
isc_event_free(&event);
UNLOCK_LOOKUP;
return;
}
if (!match)
goto udp_mismatch;
result = dns_message_create(mctx, DNS_MESSAGE_INTENTPARSE, &msg);
check_result(result, "dns_message_create");
@@ -2960,6 +3001,52 @@ recv_done(isc_task_t *task, isc_event_t *event) {
UNLOCK_LOOKUP;
return;
}
if (msg->counts[DNS_SECTION_QUESTION] != 0) {
match = ISC_TRUE;
for (result = dns_message_firstname(msg, DNS_SECTION_QUESTION);
result == ISC_R_SUCCESS && match;
result = dns_message_nextname(msg, DNS_SECTION_QUESTION)) {
dns_name_t *name = NULL;
dns_rdataset_t *rdataset;
dns_message_currentname(msg, DNS_SECTION_QUESTION,
&name);
for (rdataset = ISC_LIST_HEAD(name->list);
rdataset != NULL;
rdataset = ISC_LIST_NEXT(rdataset, link)) {
if (l->rdtype != rdataset->type ||
l->rdclass != rdataset->rdclass ||
!dns_name_equal(l->name, name)) {
char namestr[DNS_NAME_FORMATSIZE];
char typebuf[DNS_RDATATYPE_FORMATSIZE];
char classbuf[DNS_RDATACLASS_FORMATSIZE];
dns_name_format(name, namestr,
sizeof(namestr));
dns_rdatatype_format(rdataset->type,
typebuf,
sizeof(typebuf));
dns_rdataclass_format(rdataset->rdclass,
classbuf,
sizeof(classbuf));
printf(";; Question section mismatch: "
"got %s/%s/%s\n",
namestr, typebuf, classbuf);
match = ISC_FALSE;
}
}
}
if (!match) {
dns_message_destroy(&msg);
if (l->tcp_mode) {
isc_event_free(&event);
clear_query(query);
check_next_lookup(l);
UNLOCK_LOOKUP;
return;
} else
goto udp_mismatch;
}
}
if ((msg->flags & DNS_MESSAGEFLAG_TC) != 0 &&
!l->ignore && !l->tcp_mode) {
printf(";; Truncated, retrying in TCP mode.\n");
@@ -3214,6 +3301,19 @@ recv_done(isc_task_t *task, isc_event_t *event) {
}
isc_event_free(&event);
UNLOCK_LOOKUP;
return;
udp_mismatch:
isc_buffer_invalidate(&query->recvbuf);
isc_buffer_init(&query->recvbuf, query->recvspace, COMMSIZE);
ISC_LIST_ENQUEUE(query->recvlist, &query->recvbuf, link);
result = isc_socket_recvv(query->sock, &query->recvlist, 1,
global_task, recv_done, query);
check_result(result, "isc_socket_recvv");
recvcount++;
isc_event_free(&event);
UNLOCK_LOOKUP;
return;
}
/*%
@@ -3221,7 +3321,7 @@ recv_done(isc_task_t *task, isc_event_t *event) {
* used in looking up server names, etc... and needs to use system-supplied
* routines, since they may be using a non-DNS system for these lookups.
*/
void
isc_result_t
get_address(char *host, in_port_t port, isc_sockaddr_t *sockaddr) {
int count;
isc_result_t result;
@@ -3230,9 +3330,11 @@ get_address(char *host, in_port_t port, isc_sockaddr_t *sockaddr) {
result = bind9_getaddresses(host, port, sockaddr, 1, &count);
isc_app_unblock();
if (result != ISC_R_SUCCESS)
fatal("couldn't get address for '%s': %s",
host, isc_result_totext(result));
return (result);
INSIST(count == 1);
return (ISC_R_SUCCESS);
}
/*%
@@ -3286,7 +3388,7 @@ cancel_all(void) {
isc_timer_detach(&current_lookup->timer);
q = ISC_LIST_HEAD(current_lookup->q);
while (q != NULL) {
debug("cancelling query %p, belonging to %p",
debug("canceling query %p, belonging to %p",
q, current_lookup);
nq = ISC_LIST_NEXT(q, link);
if (q->sock != NULL) {
@@ -3602,7 +3704,7 @@ dns_rdataset_t *
search_type(dns_name_t *name, dns_rdatatype_t type, dns_rdatatype_t covers) {
dns_rdataset_t *rdataset;
dns_rdata_sig_t siginfo;
dns_rdata_t sigrdata;
dns_rdata_t sigrdata = DNS_RDATA_INIT;
isc_result_t result;
for (rdataset = ISC_LIST_HEAD(name->list); rdataset != NULL;
@@ -3612,7 +3714,6 @@ search_type(dns_name_t *name, dns_rdatatype_t type, dns_rdatatype_t covers) {
return (rdataset);
} else if ((type == dns_rdatatype_rrsig) &&
(rdataset->type == dns_rdatatype_rrsig)) {
dns_rdata_init(&sigrdata);
result = dns_rdataset_first(rdataset);
check_result(result, "empty rdataset");
dns_rdataset_current(rdataset, &sigrdata);
@@ -4135,7 +4236,7 @@ isc_result_t
grandfather_pb_test(dns_name_t *zone_name, dns_rdataset_t *sigrdataset)
{
isc_result_t result;
dns_rdata_t sigrdata;
dns_rdata_t sigrdata = DNS_RDATA_INIT;
dns_rdata_sig_t siginfo;
result = dns_rdataset_first(sigrdataset);
@@ -4155,6 +4256,7 @@ grandfather_pb_test(dns_name_t *zone_name, dns_rdataset_t *sigrdataset)
}
dns_rdata_freestruct(&siginfo);
dns_rdata_reset(&sigrdata);
} while (dns_rdataset_next(chase_sigkeyrdataset) == ISC_R_SUCCESS);
@@ -4241,7 +4343,7 @@ contains_trusted_key(dns_name_t *name, dns_rdataset_t *rdataset,
isc_mem_t *mctx)
{
isc_result_t result;
dns_rdata_t rdata;
dns_rdata_t rdata = DNS_RDATA_INIT;
dst_key_t *trustedKey = NULL;
dst_key_t *dnsseckey = NULL;
int i;
@@ -4251,7 +4353,6 @@ contains_trusted_key(dns_name_t *name, dns_rdataset_t *rdataset,
result = dns_rdataset_first(rdataset);
check_result(result, "empty rdataset");
dns_rdata_init(&rdata);
do {
dns_rdataset_current(rdataset, &rdata);
@@ -4301,7 +4402,7 @@ sigchase_verify_sig(dns_name_t *name, dns_rdataset_t *rdataset,
isc_mem_t *mctx)
{
isc_result_t result;
dns_rdata_t keyrdata;
dns_rdata_t keyrdata = DNS_RDATA_INIT;
dst_key_t *dnsseckey = NULL;
result = dns_rdataset_first(keyrdataset);
@@ -4324,6 +4425,7 @@ sigchase_verify_sig(dns_name_t *name, dns_rdataset_t *rdataset,
return (ISC_R_SUCCESS);
}
dst_key_free(&dnsseckey);
dns_rdata_reset(&keyrdata);
} while (dns_rdataset_next(chase_keyrdataset) == ISC_R_SUCCESS);
dns_rdata_reset(&keyrdata);
@@ -4337,7 +4439,7 @@ sigchase_verify_sig_key(dns_name_t *name, dns_rdataset_t *rdataset,
isc_mem_t *mctx)
{
isc_result_t result;
dns_rdata_t sigrdata;
dns_rdata_t sigrdata = DNS_RDATA_INIT;
dns_rdata_sig_t siginfo;
result = dns_rdataset_first(sigrdataset);
@@ -4375,6 +4477,7 @@ sigchase_verify_sig_key(dns_name_t *name, dns_rdataset_t *rdataset,
}
}
dns_rdata_freestruct(&siginfo);
dns_rdata_reset(&sigrdata);
} while (dns_rdataset_next(chase_sigkeyrdataset) == ISC_R_SUCCESS);
@@ -4389,25 +4492,23 @@ sigchase_verify_ds(dns_name_t *name, dns_rdataset_t *keyrdataset,
dns_rdataset_t *dsrdataset, isc_mem_t *mctx)
{
isc_result_t result;
dns_rdata_t keyrdata;
dns_rdata_t newdsrdata;
dns_rdata_t dsrdata;
dns_rdata_t keyrdata = DNS_RDATA_INIT;
dns_rdata_t newdsrdata = DNS_RDATA_INIT;
dns_rdata_t dsrdata = DNS_RDATA_INIT;
dns_rdata_ds_t dsinfo;
dst_key_t *dnsseckey = NULL;
unsigned char dsbuf[DNS_DS_BUFFERSIZE];
result = dns_rdataset_first(dsrdataset);
check_result(result, "empty DSset dataset");
dns_rdata_init(&dsrdata);
do {
dns_rdataset_current(dsrdataset, &dsrdata);
result = dns_rdata_tostruct(&dsrdata, &dsinfo, NULL);
check_result(result, "dns_rdata_tostruct for DS");
check_result(result, "dns_rdata_tostruct for DS");
result = dns_rdataset_first(keyrdataset);
check_result(result, "empty KEY dataset");
dns_rdata_init(&keyrdata);
do {
dns_rdataset_current(keyrdataset, &keyrdata);
@@ -4422,7 +4523,6 @@ sigchase_verify_ds(dns_name_t *name, dns_rdataset_t *keyrdataset,
* id of DNSKEY referenced by the DS
*/
if (dsinfo.key_tag == dst_key_id(dnsseckey)) {
dns_rdata_init(&newdsrdata);
result = dns_ds_buildrdata(name, &keyrdata,
dsinfo.digest_type,
@@ -4470,14 +4570,16 @@ sigchase_verify_ds(dns_name_t *name, dns_rdataset_t *keyrdataset,
dns_rdata_reset(&newdsrdata);
}
dst_key_free(&dnsseckey);
dns_rdata_reset(&keyrdata);
dnsseckey = NULL;
} while (dns_rdataset_next(chase_keyrdataset) == ISC_R_SUCCESS);
dns_rdata_reset(&keyrdata);
dns_rdata_reset(&dsrdata);
} while (dns_rdataset_next(chase_dsrdataset) == ISC_R_SUCCESS);
#if 0
dns_rdata_reset(&dsrdata); WARNING
#endif
dns_rdata_reset(&keyrdata);
dns_rdata_reset(&newdsrdata);
dns_rdata_reset(&dsrdata);
return (ISC_R_NOTFOUND);
}
@@ -4870,7 +4972,7 @@ getneededrr(dns_message_t *msg)
{
isc_result_t result;
dns_name_t *name = NULL;
dns_rdata_t sigrdata;
dns_rdata_t sigrdata = DNS_RDATA_INIT;
dns_rdata_sig_t siginfo;
isc_boolean_t true = ISC_TRUE;
@@ -4924,7 +5026,6 @@ getneededrr(dns_message_t *msg)
/* first find the DNSKEY name */
result = dns_rdataset_first(chase_sigrdataset);
check_result(result, "empty RRSIG dataset");
dns_rdata_init(&sigrdata);
dns_rdataset_current(chase_sigrdataset, &sigrdata);
result = dns_rdata_tostruct(&sigrdata, &siginfo, NULL);
check_result(result, "sigrdata tostruct siginfo");
@@ -5302,6 +5403,7 @@ prove_nx_domain(dns_message_t *msg,
}
dns_rdata_freestruct(&nsecstruct);
dns_rdata_reset(&nsec);
}
} while (dns_message_nextname(msg, DNS_SECTION_AUTHORITY)
== ISC_R_SUCCESS);
@@ -5369,7 +5471,7 @@ prove_nx(dns_message_t *msg, dns_name_t *name, dns_rdataclass_t class,
isc_result_t ret;
dns_rdataset_t *nsecset = NULL;
printf("We want to prove the non-existance of a type of rdata %d"
printf("We want to prove the non-existence of a type of rdata %d"
" or of the zone: \n", type);
if ((ret = dns_message_firstname(msg, DNS_SECTION_AUTHORITY))
+6 -6
View File
@@ -1,7 +1,7 @@
.\" Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
.\" Copyright (C) 2004, 2005, 2007-2009 Internet Systems Consortium, Inc. ("ISC")
.\" Copyright (C) 2000-2002 Internet Software Consortium.
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" Permission to use, copy, modify, and/or distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
.\" $Id: host.1,v 1.14.18.16 2008/04/06 01:31:04 tbox Exp $
.\" $Id: host.1,v 1.14.18.18 2009/07/11 01:31:44 tbox Exp $
.\"
.hy 0
.ad l
@@ -132,7 +132,7 @@ option enables
\fBhost\fR
to mimic the behavior of a name server by making non\-recursive queries and expecting to receive answers to those queries that are usually referrals to other name servers.
.PP
By default
By default,
\fBhost\fR
uses UDP when making queries. The
\fB\-T\fR
@@ -154,7 +154,7 @@ option is used to select the query type.
\fItype\fR
can be any recognized query type: CNAME, NS, SOA, SIG, KEY, AXFR, etc. When no query type is specified,
\fBhost\fR
automatically selects an appropriate query type. By default it looks for A, AAAA, and MX records, but if the
automatically selects an appropriate query type. By default, it looks for A, AAAA, and MX records, but if the
\fB\-C\fR
option was given, queries will be made for SOA records, and if
\fIname\fR
@@ -213,7 +213,7 @@ runs.
\fBdig\fR(1),
\fBnamed\fR(8).
.SH "COPYRIGHT"
Copyright \(co 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
Copyright \(co 2004, 2005, 2007\-2009 Internet Systems Consortium, Inc. ("ISC")
.br
Copyright \(co 2000\-2002 Internet Software Consortium.
.br
+28 -12
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: host.c,v 1.94.18.19 2007/08/28 07:19:55 tbox Exp $ */
/* $Id: host.c,v 1.94.18.22 2009/09/08 23:29:03 marka Exp $ */
/*! \file */
@@ -124,6 +124,23 @@ struct rtype rtypes[] = {
{ 0, NULL }
};
static char *
rcode_totext(dns_rcode_t rcode)
{
static char buf[sizeof("?65535")];
union {
const char *consttext;
char *deconsttext;
} totext;
if (rcode >= (sizeof(rcodetext)/sizeof(rcodetext[0]))) {
snprintf(buf, sizeof(buf), "?%u", rcode);
totext.deconsttext = buf;
} else
totext.consttext = rcodetext[rcode];
return totext.deconsttext;
}
static void
show_usage(void) {
fputs(
@@ -270,10 +287,10 @@ printsection(dns_message_t *msg, dns_section_t sectionid,
if (query->lookup->rdtype == dns_rdatatype_axfr &&
!((!list_addresses &&
(list_type == dns_rdatatype_any ||
rdataset->type == list_type)) ||
rdataset->type == list_type)) ||
(list_addresses &&
(rdataset->type == dns_rdatatype_a ||
rdataset->type == dns_rdatatype_aaaa ||
rdataset->type == dns_rdatatype_aaaa ||
rdataset->type == dns_rdatatype_ns ||
rdataset->type == dns_rdatatype_ptr))))
continue;
@@ -377,7 +394,7 @@ chase_cnamechain(dns_message_t *msg, dns_name_t *qname) {
dns_rdata_t rdata = DNS_RDATA_INIT;
unsigned int i = msg->counts[DNS_SECTION_ANSWER];
while (i-- > 0) {
while (i-- > 0) {
rdataset = NULL;
result = dns_message_findname(msg, DNS_SECTION_ANSWER, qname,
dns_rdatatype_cname, 0, NULL,
@@ -429,7 +446,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
printf("Host %s not found: %d(%s)\n",
(msg->rcode != dns_rcode_nxdomain) ? namestr :
query->lookup->textname, msg->rcode,
rcodetext[msg->rcode]);
rcode_totext(msg->rcode));
return (ISC_R_SUCCESS);
}
@@ -451,7 +468,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
sizeof(lookup->textname));
lookup->textname[sizeof(lookup->textname)-1] = 0;
lookup->rdtype = dns_rdatatype_aaaa;
lookup->rdtypeset = ISC_TRUE;
lookup->rdtypeset = ISC_TRUE;
lookup->origin = NULL;
lookup->retries = tries;
ISC_LIST_APPEND(lookup_list, lookup, link);
@@ -462,7 +479,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
sizeof(lookup->textname));
lookup->textname[sizeof(lookup->textname)-1] = 0;
lookup->rdtype = dns_rdatatype_mx;
lookup->rdtypeset = ISC_TRUE;
lookup->rdtypeset = ISC_TRUE;
lookup->origin = NULL;
lookup->retries = tries;
ISC_LIST_APPEND(lookup_list, lookup, link);
@@ -471,7 +488,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
if (!short_form) {
printf(";; ->>HEADER<<- opcode: %s, status: %s, id: %u\n",
opcodetext[msg->opcode], rcodetext[msg->rcode],
opcodetext[msg->opcode], rcode_totext(msg->rcode),
msg->id);
printf(";; flags: ");
if ((msg->flags & DNS_MESSAGEFLAG_QR) != 0) {
@@ -821,11 +838,10 @@ parse_args(isc_boolean_t is_batchfile, int argc, char **argv) {
} else {
strncpy(lookup->textname, hostname, sizeof(lookup->textname));
lookup->textname[sizeof(lookup->textname)-1]=0;
usesearch = ISC_TRUE;
}
lookup->new_search = ISC_TRUE;
ISC_LIST_APPEND(lookup_list, lookup, link);
usesearch = ISC_TRUE;
}
int
@@ -837,7 +853,7 @@ main(int argc, char **argv) {
ISC_LIST_INIT(lookup_list);
ISC_LIST_INIT(server_list);
ISC_LIST_INIT(search_list);
fatalexit = 1;
#ifdef WITH_IDN
idnoptions = IDN_ASCCHECK;
+5 -4
View File
@@ -2,7 +2,7 @@
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
[<!ENTITY mdash "&#8212;">]>
<!--
- Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2004, 2005, 2007-2009 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2000-2002 Internet Software Consortium.
-
- Permission to use, copy, modify, and/or distribute this software for any
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: host.docbook,v 1.5.18.13 2008/04/05 23:46:04 tbox Exp $ -->
<!-- $Id: host.docbook,v 1.5.18.15 2009/01/22 23:46:00 tbox Exp $ -->
<refentry id="man.host">
<refentryinfo>
@@ -42,6 +42,7 @@
<year>2005</year>
<year>2007</year>
<year>2008</year>
<year>2009</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
<copyright>
@@ -180,7 +181,7 @@
</para>
<para>
By default <command>host</command> uses UDP when making
By default, <command>host</command> uses UDP when making
queries. The
<option>-T</option> option makes it use a TCP connection when querying
the name server. TCP will be automatically selected for queries that
@@ -200,7 +201,7 @@
NS, SOA, SIG, KEY, AXFR, etc. When no query type is specified,
<command>host</command> automatically selects an appropriate
query
type. By default it looks for A, AAAA, and MX records, but if the
type. By default, it looks for A, AAAA, and MX records, but if the
<option>-C</option> option was given, queries will be made for SOA
records, and if <parameter>name</parameter> is a
dotted-decimal IPv4
+9 -9
View File
@@ -1,8 +1,8 @@
<!--
- Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2004, 2005, 2007-2009 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2000-2002 Internet Software Consortium.
-
- Permission to use, copy, modify, and distribute this software for any
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
-
@@ -14,7 +14,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: host.html,v 1.7.18.22 2008/04/06 01:31:04 tbox Exp $ -->
<!-- $Id: host.html,v 1.7.18.24 2009/07/11 01:31:44 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
@@ -32,7 +32,7 @@
<div class="cmdsynopsis"><p><code class="command">host</code> [<code class="option">-aCdlnrsTwv</code>] [<code class="option">-c <em class="replaceable"><code>class</code></em></code>] [<code class="option">-N <em class="replaceable"><code>ndots</code></em></code>] [<code class="option">-R <em class="replaceable"><code>number</code></em></code>] [<code class="option">-t <em class="replaceable"><code>type</code></em></code>] [<code class="option">-W <em class="replaceable"><code>wait</code></em></code>] [<code class="option">-m <em class="replaceable"><code>flag</code></em></code>] [<code class="option">-4</code>] [<code class="option">-6</code>] {name} [server]</p></div>
</div>
<div class="refsect1" lang="en">
<a name="id2543431"></a><h2>DESCRIPTION</h2>
<a name="id2543434"></a><h2>DESCRIPTION</h2>
<p><span><strong class="command">host</strong></span>
is a simple utility for performing DNS lookups.
It is normally used to convert names to IP addresses and vice versa.
@@ -130,7 +130,7 @@
referrals to other name servers.
</p>
<p>
By default <span><strong class="command">host</strong></span> uses UDP when making
By default, <span><strong class="command">host</strong></span> uses UDP when making
queries. The
<code class="option">-T</code> option makes it use a TCP connection when querying
the name server. TCP will be automatically selected for queries that
@@ -148,7 +148,7 @@
NS, SOA, SIG, KEY, AXFR, etc. When no query type is specified,
<span><strong class="command">host</strong></span> automatically selects an appropriate
query
type. By default it looks for A, AAAA, and MX records, but if the
type. By default, it looks for A, AAAA, and MX records, but if the
<code class="option">-C</code> option was given, queries will be made for SOA
records, and if <em class="parameter"><code>name</code></em> is a
dotted-decimal IPv4
@@ -184,7 +184,7 @@
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2543797"></a><h2>IDN SUPPORT</h2>
<a name="id2543800"></a><h2>IDN SUPPORT</h2>
<p>
If <span><strong class="command">host</strong></span> has been built with IDN (internationalized
domain name) support, it can accept and display non-ASCII domain names.
@@ -198,12 +198,12 @@
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2543819"></a><h2>FILES</h2>
<a name="id2543822"></a><h2>FILES</h2>
<p><code class="filename">/etc/resolv.conf</code>
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2543831"></a><h2>SEE ALSO</h2>
<a name="id2543834"></a><h2>SEE ALSO</h2>
<p><span class="citerefentry"><span class="refentrytitle">dig</span>(1)</span>,
<span class="citerefentry"><span class="refentrytitle">named</span>(8)</span>.
</p>
+15 -15
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dig.h,v 1.82.18.23 2007/08/28 07:19:55 tbox Exp $ */
/* $Id: dig.h,v 1.82.18.25 2008/12/16 23:46:02 tbox Exp $ */
#ifndef DIG_H
#define DIG_H
@@ -102,7 +102,7 @@ typedef struct dig_searchlist dig_searchlist_t;
/*% The dig_lookup structure */
struct dig_lookup {
isc_boolean_t
pending, /*%< Pending a successful answer */
pending, /*%< Pending a successful answer */
waiting_connect,
doing_xfr,
ns_search_only, /*%< dig +nssearch, host -C */
@@ -133,23 +133,23 @@ struct dig_lookup {
#ifdef DIG_SIGCHASE
isc_boolean_t sigchase;
#if DIG_SIGCHASE_TD
isc_boolean_t do_topdown,
trace_root_sigchase,
rdtype_sigchaseset,
rdclass_sigchaseset;
isc_boolean_t do_topdown,
trace_root_sigchase,
rdtype_sigchaseset,
rdclass_sigchaseset;
/* Name we are going to validate RRset */
char textnamesigchase[MXNAME];
char textnamesigchase[MXNAME];
#endif
#endif
char textname[MXNAME]; /*% Name we're going to be looking up */
char cmdline[MXNAME];
dns_rdatatype_t rdtype;
dns_rdatatype_t qrdtype;
#if DIG_SIGCHASE_TD
dns_rdatatype_t rdtype_sigchase;
dns_rdatatype_t qrdtype_sigchase;
dns_rdataclass_t rdclass_sigchase;
dns_rdatatype_t rdtype_sigchase;
dns_rdatatype_t qrdtype_sigchase;
dns_rdataclass_t rdclass_sigchase;
#endif
dns_rdataclass_t rdclass;
isc_boolean_t rdtypeset;
@@ -231,7 +231,7 @@ struct dig_searchlist {
};
#ifdef DIG_SIGCHASE
struct dig_message {
dns_message_t *msg;
dns_message_t *msg;
ISC_LINK(dig_message_t) link;
};
#endif
@@ -249,7 +249,7 @@ extern dig_searchlistlist_t search_list;
extern unsigned int extrabytes;
extern isc_boolean_t check_ra, have_ipv4, have_ipv6, specified_source,
usesearch, showsearch, qr;
usesearch, showsearch, qr;
extern in_port_t port;
extern unsigned int timeout;
extern isc_mem_t *mctx;
@@ -284,7 +284,7 @@ extern int idnoptions;
/*
* Routines in dighost.c.
*/
void
isc_result_t
get_address(char *host, in_port_t port, isc_sockaddr_t *sockaddr);
isc_result_t
+2 -2
View File
@@ -1,6 +1,6 @@
.\" Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" Permission to use, copy, modify, and/or distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
@@ -12,7 +12,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
.\" $Id: nslookup.1,v 1.1.10.14 2007/05/16 06:11:27 marka Exp $
.\" $Id: nslookup.1,v 1.1.10.15 2009/07/11 01:31:44 tbox Exp $
.\"
.hy 0
.ad l
+34 -13
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: nslookup.c,v 1.101.18.15 2007/08/28 07:19:55 tbox Exp $ */
/* $Id: nslookup.c,v 1.101.18.20 2009/05/06 23:45:59 tbox Exp $ */
#include <config.h>
@@ -26,6 +26,7 @@
#include <isc/commandline.h>
#include <isc/event.h>
#include <isc/parseint.h>
#include <isc/print.h>
#include <isc/string.h>
#include <isc/timer.h>
#include <isc/util.h>
@@ -129,6 +130,23 @@ static const char *rtypetext[] = {
static void flush_lookup_list(void);
static void getinput(isc_task_t *task, isc_event_t *event);
static char *
rcode_totext(dns_rcode_t rcode)
{
static char buf[sizeof("?65535")];
union {
const char *consttext;
char *deconsttext;
} totext;
if (rcode >= (sizeof(rcodetext)/sizeof(rcodetext[0]))) {
snprintf(buf, sizeof(buf), "?%u", rcode);
totext.deconsttext = buf;
} else
totext.consttext = rcodetext[rcode];
return totext.deconsttext;
}
void
dighost_shutdown(void) {
isc_event_t *event = global_event;
@@ -385,14 +403,14 @@ trying(char *frm, dig_lookup_t *lookup) {
isc_result_t
printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
char servtext[ISC_SOCKADDR_FORMATSIZE];
char servtext[ISC_SOCKADDR_FORMATSIZE];
debug("printmessage()");
isc_sockaddr_format(&query->sockaddr, servtext, sizeof(servtext));
printf("Server:\t\t%s\n", query->userarg);
printf("Address:\t%s\n", servtext);
puts("");
if (!short_form) {
@@ -412,7 +430,7 @@ printmessage(dig_query_t *query, dns_message_t *msg, isc_boolean_t headers) {
nametext, sizeof(nametext));
printf("** server can't find %s: %s\n",
(msg->rcode != dns_rcode_nxdomain) ? nametext :
query->lookup->textname, rcodetext[msg->rcode]);
query->lookup->textname, rcode_totext(msg->rcode));
debug("returning with rcode == 0");
return (ISC_R_SUCCESS);
}
@@ -441,13 +459,16 @@ show_settings(isc_boolean_t full, isc_boolean_t serv_only) {
dig_server_t *srv;
isc_sockaddr_t sockaddr;
dig_searchlist_t *listent;
isc_result_t result;
srv = ISC_LIST_HEAD(server_list);
while (srv != NULL) {
char sockstr[ISC_SOCKADDR_FORMATSIZE];
get_address(srv->servername, port, &sockaddr);
result = get_address(srv->servername, port, &sockaddr);
check_result(result, "get_address");
isc_sockaddr_format(&sockaddr, sockstr, sizeof(sockstr));
printf("Default server: %s\nAddress: %s\n",
srv->userarg, sockstr);
@@ -505,7 +526,7 @@ testclass(char *typetext) {
tr.base = typetext;
tr.length = strlen(typetext);
result = dns_rdataclass_fromtext(&rdclass, &tr);
if (result == ISC_R_SUCCESS)
if (result == ISC_R_SUCCESS)
return (ISC_TRUE);
else {
printf("unknown query class: %s\n", typetext);
@@ -603,7 +624,7 @@ setoption(char *opt) {
set_timeout(&opt[8]);
} else if (strncasecmp(opt, "t=", 2) == 0) {
set_timeout(&opt[2]);
} else if (strncasecmp(opt, "rec", 3) == 0) {
} else if (strncasecmp(opt, "rec", 3) == 0) {
recurse = ISC_TRUE;
} else if (strncasecmp(opt, "norec", 5) == 0) {
recurse = ISC_FALSE;
@@ -611,21 +632,21 @@ setoption(char *opt) {
set_tries(&opt[6]);
} else if (strncasecmp(opt, "ret=", 4) == 0) {
set_tries(&opt[4]);
} else if (strncasecmp(opt, "def", 3) == 0) {
} else if (strncasecmp(opt, "def", 3) == 0) {
usesearch = ISC_TRUE;
} else if (strncasecmp(opt, "nodef", 5) == 0) {
usesearch = ISC_FALSE;
} else if (strncasecmp(opt, "vc", 3) == 0) {
} else if (strncasecmp(opt, "vc", 3) == 0) {
tcpmode = ISC_TRUE;
} else if (strncasecmp(opt, "novc", 5) == 0) {
tcpmode = ISC_FALSE;
} else if (strncasecmp(opt, "deb", 3) == 0) {
} else if (strncasecmp(opt, "deb", 3) == 0) {
short_form = ISC_FALSE;
showsearch = ISC_TRUE;
} else if (strncasecmp(opt, "nodeb", 5) == 0) {
short_form = ISC_TRUE;
showsearch = ISC_FALSE;
} else if (strncasecmp(opt, "d2", 2) == 0) {
} else if (strncasecmp(opt, "d2", 2) == 0) {
debugging = ISC_TRUE;
} else if (strncasecmp(opt, "nod2", 4) == 0) {
debugging = ISC_FALSE;
@@ -640,7 +661,7 @@ setoption(char *opt) {
} else if (strncasecmp(opt, "nofail", 3) == 0) {
nofail=ISC_TRUE;
} else {
printf("*** Invalid option: %s\n", opt);
printf("*** Invalid option: %s\n", opt);
}
}
+2 -2
View File
@@ -1,7 +1,7 @@
<!--
- Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
-
- Permission to use, copy, modify, and distribute this software for any
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
-
@@ -13,7 +13,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: nslookup.html,v 1.1.10.21 2007/05/16 06:11:27 marka Exp $ -->
<!-- $Id: nslookup.html,v 1.1.10.22 2009/07/11 01:31:44 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+2 -2
View File
@@ -1,7 +1,7 @@
.\" Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
.\" Copyright (C) 2000-2003 Internet Software Consortium.
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" Permission to use, copy, modify, and/or distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
.\" $Id: dnssec-keygen.8,v 1.23.18.16 2008/10/16 01:29:40 tbox Exp $
.\" $Id: dnssec-keygen.8,v 1.23.18.17 2009/07/11 01:31:44 tbox Exp $
.\"
.hy 0
.ad l
+2 -2
View File
@@ -2,7 +2,7 @@
- Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2000-2003 Internet Software Consortium.
-
- Permission to use, copy, modify, and distribute this software for any
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
-
@@ -14,7 +14,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: dnssec-keygen.html,v 1.9.18.22 2008/10/16 01:29:40 tbox Exp $ -->
<!-- $Id: dnssec-keygen.html,v 1.9.18.23 2009/07/11 01:31:44 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+2 -2
View File
@@ -1,7 +1,7 @@
.\" Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
.\" Copyright (C) 2000-2003 Internet Software Consortium.
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" Permission to use, copy, modify, and/or distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
.\" $Id: dnssec-signzone.8,v 1.28.18.19 2008/10/16 01:29:40 tbox Exp $
.\" $Id: dnssec-signzone.8,v 1.28.18.20 2009/07/11 01:31:44 tbox Exp $
.\"
.hy 0
.ad l
+36 -36
View File
@@ -1,5 +1,5 @@
/*
* Portions Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
* Portions Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
* Portions Copyright (C) 1999-2003 Internet Software Consortium.
* Portions Copyright (C) 1995-2000 by Network Associates, Inc.
*
@@ -16,7 +16,7 @@
* IN CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: dnssec-signzone.c,v 1.177.18.26 2008/06/02 23:46:01 tbox Exp $ */
/* $Id: dnssec-signzone.c,v 1.177.18.29 2009/07/21 06:44:32 tbox Exp $ */
/*! \file */
@@ -194,16 +194,30 @@ newkeystruct(dst_key_t *dstkey, isc_boolean_t signwithkey) {
return (key);
}
/*%
* Sign the given RRset with given key, and add the signature record to the
* given tuple.
*/
static void
signwithkey(dns_name_t *name, dns_rdataset_t *rdataset, dns_rdata_t *rdata,
dst_key_t *key, isc_buffer_t *b)
signwithkey(dns_name_t *name, dns_rdataset_t *rdataset, dst_key_t *key,
dns_ttl_t ttl, dns_diff_t *add, const char *logmsg)
{
isc_result_t result;
isc_stdtime_t jendtime;
char keystr[KEY_FORMATSIZE];
dns_rdata_t trdata = DNS_RDATA_INIT;
unsigned char array[BUFSIZE];
isc_buffer_t b;
dns_difftuple_t *tuple;
key_format(key, keystr, sizeof(keystr));
vbprintf(1, "\t%s %s\n", logmsg, keystr);
jendtime = (jitter != 0) ? isc_random_jitter(endtime, jitter) : endtime;
isc_buffer_init(&b, array, sizeof(array));
result = dns_dnssec_sign(name, rdataset, key, &starttime, &jendtime,
mctx, b, rdata);
mctx, &b, &trdata);
isc_entropy_stopcallbacksources(ectx);
if (result != ISC_R_SUCCESS) {
char keystr[KEY_FORMATSIZE];
@@ -215,7 +229,7 @@ signwithkey(dns_name_t *name, dns_rdataset_t *rdataset, dns_rdata_t *rdata,
if (tryverify) {
result = dns_dnssec_verify(name, rdataset, key,
ISC_TRUE, mctx, rdata);
ISC_TRUE, mctx, &trdata);
if (result == ISC_R_SUCCESS) {
vbprintf(3, "\tsignature verified\n");
INCSTAT(nverified);
@@ -224,6 +238,12 @@ signwithkey(dns_name_t *name, dns_rdataset_t *rdataset, dns_rdata_t *rdata,
INCSTAT(nverifyfailed);
}
}
tuple = NULL;
result = dns_difftuple_create(mctx, DNS_DIFFOP_ADD, name, ttl, &trdata,
&tuple);
check_result(result, "dns_difftuple_create");
dns_diff_append(add, &tuple);
}
static inline isc_boolean_t
@@ -482,24 +502,11 @@ signset(dns_diff_t *del, dns_diff_t *add, dns_dbnode_t *node, dns_name_t *name,
}
if (resign) {
isc_buffer_t b;
dns_rdata_t trdata = DNS_RDATA_INIT;
unsigned char array[BUFSIZE];
char keystr[KEY_FORMATSIZE];
INSIST(!keep);
key_format(key->key, keystr, sizeof(keystr));
vbprintf(1, "\tresigning with dnskey %s\n", keystr);
isc_buffer_init(&b, array, sizeof(array));
signwithkey(name, set, &trdata, key->key, &b);
signwithkey(name, set, key->key, ttl, add,
"resigning with dnskey");
nowsignedby[key->position] = ISC_TRUE;
tuple = NULL;
result = dns_difftuple_create(mctx, DNS_DIFFOP_ADD,
name, ttl, &trdata,
&tuple);
check_result(result, "dns_difftuple_create");
dns_diff_append(add, &tuple);
}
dns_rdata_reset(&sigrdata);
@@ -517,11 +524,6 @@ signset(dns_diff_t *del, dns_diff_t *add, dns_dbnode_t *node, dns_name_t *name,
key != NULL;
key = ISC_LIST_NEXT(key, link))
{
isc_buffer_t b;
dns_rdata_t trdata;
unsigned char array[BUFSIZE];
char keystr[KEY_FORMATSIZE];
if (nowsignedby[key->position])
continue;
@@ -533,16 +535,8 @@ signset(dns_diff_t *del, dns_diff_t *add, dns_dbnode_t *node, dns_name_t *name,
dns_name_equal(name, gorigin))))
continue;
key_format(key->key, keystr, sizeof(keystr));
vbprintf(1, "\tsigning with dnskey %s\n", keystr);
dns_rdata_init(&trdata);
isc_buffer_init(&b, array, sizeof(array));
signwithkey(name, set, &trdata, key->key, &b);
tuple = NULL;
result = dns_difftuple_create(mctx, DNS_DIFFOP_ADD, name,
ttl, &trdata, &tuple);
check_result(result, "dns_difftuple_create");
dns_diff_append(add, &tuple);
signwithkey(name, set, key->key, ttl, add,
"signing with dnskey");
}
isc_mem_put(mctx, wassignedby, arraysize * sizeof(isc_boolean_t));
@@ -2106,6 +2100,9 @@ main(int argc, char *argv[]) {
fatal("cannot load dnskey %s: %s", argv[i],
isc_result_totext(result));
if (!dns_name_equal(gorigin, dst_key_name(newkey)))
fatal("key %s not at origin\n", argv[i]);
key = ISC_LIST_HEAD(keylist);
while (key != NULL) {
dst_key_t *dkey = key->key;
@@ -2143,6 +2140,9 @@ main(int argc, char *argv[]) {
fatal("cannot load dnskey %s: %s", dskeyfile[i],
isc_result_totext(result));
if (!dns_name_equal(gorigin, dst_key_name(newkey)))
fatal("key %s not at origin\n", dskeyfile[i]);
key = ISC_LIST_HEAD(keylist);
while (key != NULL) {
dst_key_t *dkey = key->key;
@@ -2,7 +2,7 @@
- Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2000-2003 Internet Software Consortium.
-
- Permission to use, copy, modify, and distribute this software for any
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
-
@@ -14,7 +14,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: dnssec-signzone.html,v 1.8.18.25 2008/10/16 01:29:40 tbox Exp $ -->
<!-- $Id: dnssec-signzone.html,v 1.8.18.26 2009/07/11 01:31:44 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+4 -4
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: client.c,v 1.219.18.31 2008/05/22 23:46:03 tbox Exp $ */
/* $Id: client.c,v 1.219.18.33 2009/01/19 23:46:14 tbox Exp $ */
#include <config.h>
@@ -1218,7 +1218,7 @@ allowed(isc_netaddr_t *addr, dns_name_t *signer, dns_acl_t *acl) {
* delivered to 'myview'.
*
* We run this unlocked as both the view list and the interface list
* are updated when the approprite task has exclusivity.
* are updated when the appropriate task has exclusivity.
*/
isc_boolean_t
ns_client_isself(dns_view_t *myview, dns_tsigkey_t *mykey,
@@ -2115,7 +2115,7 @@ client_newconn(isc_task_t *task, isc_event_t *event) {
* Let a new client take our place immediately, before
* we wait for a request packet. If we don't,
* telnetting to port 53 (once per CPU) will
* deny service to legititmate TCP clients.
* deny service to legitimate TCP clients.
*/
result = isc_quota_attach(&ns_g_server->tcpquota,
&client->tcpquota);
+7 -5
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2004-2007 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2004-2007, 2009 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2001-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: control.c,v 1.20.10.10 2007/09/13 23:46:26 tbox Exp $ */
/* $Id: control.c,v 1.20.10.12 2009/07/11 23:46:06 tbox Exp $ */
/*! \file */
@@ -56,7 +56,7 @@ command_compare(const char *text, const char *command) {
/*%
* This function is called to process the incoming command
* when a control channel message is received.
* when a control channel message is received.
*/
isc_result_t
ns_control_docommand(isccc_sexpr_t *message, isc_buffer_t *text) {
@@ -159,10 +159,12 @@ ns_control_docommand(isccc_sexpr_t *message, isc_buffer_t *text) {
} else if (command_compare(command, NS_COMMAND_STATUS)) {
result = ns_server_status(ns_g_server, text);
} else if (command_compare(command, NS_COMMAND_FREEZE)) {
result = ns_server_freeze(ns_g_server, ISC_TRUE, command);
result = ns_server_freeze(ns_g_server, ISC_TRUE, command,
text);
} else if (command_compare(command, NS_COMMAND_UNFREEZE) ||
command_compare(command, NS_COMMAND_THAW)) {
result = ns_server_freeze(ns_g_server, ISC_FALSE, command);
result = ns_server_freeze(ns_g_server, ISC_FALSE, command,
text);
} else if (command_compare(command, NS_COMMAND_RECURSING)) {
result = ns_server_dumprecursing(ns_g_server);
} else if (command_compare(command, NS_COMMAND_TIMERPOKE)) {
@@ -1,8 +1,8 @@
/*
* Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2004-2006, 2009 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: client.h,v 1.69.18.9 2006/06/06 00:11:41 marka Exp $ */
/* $Id: client.h,v 1.69.18.11 2009/01/19 23:46:14 tbox Exp $ */
#ifndef NAMED_CLIENT_H
#define NAMED_CLIENT_H 1
@@ -24,7 +24,7 @@
***** Module Info
*****/
/*! \file
/*! \file
* \brief
* This module defines two objects, ns_client_t and ns_clientmgr_t.
*
@@ -155,7 +155,7 @@ struct ns_client {
#define NS_CLIENT_VALID(c) ISC_MAGIC_VALID(c, NS_CLIENT_MAGIC)
#define NS_CLIENTATTR_TCP 0x01
#define NS_CLIENTATTR_RA 0x02 /*%< Client gets recusive service */
#define NS_CLIENTATTR_RA 0x02 /*%< Client gets recursive service */
#define NS_CLIENTATTR_PKTINFO 0x04 /*%< pktinfo is valid */
#define NS_CLIENTATTR_MULTICAST 0x08 /*%< recv'd from multicast */
#define NS_CLIENTATTR_WANTDNSSEC 0x10 /*%< include dnssec records */
@@ -352,8 +352,8 @@ ns_client_qnamereplace(ns_client_t *client, dns_name_t *name);
isc_boolean_t
ns_client_isself(dns_view_t *myview, dns_tsigkey_t *mykey,
isc_sockaddr_t *srcaddr, isc_sockaddr_t *destaddr,
dns_rdataclass_t rdclass, void *arg);
isc_sockaddr_t *srcaddr, isc_sockaddr_t *destaddr,
dns_rdataclass_t rdclass, void *arg);
/*%
* Isself callback.
*/
+4 -3
View File
@@ -1,8 +1,8 @@
/*
* Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2004, 2005, 2009 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: log.h,v 1.21.18.2 2005/04/29 00:15:35 marka Exp $ */
/* $Id: log.h,v 1.21.18.4 2009/09/24 23:46:06 tbox Exp $ */
#ifndef NAMED_LOG_H
#define NAMED_LOG_H 1
@@ -36,6 +36,7 @@
#define NS_LOGCATEGORY_QUERIES (&ns_g_categories[4])
#define NS_LOGCATEGORY_UNMATCHED (&ns_g_categories[5])
#define NS_LOGCATEGORY_UPDATE_SECURITY (&ns_g_categories[6])
#define NS_LOGCATEGORY_QUERY_EERRORS (&ns_g_categories[7])
/*
* Backwards compatibility.
@@ -1,8 +1,8 @@
/*
* Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2004, 2005, 2009 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2000, 2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: lwdclient.h,v 1.14.18.2 2005/04/29 00:15:36 marka Exp $ */
/* $Id: lwdclient.h,v 1.14.18.4 2009/01/19 23:46:14 tbox Exp $ */
#ifndef NAMED_LWDCLIENT_H
#define NAMED_LWDCLIENT_H 1
@@ -39,7 +39,7 @@
#define LWRD_SHUTDOWN (LWRD_EVENTCLASS + 0x0001)
/*% Lighweight Resolver Daemon Client */
/*% Lightweight Resolver Daemon Client */
struct ns_lwdclient {
isc_sockaddr_t address; /*%< where to reply */
struct in6_pktinfo pktinfo;
@@ -1,8 +1,8 @@
/*
* Copyright (C) 2004, 2005 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2004, 2005, 2009 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2001 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: notify.h,v 1.10.18.2 2005/04/29 00:15:37 marka Exp $ */
/* $Id: notify.h,v 1.10.18.4 2009/01/19 23:46:14 tbox Exp $ */
#ifndef NAMED_NOTIFY_H
#define NAMED_NOTIFY_H 1
@@ -41,7 +41,7 @@ void
ns_notify_start(ns_client_t *client);
/*%<
* Examines the incoming message to determine apporiate zone.
* Examines the incoming message to determine appropriate zone.
* Returns FORMERR if there is not exactly one question.
* Returns REFUSED if we do not serve the listed zone.
* Pass the message to the zone module for processing
@@ -1,8 +1,8 @@
/*
* Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2004-2006, 2009 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: server.h,v 1.73.18.8 2006/03/09 23:46:20 marka Exp $ */
/* $Id: server.h,v 1.73.18.10 2009/07/11 23:46:06 tbox Exp $ */
#ifndef NAMED_SERVER_H
#define NAMED_SERVER_H 1
@@ -62,7 +62,7 @@ struct ns_server {
isc_boolean_t server_usehostname;
char * server_id; /*%< User-specified server id */
/*%
/*%
* Current ACL environment. This defines the
* current values of the localhost and localnets
* ACLs.
@@ -207,7 +207,8 @@ ns_server_status(ns_server_t *server, isc_buffer_t *text);
* Enable or disable updates for a zone.
*/
isc_result_t
ns_server_freeze(ns_server_t *server, isc_boolean_t freeze, char *args);
ns_server_freeze(ns_server_t *server, isc_boolean_t freeze, char *args,
isc_buffer_t *text);
/*%
* Dump the current recursive queries.
+3 -3
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2004-2006, 2008 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2004-2006, 2008, 2009 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: interfacemgr.c,v 1.76.18.11 2008/07/23 23:33:02 marka Exp $ */
/* $Id: interfacemgr.c,v 1.76.18.13 2009/01/19 23:46:14 tbox Exp $ */
/*! \file */
@@ -522,7 +522,7 @@ setup_locals(ns_interfacemgr_t *mgr, isc_interface_t *interface) {
result = isc_netaddr_masktoprefixlen(&interface->netmask,
&prefixlen);
/* Non contigious netmasks not allowed by IPv6 arch. */
/* Non contiguous netmasks not allowed by IPv6 arch. */
if (result != ISC_R_SUCCESS && family == AF_INET6)
return (result);
+5 -4
View File
@@ -1,8 +1,8 @@
/*
* Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2004-2006, 2009 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: log.c,v 1.37.18.6 2006/06/09 00:54:08 marka Exp $ */
/* $Id: log.c,v 1.37.18.9 2009/09/24 21:38:50 jinmei Exp $ */
/*! \file */
@@ -44,6 +44,7 @@ static isc_logcategory_t categories[] = {
{ "queries", 0 },
{ "unmatched", 0 },
{ "update-security", 0 },
{ "query-errors", 0 },
{ NULL, 0 }
};
@@ -120,7 +121,7 @@ ns_log_setdefaultchannels(isc_logconfig_t *lcfg) {
/*
* By default, the logging library makes "default_debug" log to
* stderr. In BIND, we want to override this and log to named.run
* instead, unless the the -g option was given.
* instead, unless the -g option was given.
*/
if (! ns_g_logstderr) {
destination.file.stream = NULL;
+5 -5
View File
@@ -1,7 +1,7 @@
.\" Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
.\" Copyright (C) 2004, 2005, 2007-2009 Internet Systems Consortium, Inc. ("ISC")
.\" Copyright (C) 2000, 2001 Internet Software Consortium.
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" Permission to use, copy, modify, and/or distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
.\" $Id: lwresd.8,v 1.15.18.13 2008/10/17 01:29:23 tbox Exp $
.\" $Id: lwresd.8,v 1.15.18.15 2009/07/11 01:31:44 tbox Exp $
.\"
.hy 0
.ad l
@@ -42,7 +42,7 @@ is the daemon providing name lookup services to clients that use the BIND 9 ligh
\fBlwresd\fR
listens for resolver queries on a UDP port on the IPv4 loopback interface, 127.0.0.1. This means that
\fBlwresd\fR
can only be used by processes running on the local machine. By default UDP port number 921 is used for lightweight resolver requests and responses.
can only be used by processes running on the local machine. By default, UDP port number 921 is used for lightweight resolver requests and responses.
.PP
Incoming lightweight resolver requests are decoded by the server which then resolves them using the DNS protocol. When the DNS lookup completes,
\fBlwresd\fR
@@ -217,7 +217,7 @@ The default process\-id file.
.PP
Internet Systems Consortium
.SH "COPYRIGHT"
Copyright \(co 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
Copyright \(co 2004, 2005, 2007\-2009 Internet Systems Consortium, Inc. ("ISC")
.br
Copyright \(co 2000, 2001 Internet Software Consortium.
.br
+4 -3
View File
@@ -2,7 +2,7 @@
"http://www.oasis-open.org/docbook/xml/4.2/docbookx.dtd"
[<!ENTITY mdash "&#8212;">]>
<!--
- Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2004, 2005, 2007-2009 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2000, 2001 Internet Software Consortium.
-
- Permission to use, copy, modify, and/or distribute this software for any
@@ -18,7 +18,7 @@
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: lwresd.docbook,v 1.7.18.10 2008/10/16 23:46:00 tbox Exp $ -->
<!-- $Id: lwresd.docbook,v 1.7.18.12 2009/01/22 23:46:00 tbox Exp $ -->
<refentry>
<refentryinfo>
<date>June 30, 2000</date>
@@ -41,6 +41,7 @@
<year>2005</year>
<year>2007</year>
<year>2008</year>
<year>2009</year>
<holder>Internet Systems Consortium, Inc. ("ISC")</holder>
</copyright>
<copyright>
@@ -87,7 +88,7 @@
listens for resolver queries on a
UDP port on the IPv4 loopback interface, 127.0.0.1. This
means that <command>lwresd</command> can only be used by
processes running on the local machine. By default UDP port
processes running on the local machine. By default, UDP port
number 921 is used for lightweight resolver requests and
responses.
</para>
+9 -9
View File
@@ -1,8 +1,8 @@
<!--
- Copyright (C) 2004, 2005, 2007, 2008 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2004, 2005, 2007-2009 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2000, 2001 Internet Software Consortium.
-
- Permission to use, copy, modify, and distribute this software for any
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
-
@@ -14,7 +14,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: lwresd.html,v 1.5.18.19 2008/10/17 01:29:23 tbox Exp $ -->
<!-- $Id: lwresd.html,v 1.5.18.21 2009/07/11 01:31:45 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
@@ -32,7 +32,7 @@
<div class="cmdsynopsis"><p><code class="command">lwresd</code> [<code class="option">-c <em class="replaceable"><code>config-file</code></em></code>] [<code class="option">-C <em class="replaceable"><code>config-file</code></em></code>] [<code class="option">-d <em class="replaceable"><code>debug-level</code></em></code>] [<code class="option">-f</code>] [<code class="option">-g</code>] [<code class="option">-i <em class="replaceable"><code>pid-file</code></em></code>] [<code class="option">-m <em class="replaceable"><code>flag</code></em></code>] [<code class="option">-n <em class="replaceable"><code>#cpus</code></em></code>] [<code class="option">-P <em class="replaceable"><code>port</code></em></code>] [<code class="option">-p <em class="replaceable"><code>port</code></em></code>] [<code class="option">-s</code>] [<code class="option">-t <em class="replaceable"><code>directory</code></em></code>] [<code class="option">-u <em class="replaceable"><code>user</code></em></code>] [<code class="option">-v</code>] [<code class="option">-4</code>] [<code class="option">-6</code>]</p></div>
</div>
<div class="refsect1" lang="en">
<a name="id2543464"></a><h2>DESCRIPTION</h2>
<a name="id2543467"></a><h2>DESCRIPTION</h2>
<p><span><strong class="command">lwresd</strong></span>
is the daemon providing name lookup
services to clients that use the BIND 9 lightweight resolver
@@ -44,7 +44,7 @@
listens for resolver queries on a
UDP port on the IPv4 loopback interface, 127.0.0.1. This
means that <span><strong class="command">lwresd</strong></span> can only be used by
processes running on the local machine. By default UDP port
processes running on the local machine. By default, UDP port
number 921 is used for lightweight resolver requests and
responses.
</p>
@@ -67,7 +67,7 @@
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2543511"></a><h2>OPTIONS</h2>
<a name="id2543514"></a><h2>OPTIONS</h2>
<div class="variablelist"><dl>
<dt><span class="term">-4</span></dt>
<dd><p>
@@ -197,7 +197,7 @@
</dl></div>
</div>
<div class="refsect1" lang="en">
<a name="id2543928"></a><h2>FILES</h2>
<a name="id2543931"></a><h2>FILES</h2>
<div class="variablelist"><dl>
<dt><span class="term"><code class="filename">/etc/resolv.conf</code></span></dt>
<dd><p>
@@ -210,14 +210,14 @@
</dl></div>
</div>
<div class="refsect1" lang="en">
<a name="id2543968"></a><h2>SEE ALSO</h2>
<a name="id2543971"></a><h2>SEE ALSO</h2>
<p><span class="citerefentry"><span class="refentrytitle">named</span>(8)</span>,
<span class="citerefentry"><span class="refentrytitle">lwres</span>(3)</span>,
<span class="citerefentry"><span class="refentrytitle">resolver</span>(5)</span>.
</p>
</div>
<div class="refsect1" lang="en">
<a name="id2544002"></a><h2>AUTHOR</h2>
<a name="id2544005"></a><h2>AUTHOR</h2>
<p><span class="corpauthor">Internet Systems Consortium</span>
</p>
</div>
+7 -7
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2004-2006, 2008 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2004-2006, 2008, 2009 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: main.c,v 1.136.18.21 2008/10/24 01:28:08 marka Exp $ */
/* $Id: main.c,v 1.136.18.24 2009/04/03 20:17:59 marka Exp $ */
/*! \file */
@@ -139,7 +139,7 @@ assertion_failed(const char *file, int line, isc_assertiontype_t type,
if (ns_g_lctx != NULL) {
/*
* Reset the assetion callback in case it is the log
* Reset the assertion callback in case it is the log
* routines causing the assertion.
*/
isc_assertion_setcallback(NULL);
@@ -719,7 +719,7 @@ setup(void) {
#ifdef DLZ
/*
* Registyer any DLZ drivers.
* Register any DLZ drivers.
*/
result = dlz_drivers_init();
if (result != ISC_R_SUCCESS)
@@ -851,10 +851,10 @@ main(int argc, char *argv[]) {
* strings named.core | grep "named version:"
*/
strlcat(version,
#ifdef __DATE__
"named version: BIND " VERSION " (" __DATE__ ")",
#else
#if defined(NO_VERSION_DATE) || !defined(__DATE__)
"named version: BIND " VERSION,
#else
"named version: BIND " VERSION " (" __DATE__ ")",
#endif
sizeof(version));
result = isc_file_progname(*argv, program_name, sizeof(program_name));
+2 -2
View File
@@ -1,7 +1,7 @@
.\" Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
.\" Copyright (C) 2000, 2001, 2003 Internet Software Consortium.
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" Permission to use, copy, modify, and/or distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
@@ -13,7 +13,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
.\" $Id: named.8,v 1.20.18.16 2008/09/01 02:29:00 tbox Exp $
.\" $Id: named.8,v 1.20.18.17 2009/07/11 01:31:44 tbox Exp $
.\"
.hy 0
.ad l
+2 -2
View File
@@ -1,6 +1,6 @@
.\" Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
.\"
.\" Permission to use, copy, modify, and distribute this software for any
.\" Permission to use, copy, modify, and/or distribute this software for any
.\" purpose with or without fee is hereby granted, provided that the above
.\" copyright notice and this permission notice appear in all copies.
.\"
@@ -12,7 +12,7 @@
.\" OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
.\" PERFORMANCE OF THIS SOFTWARE.
.\"
.\" $Id: named.conf.5,v 1.1.2.27 2008/09/05 01:32:08 tbox Exp $
.\" $Id: named.conf.5,v 1.1.2.28 2009/07/11 01:31:45 tbox Exp $
.\"
.hy 0
.ad l
+2 -2
View File
@@ -1,7 +1,7 @@
<!--
- Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
-
- Permission to use, copy, modify, and distribute this software for any
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
-
@@ -13,7 +13,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: named.conf.html,v 1.1.2.36 2008/09/05 01:32:08 tbox Exp $ -->
<!-- $Id: named.conf.html,v 1.1.2.37 2009/07/11 01:31:45 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+2 -2
View File
@@ -2,7 +2,7 @@
- Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
- Copyright (C) 2000, 2001, 2003 Internet Software Consortium.
-
- Permission to use, copy, modify, and distribute this software for any
- Permission to use, copy, modify, and/or distribute this software for any
- purpose with or without fee is hereby granted, provided that the above
- copyright notice and this permission notice appear in all copies.
-
@@ -14,7 +14,7 @@
- OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
- PERFORMANCE OF THIS SOFTWARE.
-->
<!-- $Id: named.html,v 1.6.18.22 2008/09/01 02:29:00 tbox Exp $ -->
<!-- $Id: named.html,v 1.6.18.23 2009/07/11 01:31:45 tbox Exp $ -->
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=ISO-8859-1">
+128 -77
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: query.c,v 1.257.18.46.2.1 2009/11/19 00:25:17 marka Exp $ */
/* $Id: query.c,v 1.257.18.56 2010/11/17 10:21:01 marka Exp $ */
/*! \file */
@@ -116,13 +116,16 @@ typedef struct client_additionalctx {
dns_rdataset_t *rdataset;
} client_additionalctx_t;
static void
static isc_result_t
query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype);
static isc_boolean_t
validate(ns_client_t *client, dns_db_t *db, dns_name_t *name,
dns_rdataset_t *rdataset, dns_rdataset_t *sigrdataset);
static inline void
log_queryerror(ns_client_t *client, isc_result_t result, int line, int level);
/*%
* Increment query statistics counters.
*/
@@ -165,8 +168,14 @@ query_send(ns_client_t *client) {
}
static void
query_error(ns_client_t *client, isc_result_t result) {
query_error(ns_client_t *client, isc_result_t result, int line) {
int loglevel = ISC_LOG_DEBUG(3);
if (result == DNS_R_SERVFAIL)
loglevel = ISC_LOG_DEBUG(1);
inc_stats(client, dns_statscounter_failure);
log_queryerror(client, result, line, loglevel);
ns_client_error(client, result);
}
@@ -942,7 +951,7 @@ query_getdb(ns_client_t *client, dns_name_t *name, dns_rdatatype_t qtype,
zonep, dbp, versionp);
#endif
/* If successfull, Transfer ownership of zone. */
/* If successful, Transfer ownership of zone. */
if (result == ISC_R_SUCCESS) {
#ifdef DLZ
*zonep = zone;
@@ -1120,7 +1129,8 @@ query_addadditional(void *arg, dns_name_t *name, dns_rdatatype_t qtype) {
goto cleanup;
}
result = dns_db_find(db, name, version, type,
client->query.dboptions | DNS_DBFIND_GLUEOK,
client->query.dboptions |
DNS_DBFIND_GLUEOK | DNS_DBFIND_ADDITIONALOK,
client->now, &node, fname, rdataset,
sigrdataset);
if (result == DNS_R_GLUE &&
@@ -1159,7 +1169,7 @@ query_addadditional(void *arg, dns_name_t *name, dns_rdatatype_t qtype) {
goto cleanup;
/*
* Don't poision caches using the bailiwick protection model.
* Don't poison caches using the bailiwick protection model.
*/
if (!dns_name_issubdomain(name, dns_db_origin(client->query.gluedb)))
goto cleanup;
@@ -1605,7 +1615,8 @@ query_addadditional2(void *arg, dns_name_t *name, dns_rdatatype_t qtype) {
goto try_glue;
result = dns_db_find(db, name, version, type,
client->query.dboptions | DNS_DBFIND_GLUEOK,
client->query.dboptions |
DNS_DBFIND_GLUEOK | DNS_DBFIND_ADDITIONALOK,
client->now, &node, fname, NULL, NULL);
if (result == ISC_R_SUCCESS)
goto found;
@@ -1633,7 +1644,7 @@ query_addadditional2(void *arg, dns_name_t *name, dns_rdatatype_t qtype) {
goto cleanup;
/*
* Don't poision caches using the bailiwick protection model.
* Don't poison caches using the bailiwick protection model.
*/
if (!dns_name_issubdomain(name, dns_db_origin(client->query.gluedb)))
goto cleanup;
@@ -2293,7 +2304,7 @@ mark_secure(ns_client_t *client, dns_db_t *db, dns_name_t *name,
/*
* Find the secure key that corresponds to rrsig.
* Note: 'keyrdataset' maintains state between sucessive calls,
* Note: 'keyrdataset' maintains state between successive calls,
* there may be multiple keys with the same keyid.
* Return ISC_FALSE if we have exhausted all the possible keys.
*/
@@ -2685,7 +2696,7 @@ query_addwildcardproof(ns_client_t *client, dns_db_t *db,
node = NULL;
/*
* Get the NOQNAME proof then if !ispositve
* Get the NOQNAME proof then if !ispositive
* get the NOWILDCARD proof.
*
* DNS_DBFIND_NOWILD finds the NSEC records that covers the
@@ -2864,8 +2875,12 @@ query_addnxrrsetnsec(ns_client_t *client, dns_db_t *db,
static void
query_resume(isc_task_t *task, isc_event_t *event) {
dns_fetchevent_t *devent = (dns_fetchevent_t *)event;
dns_fetch_t *fetch;
ns_client_t *client;
isc_boolean_t fetch_cancelled, client_shuttingdown;
isc_boolean_t fetch_canceled, client_shuttingdown;
isc_result_t result;
isc_logcategory_t *logcategory = NS_LOGCATEGORY_QUERY_EERRORS;
int errorloglevel;
/*
* Resume a query after recursion.
@@ -2886,30 +2901,31 @@ query_resume(isc_task_t *task, isc_event_t *event) {
*/
INSIST(devent->fetch == client->query.fetch);
client->query.fetch = NULL;
fetch_cancelled = ISC_FALSE;
fetch_canceled = ISC_FALSE;
/*
* Update client->now.
*/
isc_stdtime_get(&client->now);
} else {
/*
* This is a fetch completion event for a cancelled fetch.
* This is a fetch completion event for a canceled fetch.
* Clean up and don't resume the find.
*/
fetch_cancelled = ISC_TRUE;
fetch_canceled = ISC_TRUE;
}
UNLOCK(&client->query.fetchlock);
INSIST(client->query.fetch == NULL);
client->query.attributes &= ~NS_QUERYATTR_RECURSING;
dns_resolver_destroyfetch(&devent->fetch);
fetch = devent->fetch;
devent->fetch = NULL;
/*
* If this client is shutting down, or this transaction
* has timed out, do not resume the find.
*/
client_shuttingdown = ns_client_shuttingdown(client);
if (fetch_cancelled || client_shuttingdown) {
if (fetch_canceled || client_shuttingdown) {
if (devent->node != NULL)
dns_db_detachnode(devent->db, &devent->node);
if (devent->db != NULL)
@@ -2918,8 +2934,8 @@ query_resume(isc_task_t *task, isc_event_t *event) {
if (devent->sigrdataset != NULL)
query_putrdataset(client, &devent->sigrdataset);
isc_event_free(&event);
if (fetch_cancelled)
query_error(client, DNS_R_SERVFAIL);
if (fetch_canceled)
query_error(client, DNS_R_SERVFAIL, __LINE__);
else
query_next(client, ISC_R_CANCELED);
/*
@@ -2927,8 +2943,22 @@ query_resume(isc_task_t *task, isc_event_t *event) {
*/
ns_client_detach(&client);
} else {
query_find(client, devent, 0);
result = query_find(client, devent, 0);
if (result != ISC_R_SUCCESS) {
if (result == DNS_R_SERVFAIL)
errorloglevel = ISC_LOG_DEBUG(2);
else
errorloglevel = ISC_LOG_DEBUG(4);
if (isc_log_wouldlog(ns_g_lctx, errorloglevel)) {
dns_resolver_logfetch(fetch, ns_g_lctx,
logcategory,
NS_LOGMODULE_QUERY,
errorloglevel, ISC_FALSE);
}
}
}
dns_resolver_destroyfetch(&fetch);
}
static isc_result_t
@@ -3055,6 +3085,7 @@ query_recurse(ns_client_t *client, dns_rdatatype_t qtype, dns_name_t *qdomain,
do { \
eresult = r; \
want_restart = ISC_FALSE; \
line = __LINE__; \
} while (0)
/*
@@ -3294,8 +3325,7 @@ warn_rfc1918(ns_client_t *client, dns_name_t *fname, dns_rdataset_t *rdataset) {
RUNTIME_CHECK(result == ISC_R_SUCCESS);
dns_rdataset_current(&found, &rdata);
result = dns_rdata_tostruct(&rdata, &soa, NULL);
if (result != ISC_R_SUCCESS)
return;
RUNTIME_CHECK(result == ISC_R_SUCCESS);
if (dns_name_equal(&soa.origin, &prisoner) &&
dns_name_equal(&soa.contact, &hostmaster)) {
char buf[DNS_NAME_FORMATSIZE];
@@ -3317,7 +3347,7 @@ warn_rfc1918(ns_client_t *client, dns_name_t *fname, dns_rdataset_t *rdataset) {
* If 'event' is non-NULL, we are returning from recursion and 'qtype'
* is ignored. Otherwise, 'qtype' is the query type.
*/
static void
static isc_result_t
query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
{
dns_db_t *db, *zdb;
@@ -3346,8 +3376,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
isc_boolean_t empty_wild;
dns_rdataset_t *noqname;
isc_boolean_t resuming;
dns_rdataset_t tmprdataset;
unsigned int dboptions;
int line = -1;
CTRACE("query_find");
@@ -3559,49 +3588,9 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
/*
* Now look for an answer in the database.
*/
dboptions = client->query.dboptions;
if (sigrdataset == NULL && client->view->enablednssec) {
/*
* If the client doesn't want DNSSEC we still want to
* look for any data pending validation to save a remote
* lookup if possible.
*/
dns_rdataset_init(&tmprdataset);
sigrdataset = &tmprdataset;
dboptions |= DNS_DBFIND_PENDINGOK;
}
refind:
result = dns_db_find(db, client->query.qname, version, type,
dboptions, client->now, &node, fname,
rdataset, sigrdataset);
/*
* If we have found pending data try to validate it.
* If the data does not validate as secure and we can't
* use the unvalidated data requery the database with
* pending disabled to prevent infinite looping.
*/
if (result != ISC_R_SUCCESS || !DNS_TRUST_PENDING(rdataset->trust))
goto validation_done;
if (validate(client, db, fname, rdataset, sigrdataset))
goto validation_done;
if (rdataset->trust != dns_trust_pending_answer ||
!PENDINGOK(client->query.dboptions)) {
dns_rdataset_disassociate(rdataset);
if (sigrdataset != NULL &&
dns_rdataset_isassociated(sigrdataset))
dns_rdataset_disassociate(sigrdataset);
if (sigrdataset == &tmprdataset)
sigrdataset = NULL;
dns_db_detachnode(db, &node);
dboptions &= ~DNS_DBFIND_PENDINGOK;
goto refind;
}
validation_done:
if (sigrdataset == &tmprdataset) {
if (dns_rdataset_isassociated(sigrdataset))
dns_rdataset_disassociate(sigrdataset);
sigrdataset = NULL;
}
client->query.dboptions, client->now,
&node, fname, rdataset, sigrdataset);
resume:
CTRACE("query_find: resume");
@@ -4432,7 +4421,8 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
* or if the client requested recursion and thus wanted
* the complete answer, send an error response.
*/
query_error(client, eresult);
INSIST(line >= 0);
query_error(client, eresult, line);
}
ns_client_detach(&client);
} else if (!RECURSING(client)) {
@@ -4449,7 +4439,7 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
* is in the glue sort it to the start of the additional
* section.
*/
if (client->message->counts[DNS_SECTION_ANSWER] == 0 &&
if (ISC_LIST_EMPTY(client->message->sections[DNS_SECTION_ANSWER]) &&
client->message->rcode == dns_rcode_noerror &&
(qtype == dns_rdatatype_a || qtype == dns_rdatatype_aaaa))
answer_in_glue(client, qtype);
@@ -4458,10 +4448,22 @@ query_find(ns_client_t *client, dns_fetchevent_t *event, dns_rdatatype_t qtype)
client->view->auth_nxdomain == ISC_TRUE)
client->message->flags |= DNS_MESSAGEFLAG_AA;
/*
* If the response is somehow unexpected for the client and this
* is a result of recursion, return an error to the caller
* to indicate it may need to be logged.
*/
if (resuming &&
(ISC_LIST_EMPTY(client->message->sections[DNS_SECTION_ANSWER]) ||
client->message->rcode != dns_rcode_noerror))
eresult = ISC_R_FAILURE;
query_send(client);
ns_client_detach(&client);
}
CTRACE("query_find: done");
return (eresult);
}
static inline void
@@ -4488,6 +4490,48 @@ log_query(ns_client_t *client) {
(client->opt != NULL) ? "E" : "");
}
static inline void
log_queryerror(ns_client_t *client, isc_result_t result, int line, int level) {
char namebuf[DNS_NAME_FORMATSIZE];
char typename[DNS_RDATATYPE_FORMATSIZE];
char classname[DNS_RDATACLASS_FORMATSIZE];
const char *namep, *typep, *classp, *sep1, *sep2;
dns_rdataset_t *rdataset;
if (!isc_log_wouldlog(ns_g_lctx, level))
return;
namep = typep = classp = sep1 = sep2 = "";
/*
* Query errors can happen for various reasons. In some cases we cannot
* even assume the query contains a valid question section, so we should
* expect exceptional cases.
*/
if (client->query.origqname != NULL) {
dns_name_format(client->query.origqname, namebuf,
sizeof(namebuf));
namep = namebuf;
sep1 = " for ";
rdataset = ISC_LIST_HEAD(client->query.origqname->list);
if (rdataset != NULL) {
dns_rdataclass_format(rdataset->rdclass, classname,
sizeof(classname));
classp = classname;
dns_rdatatype_format(rdataset->type, typename,
sizeof(typename));
typep = typename;
sep2 = "/";
}
}
ns_client_log(client, NS_LOGCATEGORY_QUERY_EERRORS, NS_LOGMODULE_QUERY,
level, "query failed (%s)%s%s%s%s%s%s at %s:%d",
isc_result_totext(result), sep1, namep, sep2,
classp, sep2, typep, __FILE__, line);
}
void
ns_query_start(ns_client_t *client) {
isc_result_t result;
@@ -4548,7 +4592,7 @@ ns_query_start(ns_client_t *client) {
*/
result = dns_message_firstname(message, DNS_SECTION_QUESTION);
if (result != ISC_R_SUCCESS) {
query_error(client, result);
query_error(client, result, __LINE__);
return;
}
dns_message_currentname(message, DNS_SECTION_QUESTION,
@@ -4561,9 +4605,9 @@ ns_query_start(ns_client_t *client) {
* There's more than one QNAME in the question
* section.
*/
query_error(client, DNS_R_FORMERR);
query_error(client, DNS_R_FORMERR, __LINE__);
} else
query_error(client, result);
query_error(client, result, __LINE__);
return;
}
@@ -4574,7 +4618,7 @@ ns_query_start(ns_client_t *client) {
* Check for multiple question queries, since edns1 is dead.
*/
if (message->counts[DNS_SECTION_QUESTION] > 1) {
query_error(client, DNS_R_FORMERR);
query_error(client, DNS_R_FORMERR, __LINE__);
return;
}
@@ -4594,7 +4638,7 @@ ns_query_start(ns_client_t *client) {
return;
case dns_rdatatype_maila:
case dns_rdatatype_mailb:
query_error(client, DNS_R_NOTIMP);
query_error(client, DNS_R_NOTIMP, __LINE__);
return;
case dns_rdatatype_tkey:
result = dns_tkey_processquery(client->message,
@@ -4603,14 +4647,21 @@ ns_query_start(ns_client_t *client) {
if (result == ISC_R_SUCCESS)
query_send(client);
else
query_error(client, result);
query_error(client, result, __LINE__);
return;
default: /* TSIG, etc. */
query_error(client, DNS_R_FORMERR);
query_error(client, DNS_R_FORMERR, __LINE__);
return;
}
}
/*
* Turn on minimal response for DNSKEY and DS queries.
*/
if (qtype == dns_rdatatype_dnskey || qtype == dns_rdatatype_ds)
client->query.attributes |= (NS_QUERYATTR_NOAUTHORITY |
NS_QUERYATTR_NOADDITIONAL);
/*
* If the client has requested that DNSSEC checking be disabled,
* allow lookups to return pending data and instruct the resolver
@@ -4667,5 +4718,5 @@ ns_query_start(ns_client_t *client) {
qclient = NULL;
ns_client_attach(client, &qclient);
query_find(qclient, NULL, qtype);
(void)query_find(qclient, NULL, qtype);
}
+140 -56
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2004-2010 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: server.c,v 1.419.18.68 2008/09/04 23:46:08 tbox Exp $ */
/* $Id: server.c,v 1.419.18.77 2010/02/26 23:46:32 tbox Exp $ */
/*! \file */
@@ -209,7 +209,7 @@ static const struct {
/* Local IPv6 Unicast Addresses */
{ "0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA", ISC_FALSE },
{ "1.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0.IP6.ARPA", ISC_FALSE },
/* LOCALLY ASSIGNED LOCAL ADDRES S SCOPE */
/* LOCALLY ASSIGNED LOCAL ADDRESS SCOPE */
{ "D.F.IP6.ARPA", ISC_FALSE },
{ "8.E.F.IP6.ARPA", ISC_FALSE }, /* LINK LOCAL */
{ "9.E.F.IP6.ARPA", ISC_FALSE }, /* LINK LOCAL */
@@ -251,9 +251,8 @@ static void
end_reserved_dispatches(ns_server_t *server, isc_boolean_t all);
/*%
* Configure a single view ACL at '*aclp'. Get its configuration by
* calling 'getvcacl' (for per-view configuration) and maybe 'getscacl'
* (for a global default).
* Configure a single view ACL at '*aclp'. Get its configuration from
* 'vconfig' (for per-view configuration) and maybe from 'config'
*/
static isc_result_t
configure_view_acl(const cfg_obj_t *vconfig, const cfg_obj_t *config,
@@ -902,6 +901,23 @@ check_dbtype(dns_zone_t **zonep, unsigned int dbtypec, const char **dbargv,
}
static isc_boolean_t
cache_reusable(dns_view_t *originview, dns_view_t *view,
isc_boolean_t new_zero_no_soattl)
{
if (originview->checknames != view->checknames ||
dns_resolver_getzeronosoattl(originview->resolver) !=
new_zero_no_soattl ||
originview->acceptexpired != view->acceptexpired ||
originview->enablevalidation != view->enablevalidation ||
originview->maxcachettl != view->maxcachettl ||
originview->maxncachettl != view->maxncachettl) {
return (ISC_FALSE);
}
return (ISC_TRUE);
}
/*
* Configure 'view' according to 'vconfig', taking defaults from 'config'
* where values are missing in 'vconfig'.
@@ -956,6 +972,7 @@ configure_view(dns_view_t *view, const cfg_obj_t *config,
isc_boolean_t rfc1918;
isc_boolean_t empty_zones_enable;
const cfg_obj_t *disablelist = NULL;
isc_boolean_t zero_no_soattl;
REQUIRE(DNS_VIEW_VALID(view));
@@ -1095,6 +1112,55 @@ configure_view(dns_view_t *view, const cfg_obj_t *config,
}
#endif
/*
* Obtain configuration parameters that affect the decision of whether
* we can reuse/share an existing cache.
*/
/* Check-names. */
obj = NULL;
result = ns_checknames_get(maps, "response", &obj);
INSIST(result == ISC_R_SUCCESS);
str = cfg_obj_asstring(obj);
if (strcasecmp(str, "fail") == 0) {
check |= DNS_RESOLVER_CHECKNAMES |
DNS_RESOLVER_CHECKNAMESFAIL;
view->checknames = ISC_TRUE;
} else if (strcasecmp(str, "warn") == 0) {
check |= DNS_RESOLVER_CHECKNAMES;
view->checknames = ISC_FALSE;
} else if (strcasecmp(str, "ignore") == 0) {
view->checknames = ISC_FALSE;
} else
INSIST(0);
obj = NULL;
result = ns_config_get(maps, "zero-no-soa-ttl-cache", &obj);
INSIST(result == ISC_R_SUCCESS);
zero_no_soattl = cfg_obj_asboolean(obj);
obj = NULL;
result = ns_config_get(maps, "dnssec-accept-expired", &obj);
INSIST(result == ISC_R_SUCCESS);
view->acceptexpired = cfg_obj_asboolean(obj);
obj = NULL;
result = ns_config_get(maps, "dnssec-validation", &obj);
INSIST(result == ISC_R_SUCCESS);
view->enablevalidation = cfg_obj_asboolean(obj);
obj = NULL;
result = ns_config_get(maps, "max-cache-ttl", &obj);
INSIST(result == ISC_R_SUCCESS);
view->maxcachettl = cfg_obj_asuint32(obj);
obj = NULL;
result = ns_config_get(maps, "max-ncache-ttl", &obj);
INSIST(result == ISC_R_SUCCESS);
view->maxncachettl = cfg_obj_asuint32(obj);
if (view->maxncachettl > 7 * 24 * 3600)
view->maxncachettl = 7 * 24 * 3600;
/*
* Configure the view's cache. Try to reuse an existing
* cache if possible, otherwise create a new cache.
@@ -1114,14 +1180,23 @@ configure_view(dns_view_t *view, const cfg_obj_t *config,
if (result != ISC_R_NOTFOUND && result != ISC_R_SUCCESS)
goto cleanup;
if (pview != NULL) {
INSIST(pview->cache != NULL);
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
NS_LOGMODULE_SERVER, ISC_LOG_DEBUG(3),
"reusing existing cache");
reused_cache = ISC_TRUE;
dns_cache_attach(pview->cache, &cache);
if (cache_reusable(pview, view, zero_no_soattl)) {
INSIST(pview->cache != NULL);
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
NS_LOGMODULE_SERVER, ISC_LOG_DEBUG(3),
"reusing existing cache");
reused_cache = ISC_TRUE;
dns_cache_attach(pview->cache, &cache);
} else {
isc_log_write(ns_g_lctx, NS_LOGCATEGORY_GENERAL,
NS_LOGMODULE_SERVER, ISC_LOG_DEBUG(1),
"cache cannot be reused for view %s "
"due to configuration parameter mismatch",
view->name);
}
dns_view_detach(&pview);
} else {
}
if (cache == NULL) {
CHECK(isc_mem_create(0, 0, &cmctx));
CHECK(dns_cache_create(cmctx, ns_g_taskmgr, ns_g_timermgr,
view->rdclass, "rbt", 0, NULL, &cache));
@@ -1235,11 +1310,6 @@ configure_view(dns_view_t *view, const cfg_obj_t *config,
lame_ttl = 1800;
dns_resolver_setlamettl(view->resolver, lame_ttl);
obj = NULL;
result = ns_config_get(maps, "zero-no-soa-ttl-cache", &obj);
INSIST(result == ISC_R_SUCCESS);
dns_resolver_setzeronosoattl(view->resolver, cfg_obj_asboolean(obj));
/*
* Set the resolver's EDNS UDP size.
*/
@@ -1491,10 +1561,11 @@ configure_view(dns_view_t *view, const cfg_obj_t *config,
*/
if (view->queryacl == NULL && view->recursionacl != NULL)
dns_acl_attach(view->recursionacl, &view->queryacl);
if (view->queryacl == NULL)
if (view->queryacl == NULL && view->recursion)
CHECK(configure_view_acl(vconfig, config, "allow-query",
actx, ns_g_mctx, &view->queryacl));
if (view->recursionacl == NULL && view->queryacl != NULL)
if (view->recursion &&
view->recursionacl == NULL && view->queryacl != NULL)
dns_acl_attach(view->queryacl, &view->recursionacl);
/*
@@ -1503,10 +1574,18 @@ configure_view(dns_view_t *view, const cfg_obj_t *config,
if (view->recursionacl == NULL && view->recursion)
CHECK(configure_view_acl(NULL, ns_g_config, "allow-recursion",
actx, ns_g_mctx, &view->recursionacl));
if (view->queryacl == NULL)
CHECK(configure_view_acl(NULL, ns_g_config,
"allow-query-cache", actx,
ns_g_mctx, &view->queryacl));
if (view->queryacl == NULL) {
if (view->recursion)
CHECK(configure_view_acl(NULL, ns_g_config,
"allow-query-cache", actx,
ns_g_mctx, &view->queryacl));
else {
if (view->queryacl != NULL)
dns_acl_detach(&view->queryacl);
CHECK(dns_acl_none(ns_g_mctx, &view->queryacl));
}
}
CHECK(configure_view_acl(vconfig, config, "sortlist",
actx, ns_g_mctx, &view->sortlist));
@@ -1538,16 +1617,6 @@ configure_view(dns_view_t *view, const cfg_obj_t *config,
INSIST(result == ISC_R_SUCCESS);
view->enablednssec = cfg_obj_asboolean(obj);
obj = NULL;
result = ns_config_get(maps, "dnssec-accept-expired", &obj);
INSIST(result == ISC_R_SUCCESS);
view->acceptexpired = cfg_obj_asboolean(obj);
obj = NULL;
result = ns_config_get(maps, "dnssec-validation", &obj);
INSIST(result == ISC_R_SUCCESS);
view->enablevalidation = cfg_obj_asboolean(obj);
obj = NULL;
result = ns_config_get(maps, "dnssec-lookaside", &obj);
if (result == ISC_R_SUCCESS) {
@@ -1602,18 +1671,6 @@ configure_view(dns_view_t *view, const cfg_obj_t *config,
if (result == ISC_R_SUCCESS)
CHECK(mustbesecure(obj, view->resolver));
obj = NULL;
result = ns_config_get(maps, "max-cache-ttl", &obj);
INSIST(result == ISC_R_SUCCESS);
view->maxcachettl = cfg_obj_asuint32(obj);
obj = NULL;
result = ns_config_get(maps, "max-ncache-ttl", &obj);
INSIST(result == ISC_R_SUCCESS);
view->maxncachettl = cfg_obj_asuint32(obj);
if (view->maxncachettl > 7 * 24 * 3600)
view->maxncachettl = 7 * 24 * 3600;
obj = NULL;
result = ns_config_get(maps, "preferred-glue", &obj);
if (result == ISC_R_SUCCESS) {
@@ -1959,6 +2016,8 @@ configure_forward(const cfg_obj_t *config, dns_view_t *view, dns_name_t *origin,
isc_result_t result;
in_port_t port;
ISC_LIST_INIT(addresses);
/*
* Determine which port to send forwarded requests to.
*/
@@ -1984,8 +2043,6 @@ configure_forward(const cfg_obj_t *config, dns_view_t *view, dns_name_t *origin,
if (forwarders != NULL)
faddresses = cfg_tuple_get(forwarders, "addresses");
ISC_LIST_INIT(addresses);
for (element = cfg_list_first(faddresses);
element != NULL;
element = cfg_list_next(element))
@@ -4506,6 +4563,8 @@ dumpdone(void *arg, isc_result_t result) {
}
if (dctx->cache != NULL) {
dns_adb_dump(dctx->view->view->adb, dctx->fp);
dns_resolver_printbadcache(dctx->view->view->resolver,
dctx->fp);
dns_db_detach(&dctx->cache);
}
if (dctx->dumpzones) {
@@ -4884,7 +4943,9 @@ ns_server_status(ns_server_t *server, isc_buffer_t *text) {
* Act on a "freeze" or "thaw" command from the command channel.
*/
isc_result_t
ns_server_freeze(ns_server_t *server, isc_boolean_t freeze, char *args) {
ns_server_freeze(ns_server_t *server, isc_boolean_t freeze, char *args,
isc_buffer_t *text)
{
isc_result_t result, tresult;
dns_zone_t *zone = NULL;
dns_zonetype_t type;
@@ -4894,6 +4955,7 @@ ns_server_freeze(ns_server_t *server, isc_boolean_t freeze, char *args) {
char *journal;
const char *vname, *sep;
isc_boolean_t frozen;
const char *msg = NULL;
result = zone_from_args(server, args, &zone);
if (result != ISC_R_SUCCESS)
@@ -4926,25 +4988,47 @@ ns_server_freeze(ns_server_t *server, isc_boolean_t freeze, char *args) {
frozen = dns_zone_getupdatedisabled(zone);
if (freeze) {
if (frozen)
if (frozen) {
msg = "WARNING: The zone was already frozen.\n"
"Someone else may be editing it or "
"it may still be re-loading.";
result = DNS_R_FROZEN;
if (result == ISC_R_SUCCESS)
}
if (result == ISC_R_SUCCESS) {
result = dns_zone_flush(zone);
if (result != ISC_R_SUCCESS)
msg = "Flushing the zone updates to "
"disk failed.";
}
if (result == ISC_R_SUCCESS) {
journal = dns_zone_getjournal(zone);
if (journal != NULL)
(void)isc_file_remove(journal);
}
if (result == ISC_R_SUCCESS)
dns_zone_setupdatedisabled(zone, freeze);
} else {
if (frozen) {
result = dns_zone_load(zone);
if (result == DNS_R_CONTINUE ||
result == DNS_R_UPTODATE)
result = dns_zone_loadandthaw(zone);
switch (result) {
case ISC_R_SUCCESS:
case DNS_R_UPTODATE:
msg = "The zone reload and thaw was "
"successful.";
result = ISC_R_SUCCESS;
break;
case DNS_R_CONTINUE:
msg = "A zone reload and thaw was started.\n"
"Check the logs to see the result.";
result = ISC_R_SUCCESS;
break;
}
}
}
if (result == ISC_R_SUCCESS)
dns_zone_setupdatedisabled(zone, freeze);
if (msg != NULL && strlen(msg) < isc_buffer_availablelength(text))
isc_buffer_putmem(text, (const unsigned char *)msg,
strlen(msg) + 1);
view = dns_zone_getview(zone);
if (strcmp(view->name, "_bind") == 0 ||
+16 -6
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2004-2006, 2008 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2004-2006, 2008, 2009 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2002 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: os.c,v 1.66.18.17 2008/10/24 01:43:17 tbox Exp $ */
/* $Id: os.c,v 1.66.18.21 2009/03/02 03:06:25 marka Exp $ */
/*! \file */
@@ -405,10 +405,12 @@ ns_os_started(void) {
char buf = 0;
/*
* Signal to the parent that we stated successfully.
* Signal to the parent that we started successfully.
*/
if (dfd[0] != -1 && dfd[1] != -1) {
write(dfd[1], &buf, 1);
if (write(dfd[1], &buf, 1) != 1)
ns_main_earlyfatal("unable to signal parent that we "
"otherwise started successfully.");
close(dfd[1]);
dfd[0] = dfd[1] = -1;
}
@@ -448,10 +450,14 @@ ns_os_chroot(const char *root) {
ns_smf_chroot = 0;
#endif
if (root != NULL) {
#ifdef HAVE_CHROOT
if (chroot(root) < 0) {
isc__strerror(errno, strbuf, sizeof(strbuf));
ns_main_earlyfatal("chroot(): %s", strbuf);
}
#else
ns_main_earlyfatal("chroot(): disabled");
#endif
if (chdir("/") < 0) {
isc__strerror(errno, strbuf, sizeof(strbuf));
ns_main_earlyfatal("chdir(/): %s", strbuf);
@@ -584,7 +590,8 @@ safe_open(const char *filename, isc_boolean_t append) {
fd = open(filename, O_WRONLY|O_CREAT|O_APPEND,
S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
else {
(void)unlink(filename);
if (unlink(filename) < 0 && errno != ENOENT)
return (-1);
fd = open(filename, O_WRONLY|O_CREAT|O_EXCL,
S_IRUSR|S_IWUSR|S_IRGRP|S_IROTH);
}
@@ -593,8 +600,11 @@ safe_open(const char *filename, isc_boolean_t append) {
static void
cleanup_pidfile(void) {
int n;
if (pidfile != NULL) {
(void)unlink(pidfile);
n = unlink(pidfile);
if (n == -1 && errno != ENOENT)
ns_main_earlywarning("unlink '%s': failed", pidfile);
free(pidfile);
}
pidfile = NULL;
+201 -41
View File
@@ -1,5 +1,5 @@
/*
* Copyright (C) 2004-2008 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2004-2009 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and/or distribute this software for any
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: update.c,v 1.109.18.27.4.1 2009/07/28 13:57:27 marka Exp $ */
/* $Id: update.c,v 1.109.18.33 2009/07/28 15:57:26 marka Exp $ */
#include <config.h>
@@ -619,6 +619,45 @@ rrset_exists(dns_db_t *db, dns_dbversion_t *ver,
RETURN_EXISTENCE_FLAG;
}
/*%
* Set '*visible' to true if the RRset exists and is part of the
* visible zone. Otherwise '*visible' is set to false unless a
* error occurs.
*/
static isc_result_t
rrset_visible(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *name,
dns_rdatatype_t type, isc_boolean_t *visible)
{
isc_result_t result;
dns_fixedname_t fixed;
dns_fixedname_init(&fixed);
result = dns_db_find(db, name, ver, type, DNS_DBFIND_NOWILD,
(isc_stdtime_t) 0, NULL,
dns_fixedname_name(&fixed), NULL, NULL);
switch (result) {
case ISC_R_SUCCESS:
*visible = ISC_TRUE;
break;
/*
* Glue, obscured, deleted or replaced records.
*/
case DNS_R_DELEGATION:
case DNS_R_DNAME:
case DNS_R_CNAME:
case DNS_R_NXDOMAIN:
case DNS_R_NXRRSET:
case DNS_R_EMPTYNAME:
case DNS_R_COVERINGNSEC:
*visible = ISC_FALSE;
result = ISC_R_SUCCESS;
break;
default:
break;
}
return (result);
}
/*%
* Helper function for cname_incompatible_rrset_exists.
*/
@@ -738,8 +777,8 @@ ssu_checkall(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *name,
* In the RFC2136 section 3.2.5, this is the pseudocode involving
* a variable called "temp", a mapping of <name, type> tuples to rrsets.
*
* Here, we represent the "temp" data structure as (non-minimial) "dns_diff_t"
* where each typle has op==DNS_DIFFOP_EXISTS.
* Here, we represent the "temp" data structure as (non-minimal) "dns_diff_t"
* where each tuple has op==DNS_DIFFOP_EXISTS.
*/
@@ -1011,6 +1050,16 @@ true_p(dns_rdata_t *update_rr, dns_rdata_t *db_rr) {
return (ISC_TRUE);
}
/*%
* Return true if the record is a RRSIG.
*/
static isc_boolean_t
rrsig_p(dns_rdata_t *update_rr, dns_rdata_t *db_rr) {
UNUSED(update_rr);
return ((db_rr->type == dns_rdatatype_rrsig) ?
ISC_TRUE : ISC_FALSE);
}
/*%
* Return true iff the two RRs have identical rdata.
*/
@@ -1429,10 +1478,9 @@ uniqify_name_list(dns_diff_t *list) {
return (result);
}
static isc_result_t
is_glue(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *name,
isc_boolean_t *flag)
is_active(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *name,
isc_boolean_t *flag, isc_boolean_t *cut, isc_boolean_t *unsecure)
{
isc_result_t result;
dns_fixedname_t foundname;
@@ -1442,8 +1490,11 @@ is_glue(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *name,
(isc_stdtime_t) 0, NULL,
dns_fixedname_name(&foundname),
NULL, NULL);
if (result == ISC_R_SUCCESS) {
if (result == ISC_R_SUCCESS || result == DNS_R_EMPTYNAME) {
*flag = ISC_FALSE;
*cut = ISC_FALSE;
if (unsecure != NULL)
*unsecure = ISC_FALSE;
return (ISC_R_SUCCESS);
} else if (result == DNS_R_ZONECUT) {
/*
@@ -1451,11 +1502,36 @@ is_glue(dns_db_t *db, dns_dbversion_t *ver, dns_name_t *name,
* non-delegation will be omitted from the type bit map.
*/
*flag = ISC_FALSE;
*cut = ISC_TRUE;
if (unsecure != NULL) {
/*
* We are at the zonecut. Check to see if there
* is a DS RRset.
*/
if (dns_db_find(db, name, ver, dns_rdatatype_ds, 0,
(isc_stdtime_t) 0, NULL,
dns_fixedname_name(&foundname),
NULL, NULL) == DNS_R_NXRRSET)
*unsecure = ISC_TRUE;
else
*unsecure = ISC_FALSE;
}
return (ISC_R_SUCCESS);
} else if (result == DNS_R_GLUE || result == DNS_R_DNAME) {
*flag = ISC_TRUE;
} else if (result == DNS_R_GLUE || result == DNS_R_DNAME ||
result == DNS_R_DELEGATION || result == DNS_R_NXDOMAIN) {
*flag = ISC_FALSE;
*cut = ISC_FALSE;
if (unsecure != NULL)
*unsecure = ISC_FALSE;
return (ISC_R_SUCCESS);
} else {
/*
* Silence compiler.
*/
*flag = ISC_FALSE;
*cut = ISC_FALSE;
if (unsecure != NULL)
*unsecure = ISC_FALSE;
return (result);
}
}
@@ -1659,7 +1735,7 @@ static isc_result_t
add_sigs(ns_client_t *client, dns_zone_t *zone, dns_db_t *db,
dns_dbversion_t *ver, dns_name_t *name, dns_rdatatype_t type,
dns_diff_t *diff, dst_key_t **keys, unsigned int nkeys,
isc_mem_t *mctx, isc_stdtime_t inception, isc_stdtime_t expire,
isc_stdtime_t inception, isc_stdtime_t expire,
isc_boolean_t check_ksk)
{
isc_result_t result;
@@ -1670,6 +1746,7 @@ add_sigs(ns_client_t *client, dns_zone_t *zone, dns_db_t *db,
unsigned char data[1024]; /* XXX */
unsigned int i;
isc_boolean_t added_sig = ISC_FALSE;
isc_mem_t *mctx = client->mctx;
dns_rdataset_init(&rdataset);
isc_buffer_init(&buffer, data, sizeof(data));
@@ -1717,9 +1794,76 @@ add_sigs(ns_client_t *client, dns_zone_t *zone, dns_db_t *db,
return (result);
}
static isc_result_t
add_exposed_sigs(ns_client_t *client, dns_zone_t *zone, dns_db_t *db,
dns_dbversion_t *ver, dns_name_t *name, isc_boolean_t cut,
dns_diff_t *diff, dst_key_t **keys, unsigned int nkeys,
isc_stdtime_t inception, isc_stdtime_t expire,
isc_boolean_t check_ksk)
{
isc_result_t result;
dns_dbnode_t *node;
dns_rdatasetiter_t *iter;
node = NULL;
result = dns_db_findnode(db, name, ISC_FALSE, &node);
if (result == ISC_R_NOTFOUND)
return (ISC_R_SUCCESS);
if (result != ISC_R_SUCCESS)
return (result);
iter = NULL;
result = dns_db_allrdatasets(db, node, ver,
(isc_stdtime_t) 0, &iter);
if (result != ISC_R_SUCCESS)
goto cleanup_node;
for (result = dns_rdatasetiter_first(iter);
result == ISC_R_SUCCESS;
result = dns_rdatasetiter_next(iter))
{
dns_rdataset_t rdataset;
dns_rdatatype_t type;
isc_boolean_t flag;
dns_rdataset_init(&rdataset);
dns_rdatasetiter_current(iter, &rdataset);
type = rdataset.type;
dns_rdataset_disassociate(&rdataset);
/*
* We don't need to sign unsigned NSEC records at the cut
* as they are handled elsewhere.
*/
if ((type == dns_rdatatype_rrsig) ||
(cut && type != dns_rdatatype_ds))
continue;
result = rrset_exists(db, ver, name, dns_rdatatype_rrsig,
type, &flag);
if (result != ISC_R_SUCCESS)
goto cleanup_iterator;
if (flag)
continue;;
result = add_sigs(client, zone, db, ver, name, type, diff,
keys, nkeys, inception, expire, check_ksk);
if (result != ISC_R_SUCCESS)
goto cleanup_iterator;
}
if (result == ISC_R_NOMORE)
result = ISC_R_SUCCESS;
cleanup_iterator:
dns_rdatasetiter_destroy(&iter);
cleanup_node:
dns_db_detachnode(db, &node);
return (result);
}
/*%
* Update RRSIG and NSEC records affected by an update. The original
* update, including the SOA serial update but exluding the RRSIG & NSEC
* update, including the SOA serial update but excluding the RRSIG & NSEC
* changes, is in "diff" and has already been applied to "newver" of "db".
* The database version prior to the update is "oldver".
*
@@ -1751,6 +1895,7 @@ update_signatures(ns_client_t *client, dns_zone_t *zone, dns_db_t *db,
dns_rdataset_t rdataset;
dns_dbnode_t *node = NULL;
isc_boolean_t check_ksk;
isc_boolean_t cut;
dns_diff_init(client->mctx, &diffnames);
dns_diff_init(client->mctx, &affected);
@@ -1774,7 +1919,7 @@ update_signatures(ns_client_t *client, dns_zone_t *zone, dns_db_t *db,
/*
* Do we look at the KSK flag on the DNSKEY to determining which
* keys sign which RRsets? First check the zone option then
* check the keys flags to make sure atleast one has a ksk set
* check the keys flags to make sure at least one has a ksk set
* and one doesn't.
*/
check_ksk = ISC_TF((dns_zone_getoptions(zone) &
@@ -1833,15 +1978,15 @@ update_signatures(ns_client_t *client, dns_zone_t *zone, dns_db_t *db,
NULL, &sig_diff));
/*
* If this RRset still exists after the update,
* If this RRset is still visible after the update,
* add a new signature for it.
*/
CHECK(rrset_exists(db, newver, name, type, 0, &flag));
CHECK(rrset_visible(db, newver, name, type, &flag));
if (flag) {
CHECK(add_sigs(client, zone, db, newver, name,
type, &sig_diff, zone_keys,
nkeys, client->mctx, inception,
expire, check_ksk));
nkeys, inception, expire,
check_ksk));
}
skip:
/* Skip any other updates to the same RRset. */
@@ -1948,27 +2093,34 @@ update_signatures(ns_client_t *client, dns_zone_t *zone, dns_db_t *db,
t = ISC_LIST_NEXT(t, link))
{
isc_boolean_t exists;
CHECK(name_exists(db, newver, &t->name, &exists));
dns_name_t *name = &t->name;
CHECK(name_exists(db, newver, name, &exists));
if (! exists)
continue;
CHECK(is_glue(db, newver, &t->name, &flag));
if (flag) {
CHECK(is_active(db, newver, name, &flag, &cut, NULL));
if (!flag) {
/*
* This name is obscured. Delete any
* existing NSEC record.
*/
CHECK(delete_if(true_p, db, newver, &t->name,
CHECK(delete_if(true_p, db, newver, name,
dns_rdatatype_nsec, 0,
NULL, &nsec_diff));
CHECK(delete_if(rrsig_p, db, newver, name,
dns_rdatatype_any, 0, NULL, diff));
} else {
/*
* This name is not obscured. It should have a NSEC.
*/
CHECK(rrset_exists(db, newver, &t->name,
CHECK(rrset_exists(db, newver, name,
dns_rdatatype_nsec, 0, &flag));
if (! flag)
CHECK(add_placeholder_nsec(db, newver, &t->name,
diff));
CHECK(add_exposed_sigs(client, zone, db, newver, name,
cut, diff, zone_keys, nkeys,
inception, expire, check_ksk));
}
}
@@ -2026,8 +2178,8 @@ update_signatures(ns_client_t *client, dns_zone_t *zone, dns_db_t *db,
} else if (t->op == DNS_DIFFOP_ADD) {
CHECK(add_sigs(client, zone, db, newver, &t->name,
dns_rdatatype_nsec, &sig_diff,
zone_keys, nkeys, client->mctx,
inception, expire, check_ksk));
zone_keys, nkeys, inception, expire,
check_ksk));
} else {
INSIST(0);
}
@@ -2201,29 +2353,37 @@ ns_update_start(ns_client_t *client, isc_result_t sigresult) {
static isc_result_t
remove_orphaned_ds(dns_db_t *db, dns_dbversion_t *newver, dns_diff_t *diff) {
isc_result_t result;
isc_boolean_t ns_exists, ds_exists;
dns_difftuple_t *t;
isc_boolean_t ns_exists;
dns_difftuple_t *tupple;
dns_diff_t temp_diff;
for (t = ISC_LIST_HEAD(diff->tuples);
t != NULL;
t = ISC_LIST_NEXT(t, link)) {
if (t->op != DNS_DIFFOP_ADD ||
t->rdata.type != dns_rdatatype_ns)
dns_diff_init(diff->mctx, &temp_diff);
for (tupple = ISC_LIST_HEAD(diff->tuples);
tupple != NULL;
tupple = ISC_LIST_NEXT(tupple, link)) {
if (!((tupple->op == DNS_DIFFOP_DEL &&
tupple->rdata.type == dns_rdatatype_ns) ||
(tupple->op == DNS_DIFFOP_ADD &&
tupple->rdata.type == dns_rdatatype_ds)))
continue;
CHECK(rrset_exists(db, newver, &t->name, dns_rdatatype_ns, 0,
&ns_exists));
if (ns_exists)
CHECK(rrset_exists(db, newver, &tupple->name,
dns_rdatatype_ns, 0, &ns_exists));
if (ns_exists &&
!dns_name_equal(&tupple->name, dns_db_origin(db)))
continue;
CHECK(rrset_exists(db, newver, &t->name, dns_rdatatype_ds, 0,
&ds_exists));
if (!ds_exists)
continue;
CHECK(delete_if(true_p, db, newver, &t->name,
dns_rdatatype_ds, 0, NULL, diff));
CHECK(delete_if(true_p, db, newver, &tupple->name,
dns_rdatatype_ds, 0, NULL, &temp_diff));
}
return (ISC_R_SUCCESS);
result = ISC_R_SUCCESS;
failure:
for (tupple = ISC_LIST_HEAD(temp_diff.tuples);
tupple != NULL;
tupple = ISC_LIST_HEAD(temp_diff.tuples)) {
ISC_LIST_UNLINK(temp_diff.tuples, tupple, link);
dns_diff_appendminimal(diff, &tupple);
}
return (result);
}
+44 -34
View File
@@ -1,8 +1,8 @@
/*
* Copyright (C) 2004-2006 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 2004-2006, 2008, 2009 Internet Systems Consortium, Inc. ("ISC")
* Copyright (C) 1999-2003 Internet Software Consortium.
*
* Permission to use, copy, modify, and distribute this software for any
* Permission to use, copy, modify, and/or distribute this software for any
* purpose with or without fee is hereby granted, provided that the above
* copyright notice and this permission notice appear in all copies.
*
@@ -15,7 +15,7 @@
* PERFORMANCE OF THIS SOFTWARE.
*/
/* $Id: xfrout.c,v 1.115.18.8 2006/03/05 23:58:51 marka Exp $ */
/* $Id: xfrout.c,v 1.115.18.13 2009/01/19 00:36:26 marka Exp $ */
#include <config.h>
@@ -51,7 +51,7 @@
#include <named/server.h>
#include <named/xfrout.h>
/*! \file
/*! \file
* \brief
* Outgoing AXFR and IXFR.
*/
@@ -86,7 +86,7 @@
ns_client_log(client, DNS_LOGCATEGORY_XFER_OUT, \
NS_LOGMODULE_XFER_OUT, ISC_LOG_INFO, \
"bad zone transfer request: %s (%s)", \
msg, isc_result_totext(code)); \
msg, isc_result_totext(code)); \
if (result != ISC_R_SUCCESS) goto failure; \
} while (0)
@@ -100,12 +100,12 @@
ns_client_log(client, DNS_LOGCATEGORY_XFER_OUT, \
NS_LOGMODULE_XFER_OUT, ISC_LOG_INFO, \
"bad zone transfer request: '%s/%s': %s (%s)", \
_buf1, _buf2, msg, isc_result_totext(code)); \
_buf1, _buf2, msg, isc_result_totext(code)); \
if (result != ISC_R_SUCCESS) goto failure; \
} while (0)
#define CHECK(op) \
do { result = (op); \
do { result = (op); \
if (result != ISC_R_SUCCESS) goto failure; \
} while (0)
@@ -121,12 +121,12 @@ typedef struct db_rr_iterator db_rr_iterator_t;
struct db_rr_iterator {
isc_result_t result;
dns_db_t *db;
dns_dbiterator_t *dbit;
dns_dbiterator_t *dbit;
dns_dbversion_t *ver;
isc_stdtime_t now;
dns_dbnode_t *node;
dns_fixedname_t fixedname;
dns_rdatasetiter_t *rdatasetit;
dns_rdatasetiter_t *rdatasetit;
dns_rdataset_t rdataset;
dns_rdata_t rdata;
};
@@ -303,6 +303,11 @@ log_rr(dns_name_t *name, dns_rdata_t *rdata, isc_uint32_t ttl) {
rdl.type = rdata->type;
rdl.rdclass = rdata->rdclass;
rdl.ttl = ttl;
if (rdata->type == dns_rdatatype_sig ||
rdata->type == dns_rdatatype_rrsig)
rdl.covers = dns_rdata_covers(rdata);
else
rdl.covers = dns_rdatatype_none;
ISC_LIST_INIT(rdl.rdata);
ISC_LINK_INIT(&rdl, link);
dns_rdataset_init(&rds);
@@ -326,7 +331,7 @@ log_rr(dns_name_t *name, dns_rdata_t *rdata, isc_uint32_t ttl) {
INSIST(buf.used >= 1 &&
((char *) buf.base)[buf.used - 1] == '\n');
buf.used--;
isc_log_write(XFROUT_RR_LOGARGS, "%.*s",
(int)isc_buffer_usedlength(&buf),
(char *)isc_buffer_base(&buf));
@@ -969,7 +974,7 @@ ns_xfr_start(ns_client_t *client, dns_rdatatype_t reqtype) {
/*
* Normal zone table does not have a match. Try the DLZ database
*/
if (client->view->dlzdatabase != NULL) {
if (client->view->dlzdatabase != NULL) {
result = dns_dlzallowzonexfr(client->view,
question_name, &client->peeraddr,
&db);
@@ -1006,7 +1011,7 @@ ns_xfr_start(ns_client_t *client, dns_rdatatype_t reqtype) {
} else {
/*
* not DLZ and not in normal zone table, we are
* not DLZ and not in normal zone table, we are
* not authoritative
*/
FAILQ(DNS_R_NOTAUTH, "non-authoritative zone",
@@ -1191,7 +1196,7 @@ ns_xfr_start(ns_client_t *client, dns_rdatatype_t reqtype) {
}
/*
* Bracket the the data stream with SOAs.
* Bracket the data stream with SOAs.
*/
CHECK(soa_rrstream_create(mctx, db, ver, &soa_stream));
CHECK(compound_rrstream_create(mctx, &soa_stream, &data_stream,
@@ -1210,26 +1215,26 @@ ns_xfr_start(ns_client_t *client, dns_rdatatype_t reqtype) {
#ifdef DLZ
if (is_dlz)
CHECK(xfrout_ctx_create(mctx, client, request->id, question_name,
reqtype, question_class, db, ver, quota,
stream, dns_message_gettsigkey(request),
tsigbuf,
3600,
3600,
(format == dns_many_answers) ?
ISC_TRUE : ISC_FALSE,
&xfr));
else
CHECK(xfrout_ctx_create(mctx, client, request->id, question_name,
reqtype, question_class, db, ver, quota,
stream, dns_message_gettsigkey(request),
tsigbuf,
3600,
3600,
(format == dns_many_answers) ?
ISC_TRUE : ISC_FALSE,
&xfr));
else
#endif
CHECK(xfrout_ctx_create(mctx, client, request->id, question_name,
reqtype, question_class, db, ver, quota,
stream, dns_message_gettsigkey(request),
tsigbuf,
dns_zone_getmaxxfrout(zone),
dns_zone_getidleout(zone),
(format == dns_many_answers) ?
ISC_TRUE : ISC_FALSE,
&xfr));
CHECK(xfrout_ctx_create(mctx, client, request->id, question_name,
reqtype, question_class, db, ver, quota,
stream, dns_message_gettsigkey(request),
tsigbuf,
dns_zone_getmaxxfrout(zone),
dns_zone_getidleout(zone),
(format == dns_many_answers) ?
ISC_TRUE : ISC_FALSE,
&xfr));
xfr->mnemonic = mnemonic;
stream = NULL;
@@ -1399,7 +1404,7 @@ failure:
*
* Requires:
* The stream iterator is initialized and points at an RR,
* or possiby at the end of the stream (that is, the
* or possibly at the end of the stream (that is, the
* _first method of the iterator has been called).
*/
static void
@@ -1573,6 +1578,11 @@ sendstream(xfrout_ctx_t *xfr) {
msgrdl->type = rdata->type;
msgrdl->rdclass = rdata->rdclass;
msgrdl->ttl = ttl;
if (rdata->type == dns_rdatatype_sig ||
rdata->type == dns_rdatatype_rrsig)
msgrdl->covers = dns_rdata_covers(rdata);
else
msgrdl->covers = dns_rdatatype_none;
ISC_LINK_INIT(msgrdl, link);
ISC_LIST_INIT(msgrdl->rdata);
ISC_LIST_APPEND(msgrdl->rdata, msgrdata, link);
@@ -1663,7 +1673,7 @@ sendstream(xfrout_ctx_t *xfr) {
* iterators before returning from the event handler.
*/
xfr->stream->methods->pause(xfr->stream);
if (result == ISC_R_SUCCESS)
return;
Loaded 100 of 3321 files, more files were not shown because too many files have changed in this diff. Show more