Commit Graph

212156 Commits

Author SHA1 Message Date
Don Lewis
0ee6da55a6 Since rdata is only used as an argument to the immediately following
call to res_nopt_rdata(), revert r299879 and fix CID 603941 by moving
	rdata = &buf[n];
inside the if block.

Reported by:	Coverity
CID:		603941
2016-05-16 01:38:24 +00:00
Don Lewis
0abffcb5f8 Likely a false positive ... but make sure that -1 can't be used as an
array index by splitting up a test.

Reported by:	Coverity
CID:		603941
MFC after:	1 week
2016-05-16 01:30:32 +00:00
Marcelo Araujo
1dcace5ba0 Use NULL instead of 0 for pointers.
MFC after:	2 weeks.
2016-05-16 01:12:56 +00:00
Marcelo Araujo
26d0a72296 Use NULL instead of 0 for pointers.
MFC after:	2 weeks
2016-05-16 01:11:02 +00:00
Marcelo Araujo
f8358c11a5 For pointers use NULL instead of 0.
MFC after:	2 weeks.
2016-05-16 00:36:12 +00:00
Marcelo Araujo
798a749aae For pointers use NULL instead of 0.
MFC after:	2 weeks.
2016-05-16 00:35:39 +00:00
Marcelo Araujo
2ef6931a15 For pointers use NULL instead of 0.
MFC after:	2 weeks.
2016-05-16 00:34:48 +00:00
Don Lewis
c871174916 Use strlcpy() instead of strncpy() when copying ifname to ensure
that it is NUL terminated.  Additional NUL padding is not required
for short names.

Use sizeof(destination) in a few places instead of IFNAMSIZ.

Cast afp->af_ridreq and afp->af_addreq  to make the intent of
the code more obvious.

Reported by:	Coverity
CID:		1009628, 1009630, 1009631, 1009632, 1009633, 1009635, 1009638
CID:		1009639, 1009640, 1009641, 1009642, 1009643, 1009644, 1009645
CID:		1009646, 1009647, 1010049, 1010050, 1010051, 1010052, 1010053
CID:		1010054, 1011293, 1011294, 1011295, 1011296, 1011297, 1011298
CID:		1011299, 1305821, 1351720, 1351721
MFC after:	1 week
2016-05-16 00:25:24 +00:00
Rick Macklem
e6e2445622 Fix fuse for "cp" of a mode 0444 file to the file system.
When "cp" of a file with read-only (mode 0444) to a fuse mounted
file system was attempted it would fail with EACCES. This was because
fuse would attempt to open the file WRONLY and the open would fail.
This patch changes the fuse_vnop_open() to test for an extant read-write
open and use that, if it is available.
This makes the "cp" of a read-only file to the fuse mounted file system
work ok.
There are simpler ways to fix this than adding the fuse_filehandle_validrw()
function, but this function is useful for future patches related to
exporting a fuse filesystem via NFS.

MFC after:	2 weeks
2016-05-15 23:15:10 +00:00
Jared McNeill
343044c43b Add Allwinner A83T thermal sensor controller support.
The A83T thermal sensor controller has three sensors. Sensor 0 corresponds
to CPU cluster 0, sensor 1 to CPU cluster 1, and sensor 2 to the GPU. This
driver exports the temperature sensor readings via sysctl.

Calibration data is obtained from SRAM found in the Secure ID module.

Reviewed by:		manu
Differential Revision:	https://reviews.freebsd.org/D6378
2016-05-15 22:36:55 +00:00
Cy Schubert
54da23a7b3 Make subsequent code reachable.
Reported by:	Coverity CID 1354625
MFC after:	3 days
2016-05-15 22:35:11 +00:00
Don Lewis
b0882deadb Use strlcpy() instead of strncpy() when copying ifname to ensure
that it is NUL terminated.  Additional NUL padding is not required
for short names.

Reported by:	Coverity
CID:		1009974
MFC after:	1 week
2016-05-15 22:31:03 +00:00
Don Lewis
dc47112fa5 Use strlcpy() instead of strncpy() when copying ifname to ensure
that it is NUL terminated.  Additional NUL padding is not required
for short names.

Reported by:	Coverity
CID:		99186, 991864, 991865
MFC after:	1 week
2016-05-15 22:17:41 +00:00
Don Lewis
8afa1c3d7a Use strlcpy() instead of strncpy() when copying ifname to ensure
that it is NUL terminated.  Additional NUL padding is not required
for short names.

