Commit graph

333 commits

Author SHA1 Message Date
Enji Cooper 99ca491ca6 Remove NO_WERROR.clang from this Makefile
This compiles with clang without warnings

MFC after: 1 month
Sponsored by: EMC / Isilon Storage Division
2016-05-15 00:42:18 +00:00
Enji Cooper 6047e12ca5 Replace malloc + memset(.., 0, ..) with calloc calls
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2016-05-15 00:40:05 +00:00
Enji Cooper 27c7c23864 Use strdup instead of malloc + strlcpy
Fix error messages on failure for calloc/strdup

MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division
2016-05-15 00:25:36 +00:00
Enji Cooper 229bb4daa1 Correct function names that failed in error messages
It should be calloc/strdup, not malloc

MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division
2016-05-15 00:24:21 +00:00
Enji Cooper d208c8fa3f Replace QUADFMT with %ju and QUADXFMT with %jx and cast values with uintmax_t
This will cure some -Wformat warnings

MFC after: 1 week
Reported by: clang, gcc
Sponsored by: EMC / Isilon Storage Division
2016-05-15 00:10:37 +00:00
Enji Cooper 70e366f272 Bump WARNS to 6
MFC after: 1 month
Sponsored by: EMC / Isilon Storage Division
2016-05-15 00:08:09 +00:00
Enji Cooper 92f7f8fb62 Fix up r299769
Similar to r299802, it was noted that using nitems on scalar pointers is
invalid.

Use strdup instead of malloc + strlcpy (which is what the old code was doing
anyhow).

MFC after: 1 week
Pointyhat to: ngie
Sponsored by: EMC / Isilon Storage Division
2016-05-15 00:05:28 +00:00
Enji Cooper 4e312050f0 Replace malloc + memset(.., 0, ..) with calloc calls
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2016-05-15 00:02:55 +00:00
Enji Cooper 2501437203 Fix up both r299764 and r299770
nitems was wrong too, as it was being tested against a pointer instead of a buffer on
the stack.

Since the old code was just doing malloc, then strlcpy'ing the contents of the source
buffer into the destination buffer, replace it all with a call to strdup..

Reported by: bde
MFC after: 1 week
X-MFC with: r299764, r299770
Supersized Duncecap to: ngie
Sponsored by: EMC / Isilon Storage Division
2016-05-15 00:01:23 +00:00
Enji Cooper 4a2b63d5bb Convert tok from enum tok to int32_t in function calls
get_token(..) returns int32_t, not enum tok, and in many cases tests for items
not in enum tok (e.g. '('). Make the typing consistent with get_token, which
includes a domino effect of changing enum tok to int32_t.

MFC after: 2 weeks
Sponsored by: EMC / Isilon Storage Division
2016-05-14 23:29:41 +00:00
Enji Cooper 5413861b16 Use a consistent errno save/restore pattern before running strtoul
- Save errno
- Set errno to 0
- Call strtoul
- Test errno (optional, but many calls to strtoul did this afterwards)

Some of the code was setting errno = 0 after calling strtoul, not setting
errno = 0, or setting errno to saved_errno after the call, but before the
test. These all have unwanted behavioral side-effects, depending on the
initial value of errno and whether or not the input to strtoul was correct
or incorrect.

MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division
2016-05-14 23:22:38 +00:00
Enji Cooper 2c0046434b Do minimal work necessary to cure a -Wunused-but-set-variable warning from gcc
How errno is saved before and restored after strtoul calls needs a rethink

MFC after: 1 week
Reported by: gcc 5.x
Sponsored by: EMC / Isilon Storage Division
2016-05-14 23:13:23 +00:00
Enji Cooper 54811dda50 Fix up r299764
I meant to use nitems, not sizeof(..) with the destination buffer. Using sizeof(..)
on a pointer will always truncate the output in the destination buffer incorrectly

Pointyhat to: ngie
MFC after: 1 week
X-MFC with: r299764
Sponsored by: EMC / Isilon Storage Division
2016-05-14 22:43:07 +00:00
Enji Cooper 896f12fec1 Use the size of the destination buffer instead of the malloc size, repeated, in order
to mute a -Wstrlcpy-strlcat-size warning

MFC after: 1 week
Reported by: clang
Sponsored by: EMC / Isilon Storage Division
2016-05-14 22:40:35 +00:00
Enji Cooper 19ffd5ecda Mute sign compare warning by casting rc to u_int to match nbindings' type
rc cannot be negative -- that was already tested for earlier on in
the function

MFC after: 1 week
Reported by: clang, gcc
Sponsored by: EMC / Isilon Storage Division
2016-05-14 22:29:11 +00:00
Enji Cooper 715e3b39a6 Fix logically dead code pointed out by clang/Coverity
parse_context, parse_user_security: test for validity of results from
parse_ascii(..) with by casting to int32_t and comparing to -1; comparing
unsigned types to negative values will always be false.

Reported by: clang, Coverity
CID: 1011432, 1011433
MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division
2016-05-14 22:04:44 +00:00
Enji Cooper 81910adfc4 Fix theoretical buffer overflow issues in snmp_oid2asn_oid
Increase the size of `string` by 1 to account for the '\0' terminator. In the event
that `str` doesn't contain any non-alpha chars, i would be set to MAXSTR, and
the subsequent strlcpy call would overflow by a character.

