dim [Sat, 17 Dec 2011 22:32:00 +0000 (22:32 +0000)]
Revert r228650, and work around the clang false positive with printf
formats in usr.bin/netstat/atalk.c by conditionally adding NO_WFORMAT to
the Makefile instead.
dim [Sat, 17 Dec 2011 22:16:27 +0000 (22:16 +0000)]
Use NO_WCAST_ALIGN for usr.sbin/ndiscvt; because this is only built for
x86, any alignment warnings can be safely ignored. Define YY_NO_INPUT
in usr.sbin/ndiscvt/inf-token.l, so no unused lex functions are defined.
dim [Sat, 17 Dec 2011 19:53:08 +0000 (19:53 +0000)]
In usr.sbin/bsnmpd/modules/snmp_wlan/wlan_snmp.h, use the correct
enumeration types for the mesh_peering and mesh_forwarding members of
struct wlan_iface, to fix enum conversion warnings.
dim [Sat, 17 Dec 2011 18:39:04 +0000 (18:39 +0000)]
Unfortunately, clang gives warnings about sendmail code that cannot be
turned off yet. Since this is contrib code, and we don't really care
about the warnings, just turn make them non-fatal for now.
dim [Sat, 17 Dec 2011 17:04:30 +0000 (17:04 +0000)]
Use NO_WCAST_ALIGN for usr.bin/ncplist, as there are many potential
alignment issues in it. (Though I doubt anyone still cares about
NetWare support...)
trociny [Sat, 17 Dec 2011 16:59:22 +0000 (16:59 +0000)]
On start most of sysctl_kern_proc functions use the same pattern:
locate a process calling pfind() and do some additional checks like
p_candebug(). To reduce this code duplication a new function pget() is
introduced and used.
As the function may be useful not only in kern_proc.c it is in the
kernel name space.
nwhitehorn [Sat, 17 Dec 2011 16:20:27 +0000 (16:20 +0000)]
Additional icache paranoia: non-PLT relocations can modify the text segment.
It is then important to make sure the icache is synchronized again to
prevent (rare) random seg faults and illegal instructions.
dim [Sat, 17 Dec 2011 16:10:14 +0000 (16:10 +0000)]
In contrib/less, cast away const a bunch of times, to make it build
without conversion warnings. This code desparately needs a good dose of
const poison, but fixing all the issues would be rather disruptive.
avg [Sat, 17 Dec 2011 15:57:39 +0000 (15:57 +0000)]
syscons: provide a first iteration of cngrab/cnungrab implementation
- put underlying keyboard(s) into the polling mode for the whole
duration of the grab, instead of the previous behavior of going into
and out of the polling mode around each polling attempt
- ditto for setting K_XLATE mode and enabling a disabled keyboard
dim [Sat, 17 Dec 2011 15:33:26 +0000 (15:33 +0000)]
Correct a logic error in usr.bin/hexdump/conv.c, found by clang.
Whenever the conv_c() function encounters an incomplete multibyte char,
it peeks ahead. It also sets p to peekbuf, to indicate it is still
processing the incomplete character.
However, on the next retry, it compares buf against peekbuf, which
always returns false, since both buf and peekbuf are local char arrays,
whose addresses are never the same.
Fix this by comparing against p instead, which was the intention. Also
turn peekbuf into an array of u_char, to prevent conversion warnings.
nwhitehorn [Sat, 17 Dec 2011 15:31:00 +0000 (15:31 +0000)]
Fix RTLD on PowerPC after r228435. Changing the order of init_pltgot()
caused the icache to be invalidated at the wrong time, resulting in
an icache full of nonsense in the PLT section.
avg [Sat, 17 Dec 2011 15:16:54 +0000 (15:16 +0000)]
introduce cngets, a method for kernel to read a string from console
This is intended as a replacement for libkern's gets and mostly borrows
its implementation. It uses cngrab/cnungrab to delimit kernel's access
to console input.
Note: libkern's gets obviously doesn't share any bits of implementation
iwth libc's gets. They also have different APIs and the former doesn't
have the overflow problems of the latter.
avg [Sat, 17 Dec 2011 15:08:43 +0000 (15:08 +0000)]
kern cons: introduce infrastructure for console grabbing by kernel
At the moment grab and ungrab methods of all console drivers are no-ops.
Current intended meaning of the calls is that the kernel takes control of
console input. In the future the semantics may be extended to mean that
the calling thread takes full ownership of the console (e.g. console
output from other threads could be suspended).
dim [Sat, 17 Dec 2011 14:26:16 +0000 (14:26 +0000)]
In contrib/ee/ee.c, fix a few warnings about format strings not being
literals. Also, change the direction argument to move_rel() from char
to int; K&R function definions cause it to be promoted to an int anyway,
and this way we avoid clang warning about it.
bschmidt [Sat, 17 Dec 2011 10:23:17 +0000 (10:23 +0000)]
Fix some net80211 enum nits:
- ic_vap_create() uses an ieee80211_opmode argument
- ieee80211_rate2media() takes an ieee80211_phymode argument
- ieee80211_plcp2rate() takes an ieee80211_phytype argument
- cast to enum ieee80211_protmode and ieee80211_roamingmode to silence
compiler warnings
dim [Sat, 17 Dec 2011 02:23:30 +0000 (02:23 +0000)]
In usr.bin/mt/mt.c, the c_code member of struct commands should really
be an unsigned long, since it will contain values of ioctl request
codes. On 64-bit arches, these will not fit into an int.
dim [Sat, 17 Dec 2011 00:54:09 +0000 (00:54 +0000)]
Use both NO_WFORMAT and NO_WARRAY_BOUNDS for sbin/ipf, it would be too
disruptive to actually fix all the warnings, and the code hasn't been
maintained for several years.
nwhitehorn [Fri, 16 Dec 2011 23:46:05 +0000 (23:46 +0000)]
Allow this to work on embedded systems without Open Firmware by making
lack of a /chosen non-fatal, and manually removing memory in use by the
kernel from the physical memory map.
dim [Fri, 16 Dec 2011 23:42:25 +0000 (23:42 +0000)]
Add a NO_WARRAY_BOUNDS setting to bsd.sys.mk, only applicable to clang,
to selectively work around warnings in programs that don't use flexible
array members, but instead define arrays of length 1 at the end of the
struct, and then access those beyond their declared bounds.
dim [Fri, 16 Dec 2011 23:09:31 +0000 (23:09 +0000)]
In sbin/fsdb/fsdbutil.c, work around a clang false positive with printf
format warnings and conditional operators. (See LLVM PR 11313 for more
information.)
dim [Fri, 16 Dec 2011 22:05:10 +0000 (22:05 +0000)]
Fix the incompatible enum conversions in libexec/ypxfr in another, more
messy way, so as to not disrupt other yp programs: just add casts to
convert the incompatible enums, as the numerical values are the same
(either by accident, design, or the phase of the moon at that time).
jhb [Fri, 16 Dec 2011 20:10:00 +0000 (20:10 +0000)]
Fire a kevent if necessary after seeking on a regular file. This fixes a
case where a kevent would not fire on a regular file if an application read
to EOF and then seeked backwards into the file.
dim [Fri, 16 Dec 2011 16:32:08 +0000 (16:32 +0000)]
Unfortunately, clang gives warnings about sendmail code that cannot be
turned off yet. Since this is contrib code, and we don't really care
about the warnings, just turn make them non-fatal for now.
dim [Fri, 16 Dec 2011 15:58:38 +0000 (15:58 +0000)]
Unfortunately, clang gives warnings about sendmail code that cannot be
turned off yet. Since this is contrib code, and we don't really care
about the warnings, just turn make them non-fatal for now.
dim [Fri, 16 Dec 2011 15:38:11 +0000 (15:38 +0000)]
In libexec/bootpd/bootpgw/bootpgw.c, add a cast for the remaining
minutes of activity, to avoid a warning on platforms where time_t is a
32-bit integer.
dim [Fri, 16 Dec 2011 15:12:42 +0000 (15:12 +0000)]
In cddl/contrib/opensolaris/lib/libdtrace/common/dt_handle.c, some
uint64_t values are snprintf'd using %llx. On amd64, uint64_t is
typedef'd as unsigned long, so cast the values to u_longlong_t, as is
done similarly in the rest of the file.
dim [Fri, 16 Dec 2011 15:04:47 +0000 (15:04 +0000)]
In cddl/contrib/opensolaris/lib/libdtrace/common/dt_consume.c, some
uint64_t values are snprintf'd using %llx. On amd64, uint64_t is
typedef'd as unsigned long, so cast the values to u_longlong_t, as is
done similarly in the rest of the file.
glebius [Fri, 16 Dec 2011 13:30:17 +0000 (13:30 +0000)]
Since size of struct in_aliasreq has just been changed in r228571,
and thus ifconfig(8) needs recompile, it is a good chance to make
parameter checks on SIOCAIFADDR arguments more strict.
se [Fri, 16 Dec 2011 12:42:02 +0000 (12:42 +0000)]
Fix format string Z --> z, since the former is a deprecated and (in FreeBSD)
unsupported form of the latter. This change has been reviewed and accepted
in the -hackers list.
Submitted by: Alexander Best
Reviewed by: David Schulz
glebius [Fri, 16 Dec 2011 12:16:56 +0000 (12:16 +0000)]
A major overhaul of the CARP implementation. The ip_carp.c was started
from scratch, copying needed functionality from the old implemenation
on demand, with a thorough review of all code. The main change is that
interface layer has been removed from the CARP. Now redundant addresses
are configured exactly on the interfaces, they run on.
The CARP configuration itself is, as before, configured and read via
SIOCSVH/SIOCGVH ioctls. A new prefix created with SIOCAIFADDR or
SIOCAIFADDR_IN6 may now be configured to a particular virtual host id,
which makes the prefix redundant.
ifconfig(8) semantics has been changed too: now one doesn't need
to clone carpXX interface, he/she should directly configure a vhid
on a Ethernet interface.
To supply vhid data from the kernel to an application the getifaddrs(8)
function had been changed to pass ifam_data with each address. [1]
The new implementation definitely closes all PRs related to carp(4)
being an interface, and may close several others. It also allows
to run a single redundant IP per interface.
Big thanks to Bjoern Zeeb for his help with inet6 part of patch, for
idea on using ifam_data and for several rounds of reviewing!