MFC after:	1 week
2016-05-15 22:06:21 +00:00
Don Lewis
7b06334915 Use strlcpy() instead of strncpy() when copying ifname to ensure
that it is NUL terminated.  Additional NUL padding is not required
for short names.

Reported by:	Coverity
CID:		974852
MFC after:	1 week
2016-05-15 21:45:04 +00:00
Don Lewis
1ef3d54d20 When handling SIOCSIFNAME ensure that the new interface name is NUL
terminated.  Reject the rename attempt if the name is too long.

MFC after:	1 week
2016-05-15 21:37:36 +00:00
Mark Johnston
565e7fd3bc opt_kdtrace.h is not needed for SDT probes as of r258541. 2016-05-15 20:04:43 +00:00
Jared McNeill
792492eee3 Enable SATA power regulator at boot on Sinovoip BananaPi BPI-M3. 2016-05-15 17:25:31 +00:00
Jared McNeill
6a94069a5e Reduce complexity of RSB by always using polling mode. Unfortunately
gpiobus methods can be called with non-sleepable locks held.

Reviewed by:	mmel
2016-05-15 16:43:47 +00:00
Jared McNeill
4e760f013d Add gpio-leds for Sinovoip BananaPi BPI-M3.
The green LED on the board is wired to AXP813 GPIO0 and the blue
LED is wired to AXP813 GPIO1.
2016-05-15 15:56:48 +00:00
Jared McNeill
fafd846c91 Add support for the AXP813/AXP818 power key and GPIO pins. 2016-05-15 15:54:41 +00:00
Jared McNeill
37cc9a031b Allow RSB to be used from interrupt handlers.
The driver uses polling mode if cold or !THREAD_CAN_SLEEP() and now
implements the bus_* interface.
2016-05-15 15:52:34 +00:00
Michal Meloun
1dd6c13536 TEGRA: Also attach gpioc to tegra_gpio driver. Forgotten in r299854. 2016-05-15 15:31:44 +00:00
Michal Meloun
7f460e50ab TEGRA: Don't use common name 'iicb' for tegra specific IIC driver.
Using commn name for different drivers breaks generic kernel creation.
2016-05-15 15:14:46 +00:00
Michal Meloun
c953c6ed19 OFWIICBUS: Make ofwiicbus_devclass externaly visible.
It's needed for binding of iic controllers.
2016-05-15 15:13:56 +00:00
Michal Meloun
d85aca8d66 TEGRA: Don't use common name 'gpio' for tegra specific GPIO driver.
Using commn name for different drivers breaks generic kernel creation.
2016-05-15 14:47:50 +00:00
Michal Meloun
e3da01a384 OFWGPIOBUS: Make ofwgpiobus_devclass externaly visible.
It's needed for binding of gpio controllers.
2016-05-15 14:43:52 +00:00
Adrian Chadd
1e383b4bca [bwn] remove N-PHY registers for now.
I've submitted an alternative proposal to -core about just importing
the (converted) GPL PHY code in an alternate directory under sys/gnu/
so I don't have to rewrite it all to be BSD licenced.
2016-05-15 14:39:41 +00:00
Emmanuel Vadot
3d8b512e0b Allow arm generic_timer code to be included even if not present in the
SoC.

Reviewed by:	andrew
Approved by:	cognet (mentor)
Differential Revision:	https://reviews.freebsd.org/D6372
2016-05-15 13:20:59 +00:00
Jilles Tjoelker
ecaa1101c3 install: When preserving timestamps, also copy the nanoseconds part. 2016-05-15 13:17:05 +00:00
Edward Tomasz Napierala
dd49c93695 Remove NULL checks after M_WAITOK allocations from isp(4).
MFC after:	1 month
Sponsored by:	The FreeBSD Foundation
2016-05-15 08:36:12 +00:00
Edward Tomasz Napierala
0d1654c39b Make it possible to reroot into NFS. This means one can have
eg an NFSv4 root over WiFi: boot from md_root (small rootfs image
preloaded by loader(8)), setup WiFi, and then reroot into the actual
root, over NFS.

Note that it's currently limited to NFSv4, and due to problems with
nfsuserd(8) it requres a workaround on the server side: one needs
to set the vfs.nfsd.enable_stringtouid=1 sysctl and not run nfsuserd(8)
on either the server or the client side.