Remove unnecessary `string[i] = '\0'` -- this is already handled by strlcpy.

MFC after: 1 week
Reported by: clang
Sponsored by: EMC / Isilon Storage Division
2016-05-14 21:32:52 +00:00
Enji Cooper 78a780e3e5 Use the size of the destination buffer, not the source buffer.
Technically this is a no-op, but mute the clang warning in case the malloc call
above for fstring ever changes in the future

Reported by: clang
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2016-05-14 21:27:33 +00:00
Enji Cooper 6e229b2973 Mute -Wstrlcpy-strlcat-size warning by using nitems with the size of the buffer
This is a no-op as the malloc above set the size of the buffer to the size used
below, but this keeps things consistent in case the malloc call changes somehow.

MFC after: 1 week
Reported by: clang
Sponsored by: EMC / Isilon Storage Division
2016-05-14 20:58:34 +00:00
Enji Cooper 444991f1e6 Mark snmptoolctx unused in parse_authentication(..), parse_privacy(..),
parse_context(..), and parse_user_security(..).

MFC after: 1 week
Reported by: clang, gcc
Sponsored by: EMC / Isilon Storage Division
2016-05-14 20:33:42 +00:00
Enji Cooper 4a8c12cd34 parse_ascii: make count size_t to mute a -Wsign-compare issue
count is always unsigned.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2016-05-14 20:31:12 +00:00
Enji Cooper 9a3ebeefc0 Sort variables in parse_ascii(..) per style(9)
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2016-05-14 20:28:23 +00:00
Enji Cooper 031987d916 Use calloc instead of memset(.., 0, ..) + malloc
MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2016-05-14 20:25:14 +00:00
Enji Cooper 0150b85a1c Fix some trivial clang/gcc warnings in bsnmptc.c
- By definition, `enum snmp_tc` can't be false (the implied starting sequence
  index for the enum is 0). Don't test for it being < 0.
- Staticize `struct snmp_text_conv` to mute a -Wmissing-variable-declarations
  warning from clang.
- Remove set but unused variable, ptr, in parse_bridge_id(..) and
  parse_bport_id(..) to mute warning from gcc 4.9+.
- Mark value and string unused in snmp_inetaddr2oct(..) and parse_inetaddr(..)
  as they're just stub functions.

MFC after: 1 week
Sponsored by: EMC / Isilon Storage Division
2016-05-14 04:13:28 +00:00
Enji Cooper 66987347e9 Fold two malloc + memset(.., 0, ..) calls into equivalent calloc calls
MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division
2016-05-14 04:00:17 +00:00
Enji Cooper 29517fca53 Staticize global variables only used in bsnmpimport.c to fix
-Wmissing-variable-declarations warnings

MFC after: 3 weeks
Reported by: clang
Sponsored by: EMC / Isilon Storage Division
2016-05-14 03:57:18 +00:00
Enji Cooper 836229c3cf Move _bsnmptools_debug extern from bsnmpmap.c to bsnmptools.h
It was used in bsnmpmap.c but was stored in bsnmptools.c; moving the extern
to the header allows us to cover all of our bases for the variable, and allows
_bsnmptools_debug to be used in the future elsewhere -- not just bsnmpmap.c.

MFC after: 3 weeks
Sponsored by: EMC / Isilon Storage Division
2016-05-13 21:26:12 +00:00
Don Lewis 7a7c07ef51 Properly compute the size argument to pass to malloc().
Reported by:	Coverity
CID:		1198856
MFC after:	1 week
2016-05-13 06:45:16 +00:00
Enji Cooper a08b636a9d Use a better idiom for finding UTC prefixed timezones
Instead of copy-pasting the string literal for "UTC" 3 times and using
strlen, use a static char[3] buffer and sizeof(..).

MFC after: 3 days
X-MFC with: r298507
Submitted by: kib
Sponsored by: EMC / Isilon Storage Division
2016-04-28 17:57:17 +00:00
Enji Cooper 62bc9ed546 Fix looking for "UTC" at start of ptr by using strnmp instead of improperly
unrolled equivalent

CID: 1347118
MFC after: 1 week
Reported by: Coverity
Sponsored by: EMC / Isilon Storage Division
2016-04-23 08:10:04 +00:00
Enji Cooper 9899399c06 Don't try to free string (stack allocated char[])
Fix minor style with warnx call while in the neighborhood

MFC after: 1 week
CID: 1009683
Reported by: Coverity, gcc 5.x
Sponsored by: EMC / Isilon Storage Division
2016-04-22 06:01:11 +00:00
Enji Cooper 81b3868083 Don't use entry after free in the "already in lists" case
Return with 0 as it isn't an error.

MFC after: 1 week
CID: 1006085
Reported by: Coverity
Obtained from: Isilon OneFS (part of r493633)
Submitted by: Thor Steingrimsson <thor.steingrimsson@isilon.com>
Sponsored by: EMC / Isilon Storage Division
2016-04-22 05:52:40 +00:00
Glen Barber 52259a98ad MFH
Sponsored by:	The FreeBSD Foundation
2016-03-02 16:14:46 +00:00
Bryan Drewery bd18fd57db DIRDEPS_BUILD: Regenerate without local dependencies.
These are no longer needed after the recent 'beforebuild: depend' changes
and hooking DIRDEPS_BUILD into a subset of FAST_DEPEND which supports
skipping 'make depend'.

Sponsored by:	EMC / Isilon Storage Division
2016-02-24 17:20:11 +00:00
Glen Barber 30922917c8 MFH
Sponsored by:	The FreeBSD Foundation
2016-02-10 04:20:39 +00:00
Konstantin Belousov db57c70a5b Rename P_KTHREAD struct proc p_flag to P_KPROC.
I left as is an apparent bug in ntoskrnl_var.h:AT_PASSIVE_LEVEL()
definition.

Suggested by:	jhb
Sponsored by:	The FreeBSD Foundation
2016-02-09 16:30:16 +00:00
Glen Barber b626f5a73a MFH r289384-r293170
Sponsored by:	The FreeBSD Foundation
2016-01-04 19:19:48 +00:00
Bryan Drewery b1f92fa229 META MODE: Update dependencies with 'the-lot' and add missing directories.
This is not properly respecting WITHOUT or ARCH dependencies in target/.
Doing so requires a massive effort to rework targets/ to do so.  A
better approach will be to either include the SUBDIR Makefiles directly
and map to DIRDEPS or just dynamically lookup the SUBDIR.  These lose
the benefit of having a userland/lib, userland/libexec, etc, though and
results in a massive package.  The current implementation of targets/ is
very unmaintainable.

Currently rescue/rescue and sys/modules are still not connected.

Sponsored by:	EMC / Isilon Storage Division
2015-12-01 05:23:19 +00:00
Bryan Drewery 7b3ea376a2 META MODE: Prefer INSTALL=tools/install.sh to lessen the need for xinstall.host.
This both avoids some dependencies on xinstall.host and allows
bootstrapping on older releases to work due to lack of at least 'install -l'
support.

Sponsored by:	EMC / Isilon Storage Division
2015-11-25 19:10:28 +00:00
Baptiste Daroussin 5a2b666ce5 Merge from head 2015-10-01 09:36:43 +00:00
Bryan Drewery 54c7d75a06 META_MODE: Remove DEP_RELDIR from Makefile.depend files.
This has not been needed since r284171 in projects/bmake.

Sponsored by:	EMC / Isilon Storage Division
2015-09-25 19:26:08 +00:00
Baptiste Daroussin b5ff185e19 Merge from head 2015-09-12 11:41:31 +00:00
Pedro F. Giffuni d37cb73c79 snmp_hostres(3): Fix buffer overflow.
Actually just a typo. Detected by gcc + FORTIFY_SOURCE patches.

CID:		1007594
MFC after:	3 days
2015-07-20 16:08:01 +00:00
Baptiste Daroussin 2fbd60ec47 Merge from head @274131 2015-06-20 00:58:46 +00:00
Simon J. Gerraty 2ef6d5a7b9 new depends 2015-06-16 23:37:19 +00:00
Baptiste Daroussin dad2fb7ece Merge from head 2015-06-15 10:56:01 +00:00
Simon J. Gerraty ccfb965433 Add META_MODE support.
Off by default, build behaves normally.
WITH_META_MODE we get auto objdir creation, the ability to
start build from anywhere in the tree.

Still need to add real targets under targets/ to build packages.

Differential Revision:       D2796
Reviewed by: brooks imp
2015-06-13 19:20:56 +00:00
Simon J. Gerraty 44d314f704 dirdeps.mk now sets DEP_RELDIR 2015-06-08 23:35:17 +00:00
Simon J. Gerraty 98e0ffaefb Merge sync of head 2015-05-27 01:19:58 +00:00
Baptiste Daroussin 7757a1b4dc Merge from head 2015-05-03 19:30:11 +00:00
Baptiste Daroussin f2800dd40f bsnmptools does not depends on libcrypto 2015-04-09 21:05:48 +00:00
Baptiste Daroussin 9f4256d525 Add a bsnmp package 2015-03-18 13:01:09 +00:00
Joel Dahl 914f6e6290 mdoc: sort SEE ALSO. 2014-12-26 21:56:23 +00:00
Baptiste Daroussin c6db8143ed Convert usr.sbin to LIBADD
Reduce overlinking
2014-11-25 16:57:27 +00:00
Dimitry Andric b9cfeb20f6 Fix the following -Werror warnings from clang 3.5.0, while building
bsnmpd's snmp_hostres module:

usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c:204:20: error: absolute value function 'abs' given an argument of type 'const long' but has parameter of type 'int' which may cause truncation of value [-Werror,-Wabsolute-value]
        str[9] = (u_char)(abs(tm->tm_gmtoff) / 3600);
                          ^
usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c:204:20: note: use function 'labs' instead
        str[9] = (u_char)(abs(tm->tm_gmtoff) / 3600);
                          ^~~
                          labs
usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c:205:22: error: absolute value function 'abs' given an argument of type 'const long' but has parameter of type 'int' which may cause truncation of value [-Werror,-Wabsolute-value]
        str[10] = (u_char)((abs(tm->tm_gmtoff) % 3600) / 60);
                            ^
usr.sbin/bsnmpd/modules/snmp_hostres/hostres_snmp.c:205:22: note: use function 'labs' instead
        str[10] = (u_char)((abs(tm->tm_gmtoff) % 3600) / 60);
                            ^~~
                            labs