Reviewed by:	rmacklem@
MFC after:	1 month
Relnotes:	yes
Sponsored by:	The FreeBSD Foundation
Differential Revision:	https://reviews.freebsd.org/D6347
2016-05-15 08:34:59 +00:00
Adrian Chadd
e542607041 [bwn] add DUALPHY; this may be useful for PHY-N and later dual-phy probing.
Obtained from:	Landon Fuller <landonf@landonf.org>
2016-05-15 07:02:34 +00:00
Adrian Chadd
882abba02f [bwn] commit the N-PHY register set.
Obtained from:	Linux b43 (register definitions.)
2016-05-15 06:11:40 +00:00
Pedro F. Giffuni
bdfd68dca7 routed(8): Use arc4random_uniform instead of arc4random.
Use arc4random_uniform() when the desired random number upper bound
is not a power of two.

While here, we don't need srandom() and friends anymore.

Obtained from:	OpenBSD (CVS rev. 1.20)
2016-05-15 06:06:22 +00:00
Enji Cooper
73ffff5f64 Make hostid_save depend on hostid
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
2016-05-15 06:00:13 +00:00
Enji Cooper
322c831d0c Fix broken dependency with routed when MK_ROUTED != no
Remove routed as a requirement in NETWORKING, and put it in routed as a BEFORE
requirement instead

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
2016-05-15 05:45:54 +00:00
Enji Cooper
904bea8330 Conditionalize installing etc/rc.d/atm{1,2,3}
`BEFORE: netif` was already in etc/rc.d/atm1, so no additional changes
are needed in that script

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
2016-05-15 05:38:47 +00:00
Enji Cooper
fbee792a95 Remove etc/rc.d/{zfs,zvol} if MK_ZFS != no
MFC after: 2 weeks
X-MFC with: r299840
Sponsored by: EMC / Isilon Storage Division
2016-05-15 05:22:15 +00:00
Enji Cooper
0648b47f06 Conditionalize etc/rc.d/{zfs,zvol} install on MK_ZFS != no
MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
2016-05-15 04:39:36 +00:00
Enji Cooper
7e7d2a6f50 Make FILESYSTEMS, dumpon, and var not depend on zfs and zvol
Make zfs and zvol come before all of the items that depended on them
previously

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
2016-05-15 04:38:50 +00:00
Enji Cooper
142e7499c5 Reduce redundancy after release-pkg merge to head in r298107
- Use BINDIR instead of FILESDIR
- Default all <FILESGROUPS>MODEs to BINMODE with a single for-loop at the
  bottom of the Makefile
- Move all of the conditionals under the relevant MK_* != no build conditional
  blocks

Sponsored by: EMC / Isilon Storage Division
2016-05-15 04:19:50 +00:00
Enji Cooper
9ea0bf43e5 Fix .Dd
Today is the 14th, not the 10th of May

Reported by: igor (derp)
Sponsored by: EMC / Isilon Storage Division
2016-05-15 03:44:32 +00:00
Enji Cooper
9e1f7d9aa0 Fix fully canonicalized example for myvariable.27...
`6` doesn't occur in the OID; it was spurious

Bump .Dd for the change

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
2016-05-15 03:43:36 +00:00
Enji Cooper
3b8e9f554f Remove trailing whitespace in license tort
MFC after: 1 week
Reported by: igor
Sponsored by: EMC / Isilon Storage Division
2016-05-15 03:41:01 +00:00
Enji Cooper
471761b8bb Remove NO_WERROR and add WARNS?= 6
This now compiles cleanly on all architectures

MFC after: 1 month
Tested with: clang 3.8, gcc 4.2.1, gcc 4.5, make tinderbox
Sponsored by: EMC / Isilon Storage Division
2016-05-15 03:38:40 +00:00
Enji Cooper
09ac27c318 Fix -Wcast-align warnings
Use memcpy instead of using direct assignment of void* pointers with
CMSG_DATA(..), which changes alignment

MFC after: 3 weeks
Reported by: clang
Sponsored by: EMC / Isilon Storage Division
2016-05-15 03:36:19 +00:00
Mark Johnston
c81c183dae Use Node Information flag names instead of hard-coding their values.
MFC after:	1 week
2016-05-15 03:22:13 +00:00
Mark Johnston
e8800f3c2f Fix a few style issues in the ICMP sysctl descriptions.
MFC after:	1 week
2016-05-15 03:19:53 +00:00
Mark Johnston
82366c228b Add sysctl descriptions for net.inet6.ip6 and net.inet6.icmp6.
icmp6.redirtimeout, icmp6.nd6_maxnudhint and ip6.rr_prune are left
undocumented as they appear to have no effect. Some existing sysctl
descriptions were modified for consistency and style, and the
ip6.tempvltime and ip6.temppltime handlers were rewritten to be a bit
simpler and to avoid setting the sysctl value before validating it.

MFC after:	3 weeks
2016-05-15 03:18:03 +00:00