Since tm::tm_gmtoff is a long, use labs(3) instead.

MFC after:	3 days
2014-11-22 23:50:18 +00:00
Simon J. Gerraty ee7b0571c2 Merge head from 7/28 2014-08-19 06:50:54 +00:00
Marcel Moolenaar e7d939bda2 Remove ia64.
This includes:
o   All directories named *ia64*
o   All files named *ia64*
o   All ia64-specific code guarded by __ia64__
o   All ia64-specific makefile logic
o   Mention of ia64 in comments and documentation

This excludes:
o   Everything under contrib/
o   Everything under crypto/
o   sys/xen/interface
o   sys/sys/elf_common.h

Discussed at: BSDcan
2014-07-07 00:27:09 +00:00
Luiz Otavio O Souza 646707db80 Simplify the code a little bit using the update_sensor_sysctl() routine to
retrieve the sensor temperature.

This also avoid the overflow that could happen on sysctlnametomib(3)
because the code was not checking the length of the mib array.

CID:		1222504
2014-06-27 18:58:22 +00:00
Luiz Otavio O Souza c04cdb5738 Correct the buffer length check to avoid overflows.
Found with:	Coverity Scan
CID:		1222502, 1222503
2014-06-27 18:40:14 +00:00
Baptiste Daroussin 01c2b8ac0d use .Mt to mark up email addresses consistently (part2)
PR:		191174
Submitted by:	Franco Fichtner  <franco@lastsummer.de>
2014-06-20 09:57:27 +00:00
Luiz Otavio O Souza 7b34615303 Never, ever, abbreviate the month names on manual pages.
Pointed out by:	brueffer
Pointy hat to:	loos
2014-06-02 02:20:28 +00:00
Luiz Otavio O Souza f74e8e4039 Adds the bsnmp module to export the temperature data from lm75 sensors on
the system.

Together with lm75(4) this module allows easy temperature monitoring over
SNMP, specially for embedded systems.

Manual page reviewed by:        brueffer (D128)
2014-06-01 03:14:03 +00:00
Christian Brueffer 6e898985fc Grammar cleanup; sort SEE ALSO.
MFC after:	1 week
2014-05-31 21:12:14 +00:00
Simon J. Gerraty fae50821ae Updated dependencies 2014-05-16 14:09:51 +00:00
Simon J. Gerraty 76b28ad6ab Updated dependencies 2014-05-10 05:16:28 +00:00
Simon J. Gerraty cc3f4b9965 Merge from head 2014-05-08 23:54:15 +00:00
Warner Losh c6063d0da8 Use src.opts.mk in preference to bsd.own.mk except where we need stuff
from the latter.
2014-05-06 04:22:01 +00:00
Simon J. Gerraty 3b8f084595 Merge head 2014-04-28 07:50:45 +00:00
Christian Brueffer 550c00ac6c Rough cleanup (new sentence -> new line, grammar, spelling, mdoc).
This could use more work.

PR:		187035 (in part)
Submitted by:	Bjorn Heidotting
MFC after:	1 week
2014-02-25 21:01:55 +00:00
Gleb Smirnoff 9968f056d6 Fix world build WITHOUT_PF.
Sponsored by:	Nginx, Inc.
2014-02-12 09:59:48 +00:00
Mikolaj Golub bcfa7a8677 Add mibs for hastd(1) queue stats.
MFC after:	1 week
2013-12-29 19:02:33 +00:00
Simon J. Gerraty 34b33809b7 Updated dependencies 2013-10-13 00:24:00 +00:00
Simon J. Gerraty 4fd0d10e0f New dependencies 2013-10-13 00:22:44 +00:00
Simon J. Gerraty d1d0158641 Merge from head 2013-09-05 20:18:59 +00:00
Mikolaj Golub 7f87e7c276 hastResourceWorkerPid is read-only.
Submitted by:	jilles
MFC after:	3 days
2013-07-03 05:54:23 +00:00
Mikolaj Golub e338dbe453 Add a mib for worker process ID.
MFC after:	3 days
2013-07-02 18:54:39 +00:00
Mikolaj Golub e0505d2826 Revert r250394, which disabled snmp_hast due to libl dependency issue --
the dependency has been removed in r250503.
2013-05-12 13:42:49 +00:00
Mikolaj Golub 1df892f44c Get rid of libl dependency. We needed it only to provide yywrap. But
yywrap is not necessary when parsing a single hast.conf file.

Suggested by:	kib
Reviewed by:	pjd
2013-05-11 09:51:44 +00:00
Mikolaj Golub 198ee3001d Move snmp_hast manual to section 3, where all other manual pages for
bsnmp modules are located.

Section 3 (Library Functions) looks wrong for this manual page, which
contains only module description, that is why initially it was located
to section 8 (System Manager's Manual).  On the other hand manual
pages for all other bsnmpd modules are already located in the section
3, and having all pages in one section looks more consistent.  Also,
currently, similarly to manuals for other modules, snmp_hast manual
contains LIBRARY section, which is not good style for section 8.

Requested by:	joel
X-MFC with:	r250379
2013-05-09 11:10:46 +00:00
Peter Wemm 35fdad8420 Unbreak build - this can only build on i386 as-is due to use of libl in
a .so file, and we currently (intentionally) only build libl.a.
2013-05-08 23:30:24 +00:00
Mikolaj Golub 7297a2ff53 HAST module for bsnmpd(1).
Reviewed by:	harti, pjd
MFC after:	2 weeks
2013-05-08 20:03:37 +00:00
Ed Schouten 7e659f9491 Add the Clang specific -Wmissing-variable-declarations to WARNS=6.
This compiler flag enforces that that people either mark variables
static or use an external declarations for the variable, similar to how
-Wmissing-prototypes works for functions.

Due to the fact that Yacc/Lex generate code that cannot trivially be
changed to not warn because of this (lots of yy* variables), add a
NO_WMISSING_VARIABLE_DECLARATIONS that can be used to turn off this
specific compiler warning.

Announced on:	toolchain@
2013-04-19 19:45:00 +00:00
Simon J. Gerraty 69e6d7b75e sync from head 2013-04-12 20:48:55 +00:00
Joel Dahl 2063b2c09b Minor spelling and grammar fixes. 2013-04-11 19:05:24 +00:00
Mikolaj Golub aebd8de674 hrStorageSize and hrStorageUsed are 32 bit integers, reporting a fs
size and usage in hrStorageAllocationUnits. If the file system has
more than 2^31 allocations it can not be shown correctly and the
meters are useless.

In such cases follow net-snmp behaviour and increase
hrStorageAllocationUnits so the values fit under INT_MAX.

PR:		bin/177183
Submitted by:	Eugene Grosbein egrosbein rdtc.ru
MFC after:	2 weeks
2013-03-25 19:12:36 +00:00
Simon J. Gerraty 7cf3a1c6b2 Updated dependencies 2013-03-11 17:21:52 +00:00
Simon J. Gerraty f5f7c05209 Updated dependencies 2013-02-16 01:23:54 +00:00
David E. O'Brien d9a447559b Sync with HEAD. 2013-02-08 16:10:16 +00:00
Pedro F. Giffuni 646a7fea0c Clean some 'svn:executable' properties in the tree.
Submitted by:	Christoph Mallon
MFC after:	3 days
2013-01-26 22:08:21 +00:00
Simon J. Gerraty 7cd2dcf076 Updated/new Makefile.depend 2012-11-08 21:24:17 +00:00
Simon J. Gerraty 23090366f7 Sync from head 2012-11-04 02:52:03 +00:00
Mikolaj Golub 16c3b091ae In snmp_hostres, device_map table is used for consistent device table
indexing. When a device has gone it is not removed from device_map
table but just its entry_p field is set to NULL.

So when traversing device_map in disk_OS_get_ATA_disks() and
disk_OS_get_MD_disks() check for entry_p being NULL, otherwise the
bsnmpd crash is possible when a removed map entry is dereferenced.

Before the fix, for disk_OS_get_ATA_disks() the crash could be easily
reproduced running:

  atacontrol detach ata1

The crash was not observed in disk_OS_get_MD_disks() because currently
snmp_hostres does no see md(4) disks: to get the device list it uses
devinfo(3), which does not return md devices.

Reported by:	Miroslav Lachman 000.fbsd quip.cz
MFC after:	1 week
2012-09-17 07:32:53 +00:00
Gleb Smirnoff 6a9e7628f8 Do not count kernel threads as processes for hrSystemProcesses OID.
PR:		bin/160494
Submitted by:	Jeremy Chadwick <freebsd jdc.parodius.com>
2012-09-11 08:33:16 +00:00
Gleb Smirnoff 5739f2975d Spelling. 2012-09-11 08:28:58 +00:00
Gleb Smirnoff d6d3f01e0a Merge the projects/pf/head branch, that was worked on for last six months,
into head. The most significant achievements in the new code:

 o Fine grained locking, thus much better performance.
 o Fixes to many problems in pf, that were specific to FreeBSD port.

New code doesn't have that many ifdefs and much less OpenBSDisms, thus
is more attractive to our developers.

  Those interested in details, can browse through SVN log of the
projects/pf/head branch. And for reference, here is exact list of
revisions merged:

r232043, r232044, r232062, r232148, r232149, r232150, r232298, r232330,
r232332, r232340, r232386, r232390, r232391, r232605, r232655, r232656,
r232661, r232662, r232663, r232664, r232673, r232691, r233309, r233782,
r233829, r233830, r233834, r233835, r233836, r233865, r233866, r233868,
r233873, r234056, r234096, r234100, r234108, r234175, r234187, r234223,
r234271, r234272, r234282, r234307, r234309, r234382, r234384, r234456,
r234486, r234606, r234640, r234641, r234642, r234644, r234651, r235505,
r235506, r235535, r235605, r235606, r235826, r235991, r235993, r236168,
r236173, r236179, r236180, r236181, r236186, r236223, r236227, r236230,
r236252, r236254, r236298, r236299, r236300, r236301, r236397, r236398,
r236399, r236499, r236512, r236513, r236525, r236526, r236545, r236548,
r236553, r236554, r236556, r236557, r236561, r236570, r236630, r236672,
r236673, r236679, r236706, r236710, r236718, r237154, r237155, r237169,
r237314, r237363, r237364, r237368, r237369, r237376, r237440, r237442,
r237751, r237783, r237784, r237785, r237788, r237791, r238421, r238522,
r238523, r238524, r238525, r239173, r239186, r239644, r239652, r239661,
r239773, r240125, r240130, r240131, r240136, r240186, r240196, r240212.

I'd like to thank people who participated in early testing:

Tested by:	Florian Smeets <flo freebsd.org>
Tested by:	Chekaluk Vitaly <artemrts ukr.net>
Tested by:	Ben Wilber <ben desync.com>
Tested by:	Ian FREISLICH <ianf cloudseed.co.za>
2012-09-08 06:41:54 +00:00
Marcel Moolenaar 7750ad47a9 Sync FreeBSD's bmake branch with Juniper's internal bmake branch.
Requested by: Simon Gerraty <sjg@juniper.net>
2012-08-22 19:25:57 +00:00
Dimitry Andric 7ae0e2c9f0 Upgrade our copy of llvm/clang to trunk r162107. With thanks to
Benjamin Kramer and Joerg Sonnenberger for their input and fixes.
2012-08-20 18:33:03 +00:00
Glen Barber a3fb6da9ba General mdoc(7) and typo fixes.
PR:		167734
Submitted by:	Nobuyuki Koganemaru (kogane!jp.freebsd.org)
MFC after:	3 days
2012-05-11 20:06:46 +00:00
Eitan Adler 50d675f7a9 Remove trailing whitespace per mdoc lint warning
Disussed with:	gavin
No objection from:	doc
Approved by:	joel
MFC after:	3 days
2012-03-29 05:02:12 +00:00
Joel Dahl c2965cd185 mdoc: terminate quoted strings.
Reviewed by:	brueffer
2012-03-26 15:18:14 +00:00
Joel Dahl c0cbd1c6f1 Remove superfluous paragraph macro. 2012-03-25 09:18:34 +00:00
Ed Schouten 6b99842ada Globally replace u_int*_t from (non-contributed) man pages.
The reasoning behind this, is that if we are consistent in our
documentation about the uint*_t stuff, people will be less tempted to
write new code that uses the non-standard types.

I am not going to bump the man page dates, as these changes can be
considered style nits. The meaning of the man pages is unaffected.

MFC after:	1 month
2012-02-12 18:29:56 +00:00
Shteryana Shopova b9288caaf6 Implement an option to execute SNMP walks using GETBULK requests in bsnmpwalk(1)
retrieving multiple values with a Single PDU.

Reviewed by:	philip@
Tested by:	tsanand129 (at) gmail (dot) com
2012-01-10 15:29:03 +00:00
Ulrich Spörlein b81da4450d Partial backout of r228990, restore original MIB object name.
It's too late to change this in 9.0 -- so we have a release with the
misspelling in the wild and should not break users that depend on it.

Deprecating/replacing it because of a one-char typo seems excessive.
2012-01-05 21:36:28 +00:00
Ed Schouten b589816c74 Fix subtle typo: compare against idx -- not index.
In this contest, index refers to the index(3) function. In this case it
doesn't really harm, as this function is never called with idx == NULL.

MFC after:	2 weeks
2012-01-03 11:10:15 +00:00
Ulrich Spörlein 3df5ecac8c Spelling fixes for usr.sbin/ 2011-12-30 10:58:14 +00:00
Dimitry Andric 1605515d77 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.

MFC after:	1 week
2011-12-17 19:53:08 +00:00
Ivan Voras 1c4edd12cd Apparently, "ada" drives are better treated similarly to "da" drives. 2011-10-24 12:59:39 +00:00
Ivan Voras 9601613ecd It seems that the warning is much less severe than its message says. The
device is certainly added to the list after the first pass.
2011-10-24 12:43:20 +00:00
Ivan Voras e9e42921af Fix typo
MFC after:	1 month
2011-10-24 12:21:58 +00:00
Ulrich Spörlein f0720ed5f8 Fix broken mdoc.
Found by:	manlint
Approved by:	re (kib)
2011-08-01 22:21:18 +00:00
Andrey V. Elsukov 8f64015c0e Use full buffer size in read(2) call, there is no need to preserve the
last byte of the buffer.

Since we call refresh_device_tbl() for any devctl event types - no need
to check the first byte of buffer. Remove these checks.

Also remove logging for the case of unknown devd message. It incorrectly
triggers when all devctl events are not fit into one buffer and part of
unread data will be read in the next pass.

When length of data readed from devctl is equal to sizeof(buf), then try
to read from socket again, to read full data.

MFC after:	2 weeks
2011-07-11 12:51:35 +00:00
Ed Schouten 48a16a34d8 Remove redundant assignments to WARNS.
For these directories, WARNS is already implied to be 6.
2011-06-06 20:24:17 +00:00
Ruslan Ermilov a6d11f7139 [mdoc] Fixed .Dt call. 2011-05-25 14:13:53 +00:00
Shteryana Shopova cf90ea94a0 Unbreak the build by temprorarily not using include directives in
bsnmpd(1)' def files, until bsd.snmpmod.mk & Makefiles are fixed to
pass proper include path flags to gensnmptree.
2010-12-20 22:56:50 +00:00
Shteryana Shopova 72cd7a520d Bring in a SNMP module that allows configuration of SNMPv3 Notification targets.
Sponsored by:	The FreeBSD Foundation
Reviewed by:	philip
Approved by:	philip
2010-12-20 17:13:14 +00:00
Shteryana Shopova 1c706be073 Pass proper -Wl,-export-dynamic to ld. Thus bsnmpd(1) compiled with clang
properly exports its symbols to the modules.

Submitted by:	dim
2010-12-16 15:18:53 +00:00
Shteryana Shopova 695239e2c7 Remove unnecessary debug/error CFLAGS.
Reported by	: pawel.worach (at) gmail (dot) com
2010-12-11 13:24:01 +00:00
Shteryana Shopova 836993f5cf Unbreak "make installworld" w/ DESTDIR specified
PR	:	kern/152939
2010-12-09 12:25:45 +00:00
Shteryana Shopova a739872374 Add bsnmpd(1)'s SNMP client tools (including SNMPv3 support) to the base system.
Sponsored by:   The FreeBSD Foundation (the SNMPv3 bits), Google Summer of Code 2005
Reviewed by:    philip@ (mostly), bz@ (earlier version based on p4 ch124545)
Approved by:    philip@
2010-12-08 14:30:25 +00:00
Shteryana Shopova 135f7de5dd In bsnmpd(1) add support for SNMPv3 message processing model, including message authentication, packet encryption & view-based access control (RFC 3412, 3414, 3415).
Sponsored by:	The FreeBSD Foundation
Reviewed by:	philip@ (mostly)
Approved by:	philip@
2010-12-08 13:51:38 +00:00
Ulrich Spörlein ac203a768d Fix CPU load reporting independent of scheduler used.
- Sample CPU usage data from kern.cp_times, this makes for a far more
  accurate and scheduler independent algorithm.
- Rip out the process list scraping that is no longer required.
- Don't update CPU usage sampling on every request, but every 15s
  instead. This makes it impossible for an attacker to hide the CPU load
  by triggering 4 samplings in short succession when the system is idle.
- After reaching the steady-state, the system will always report the
  average CPU load of the last 60 sampled seconds.
- Untangling of call graph.

PR:		kern/130222
Tested by:	Julian Dunn <jdunn@aquezada.com>
		Gustau Pérez <gperez@entel.upc.edu>
		Jürgen Weiß <weiss@uni-mainz.de>
MFC after:	2 weeks

I'm unsure if some MIB standard states this must be the load average
for, eg. 300s, it looks like net-snmp isn't even bothering to implement
the CPU load reporting at all.
2010-10-28 20:18:26 +00:00
Joel Dahl c2025a7660 Fix typos, spelling, formatting and mdoc mistakes found by Nobuyuki while
translating these manual pages.  Minor corrections by me.

Submitted by:	Nobuyuki Koganemaru <n-kogane@syd.odn.ne.jp>
2010-08-16 15:18:30 +00:00
Joel Dahl f6ac23919b Fix typos and spelling mistakes. 2010-08-06 14:33:42 +00:00
Shteryana Shopova 5593fdda18 Connect the snmp_wlan(3) module to the build.
Sponsored by:	The FreeBSD Foundation
2010-07-26 16:26:26 +00:00
Shteryana Shopova 09cbe818f0 Bring in a SNMP module to support monitoring cloned wireless interfaces
via bsnmpd(1). The module implements a private BEGEMOT-WIRELESS-MIB.

Sponsored by:	The FreeBSD Foundation
Reviewed by:	philip@
Approved by:	philip@
2010-07-26 16:16:39 +00:00
Simon L. B. Nielsen 12b052b9e0 Make failed open of /dev/mdctl in the bsnmpd hostres module non-fatal.
This makes it possible to use the hostres module when bsnmpd is not
running as root.

MFC after:	1 week
2010-07-24 10:04:35 +00:00
Ulrich Spörlein 62486687ed mdoc: consistently spell our email addresses <foo@FreeBSD.org>
Reviewed by:	ru
2010-05-19 08:57:53 +00:00
Shteryana Shopova 438be77d54 Now actually implement reading/refreshing/returning data from the pfTablesAddrTable
and modify the BEGEMOT-PF-MIB to add support for IPV6 address' statistics in the PF
tables via pfTablesAddrNetType and pfTablesAddrNet. While here, upgrade the
pf_tree.def file to the new format that includes enumerated values. Also make sure
to return SNMP_ERR_NOSUCHNAME for ALTQ objects, if ALTQ is disabled, so that the agent
will know to skip the pfAltq subtree when servicing GETNEXT requests from SNMP clients
(otherwise snmpwalk on begemotPf would stop at the pfAltq subtree with bsnmpd returning
SNMP_ERR_GENERR).
2010-03-24 16:07:33 +00:00
Shteryana Shopova 9315567023 Make sure the snmp_pf module will first refresh its entires if necessary,
then find a specific entry, and get the requested value. So far, it found
the specific entry, refreshed the entry list if necessary, and got the
requested value from the found entry. The problem is that refreshing nukes
all old entries and replaces them with new ones and the obtained entry
pointer was no longer valid after the refresh.

Reviewed by:		bz, philip
MFC after:		1 week
2010-03-19 09:53:25 +00:00
Shteryana Shopova 72d420c708 Add support for retrieving labeled pf filter rule counters.
PR:		bin/132847
Submitted by:	Szalai Andras <szalai (dot) bandi (at) gmail.com>
2010-03-18 14:54:31 +00:00
Ulrich Spörlein 7729e3ba40 Remove redundant WARNS?=6 overrides and inherit the WARNS setting from
the toplevel directory.

This does not change any WARNS level and survives a make universe.

Approved by:        ed (co-mentor)
2010-03-02 18:44:08 +00:00
Ed Schouten b5810e9449 Port all applications in usr.sbin/ from libulog to utmpx. 2010-01-13 18:17:53 +00:00
Ed Schouten 71ccf09269 The last big commit: let usr.sbin/ use WARNS=6 by default. 2010-01-02 11:07:44 +00:00
Ed Schouten 71713ba2e1 Let the snmp_hostres module use utmpx.
Approved by:	harti
2009-12-24 17:55:47 +00:00
Shteryana Shopova 1753369083 Make sure enough memory is allocated for a struct pft_entry when
refreshing the list of pf tables.

OKed by:	philip
MFC after:	1 week
2009-12-05 13:45:21 +00:00
Attilio Rao 1262810177 Collapse devinfo_state_t with device_state_t in order to avoid a
structure replication and improve manteneability.

Reviewed by:	jhb, imp
Tested by:	Riccardo Torrini <riccardo at torrini dot org>
2009-11-15 16:44:43 +00:00
Ken Smith 3ca3047aee Bump the version of all non-symbol-versioned shared libraries in
preparation for 8.0-RELEASE.  Add the previous version of those
libraries to ObsoleteFiles.inc and bump __FreeBSD_Version.

Reviewed by:    kib
Approved by:    re (rwatson)
2009-07-19 17:25:24 +00:00
Kip Macy a9eb07938f add zfs oid to bsnmpd
PR: bin/129360
Submitted by:	Ulrich Spoerlein
2009-05-17 05:54:25 +00:00
Bruce M Simpson 7a02aaee75 Only build the bsnmpd netgraph module if MK_NETGRAPH_SUPPORT is set. 2008-10-02 14:26:56 +00:00
Philip Paeps 0fecb888b2 Use INSERT_OBJECT_INT_LINK_INDEX macro instead of TAILQ_INSERT_TAIL when
filling the table of ALTQ queues retrieved from the kernel.

It is possible for the kernel to return the queues not by pa.altq.qid order.
When this happens, pf_snmp would only partially fill its table.

PR:		bin/120974
Submitted by:	Mykola Dzham <i -at- levsha.org.ua>
MFC after:	3 days
2008-06-01 14:09:54 +00:00
Shteryana Shopova 24988ed32d Keep the snmp_bridge(3) module up to date with if_bridge(4) and add an
object to control the value of the new 'PRIVATE' bridge members' flag.
While here, remove stale '__unused' compiler directives.

Reviewed by:	bz
Approved by:	re (bmah), bz (mentor)
2007-08-08 19:27:50 +00:00
Max Laier 60ee384760 Link pf 4.1 to the build:
- move ftp-proxy from libexec to usr.sbin
 - add tftp-proxy
 - new altq mtag link

Approved by:	re (kensmith)
2007-07-03 12:46:08 +00:00
Rong-En Fan 27cfc42fc5 - Bump share library version which were missed in last bump
Reported by: 	     jhb
Discussed with:	     deischen, des, doubg, harti
Approved by:	     re (kensmith)
2007-06-18 18:47:54 +00:00
Pawel Jakub Dawidek 6b3d6017e8 s/destory/destroy/ (except for the code in contrib/). 2007-04-16 12:31:35 +00:00
Soeren Straarup 7b8287fb85 ! is a generic info message
Reviewed by:	harti
Approved by:	harti
MFC after:	2 weeks
2007-03-09 16:29:15 +00:00
Shteryana Shopova ffdddc92b4 Remove all #if __FreeBSD_version checks now that RSTP support has been
MFCed to RELENG_6. We no longer need that to compile the bridge module
under both RELENG_6 and CURRENT.

Approved by:	bz (mentor)
2007-02-04 13:31:05 +00:00
Bjoern A. Zeeb 61644918e3 Re-connect snmp_bridge to the build. It survived a make universe
(apart from powerpc where the build broke earlier).
2006-12-29 19:24:51 +00:00
Bjoern A. Zeeb a245531a29 bridge_snmp.h
* Change the API of bridge_get_basemac to take a maximum buffer length.

bridge_if.c
* Adopt to new API.
* In bridge_attach_newif() remove an additional pointer to the buffer
  by shuffling the code a bit. Also makes the code more readable.

bridge_sys.c
* bridge_get_basemac():
  - Adopt to the new API.
  - Change check for error code of getifaddrs().
  - First check for sa_family != AF_LINK.
  - Copy sockaddr_dl * to get around alignment constraints on some
    platforms.
  - Use strcmp instead of strncmp so that "foo11" != "foo1".
* other functions:
  - Allocate n times of the struct we need instead of arbitrary len,
    cast to the type we want it to be and pass around struct *s instead
    of char *s. This gets us around alignment restrictions on some
    platforms and in addition it is more clear what data is passed around.
  - Name variables for same types consistently.

Reviewed by:    syrinx
2006-12-29 19:23:38 +00:00
Bjoern A. Zeeb 6f3914bcf4 ia64 is nit-picking according to tinderbox so temporary disconnect
the bridge module from the build until this is fixed.
2006-12-21 01:58:22 +00:00