| Commit message (Collapse) | Author | Age | Files | Lines |
| |
|
|
|
|
|
|
|
|
|
| |
With new send method, that gives us directly port_input pointer, we know
the correct file descriptor right away, no matter are we in SOCK_DGRAM or
in SOCK_STREAM mode. Previously, the function tried to search for the
socket, and that was totally wrong. With several simultaneous connections
this end up with sending a reply to incorrect socket.
Reviewed by: harti
Differential Revision: https://reviews.freebsd.org/D51361
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Shall be no functional change for normal SNMP sends, e.g. replies and
traps.
NB: for the inet_send() called from snmp_send_port() we now actually use
supplied address, but we could do a better job at finding matching socket.
However, it could be that snmp_send_port() is not used by any external
module, and in that case it is easier to just deprecate it as poorly
fitting design of the server. This will be checked with exp-run.
Reviewed by: harti
Differential Revision: https://reviews.freebsd.org/D51360
|
| |
|
|
|
|
|
|
|
|
|
|
| |
Since 04d1781439aa we have a more generic trans_inet.c, that supports IPv6
and can be extended further. The default config file we ship was switched
to the new transport since 12.1-RELEASE, so for most people deprecation
would go unnoticed. Others [who never run etcupdate(8)] would need to
merge a couple lines into their snmpd.config. This will be reflected in
RELNOTES file.
Reviewed by: harti
Differential Revision: https://reviews.freebsd.org/D51359
|
| |
|
|
|
|
|
| |
No functional change, just makes reading easier.
Reviewed by: harti
Differential Revision: https://reviews.freebsd.org/D51358
|
| |
|
|
|
|
|
|
| |
We want to see debugging on stderr in non-daemon mode, otherwise this
mode has little value.
Reviewed by: harti
Differential Revision: https://reviews.freebsd.org/D51356
|
| |
|
|
|
|
|
|
| |
Otherwise in unix/stream mode a disconnected client will crash the
server.
Reviewed by: harti
Differential Revision: https://reviews.freebsd.org/D51355
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
| |
Clang 16 introduced a warning about single bit bitfields in structs,
which is triggered by a declaration in bsnmp's snmpd.h:
contrib/bsnmp/snmpd/trans_lsock.c:271:21: error: implicit truncation from 'int' to a one-bit wide bit-field changes value from 1 to -1 [-Werror,-Wsingle-bit-bitfield-constant-conversion]
peer->input.stream = 1;
^ ~
Signed one-bit bitfields can only have values -1 and 0, but the intent
here is to use the field as a boolean, so make it unsigned.
MFC after: 3 days
|
| |
|
|
| |
Bring the contact info in sync with the contact info at IANA.
|
| |
|
|
|
|
|
|
| |
Use mib-2 throughout the files where applicable
PR: 254231
Reported by: Michael Proto
Reviewed by: bz (at) FreeBSD (dot) org
|
| |
|
|
|
|
|
|
|
| |
RFC 3414 Section 4. Discovery specifies that a discovery request message has a
varBindList left empty. Nonetheless, bsnmpd(1) should not crash when receiving
a non-zero var-bindings list in a Discovery Request message.
PR: 255214
MFC after: 2 weeks
|
| |
|
|
|
|
|
|
|
|
|
|
| |
"recipte" should be spelled like "receipt".
.Dd is intentionally not being bumped for the change.
MFC after: 1 week
Sponsored by: DellEMC
Notes:
svn path=/head/; revision=367399
|
| |
|
|
|
|
|
|
|
|
| |
The code that sets up msghdr must first fully fill in the msghdr
itself, and only then use CMSG_xxx() macros.
Silence from: harti, one week
Notes:
svn path=/head/; revision=360138
|
| |\
| |
| |
| | |
Notes:
svn path=/head/; revision=359512
|
| | |
| |
| |
| | |
Notes:
svn path=/vendor/bsnmp/dist/; revision=186357
|
| | |
| |
| |
| | |
Notes:
svn path=/head/; revision=355697
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
config option.
An address is already in network byte order, there is no need to do
htonl().
PR: 242056
MFC after: 1 week
Notes:
svn path=/head/; revision=354858
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This patch adds a new table begemotSnmpdTransInetTable that uses the
InetAddressType textual convention and can be used to create listening
ports for IPv4, IPv6, zoned IPv6 and based on DNS names. It also supports
future extension beyond UDP by adding a protocol identifier to the table
index. In order to support this gensnmptree had to be modified.
Submitted by: harti
MFC after: 1 month
Relnotes: yes
Differential Revision: https://reviews.freebsd.org/D16654
Notes:
svn path=/head/; revision=345797
|
| | |
| |
| |
| |
| |
| |
| |
| | |
PR: 236930
MFC after: 1 week
Notes:
svn path=/head/; revision=345763
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
For developers gensnmptree can now generate functions for enums to convert
between enums and strings and to check the validity of a value.
The sources in FreeBSD are now in sync with the upstream which allows to
bring in IPv6 modifications.
Notes:
svn path=/head/; revision=335885
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
output, from this:
strnlen, strlen, strlen,(3) - find length of string │·······
... to this:
strlen, strnlen(3) - find length of string
PR: 223525
MFC after: 2 weeks
Notes:
svn path=/head/; revision=332642
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
index(3) function declaration.
Reported by: lwhsu
MFC after: 2 weeks
Notes:
svn path=/head/; revision=328171
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
different access rights.
By default there are two community strings with index 1 and 2, one for
read-only access and second for read-write access:
begemotSnmpdCommunityString.0.1 = $(read)
begemotSnmpdCommunityString.0.2 = $(write)
Now it is possible to define additional community strings using different
indexes:
begemotSnmpdCommunityString.0.3 = "SomeString1"
begemotSnmpdCommunityPermission.0.3 = 1
begemotSnmpdCommunityString.0.4 = "SomeString2"
begemotSnmpdCommunityPermission.0.4 = 2
begemotSnmpdCommunityString.0.5 = "SomeString3"
begemotSnmpdCommunityString.0.6 = "SomeString4"
New attribute begemotSnmpdCommunityPermission can be used to specify access
rights: 1 means "read-only" access, 2 means "read-write" access. If
attribute is not specified for some index this means "read-only" rights.
Community strings must be unique, i.e. must not be the same for different
indexes.
Obtained from: Yandex LLC
MFC after: 2 weeks
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D13785
Notes:
svn path=/head/; revision=328160
|
| | |
| |
| |
| |
| |
| |
| | |
MFC after: 1 week
Notes:
svn path=/head/; revision=326510
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
out of order addresses
Move `port->transport` initialization before the TAILQ_FOREACH(..) loop
to ensure that the value is properly initialized before it's inserted
into the TAILQ.
MFC after: 1 week
PR: 217760
Submitted by: eugen
Sponsored by: Dell EMC Isilon
Notes:
svn path=/head/; revision=315206
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
to a non-wildcard address. As documented in ip(4), doing sendmsg(2) with
IP_SENDSRCADDR on a socket that is bound to non-wildcard address is
completely different to using this control message on a wildcard one.
A fix is to add a bool to mark whether we did setsockopt(IP_RECVDSTADDR)
on the socket, and use IP_SENDSRCADDR control message only if we did.
While here, garbage collect absolutely useless udp_recv() function that
establishes some structures on stack to never use them later.
Notes:
svn path=/head/; revision=312331
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
There haven't been any changes to the MIB definition, so the REVISION
remains static at the version it was imported at
MFC after: 1 week
Notes:
svn path=/head/; revision=311760
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
There haven't been any changes to the MIB definition, so the REVISION
remains static at the version it was imported at
MFC after: 1 week
Notes:
svn path=/head/; revision=311759
|
| | |
| |
| |
| |
| |
| |
| | |
MFC after: 3 days
Notes:
svn path=/head/; revision=311382
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Use strlcpy to ensure p->name doesn't overflow sa.sun_path [*].
- Use SUN_LEN(..) instead of spelling out calculation longhand (inspired
by comment by jmallett).
Tested with: dgram and stream support with both bsnmpwalk and snmpwalk
MFC after: 1 week
Reported by: Coverity
CID: 1006825
Notes:
svn path=/head/; revision=311381
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Ensure `section` doesn't overrun section by using strlcpy instead of
strcpy [*].
- Use strdup instead of malloc + strcpy (this wasn't flagged by Coverity,
but is an opportunistic change).
MFC after: 1 week
Reported by: Coverity
CID: 1006826 [*]
Notes:
svn path=/head/; revision=311378
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This mutes a valid coverity warning about it being uninitialized
when passed in to sendmsg(2).
MFC after: 2 weeks
Reported by: Coverity
CID: 1368202
Notes:
svn path=/head/; revision=311221
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
on success
MFC after: 1 week
Notes:
svn path=/head/; revision=310960
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
avoid returning an uninitialized value
There are some really complicated, snakey if-statements combined with
switch statements that could result in an invalid value being returned
as `ret`
MFC after: 1 week
Reported by: Coverity
CID: 1006551
Notes:
svn path=/head/; revision=310958
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
buffer overruns
MFC after: 1 week
Reported by: Coverity
CID: 1006823, 1006824
Notes:
svn path=/head/; revision=310957
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
systemg"
This is being done to match "struct systemg" in snmpmod(3)
No functional change
MFC after: 3 days
Notes:
svn path=/head/; revision=310763
|
| | |
| |
| |
| |
| |
| |
| | |
MFC after: 3 days
Notes:
svn path=/head/; revision=310663
|
| | |
| |
| |
| |
| |
| |
| | |
MFC after: 3 weeks
Notes:
svn path=/head/; revision=310656
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
as the listening address in snmpd_input(..)
Stash the IPv4 address of the receiver via the recv(..) callback and use it in
the send(..) callback for the transport by specifying IP_SENDSRCADDR for the
control message type.
Add sendmsg logic to the UDP transport's send(..) callback and use the
respective send(..) callback for the transport instead of calling sendto in
snmpd_input(..).
MFC after: 3 weeks
Obtained from: Isilon OneFS (^/onefs/branches/BR_8_0_0_DEV@r507595)
Submitted by: Thor Steingrimsson <thor.steingrimsson@isilon.com>
Sponsored by: Dell EMC Isilon
Notes:
svn path=/head/; revision=310655
|
| | |
| |
| |
| |
| |
| |
| | |
MFC after: 3 weeks
Notes:
svn path=/head/; revision=310648
|
| | |
| |
| |
| |
| |
| |
| | |
MFC after: 3 days
Notes:
svn path=/head/; revision=310592
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
MFC after: 6 days
X-MFC with: r310498
Sponsored by: Dell EMC Isilon
Notes:
svn path=/head/; revision=310591
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Again, for reasons I don't yet understand, this is not being flagged by the
compiler. Unlike the issue addressed in r310587, this problem existed prior
to r310586
MFC after: 2 weeks
X-MFC with: r310586, r310587
Notes:
svn path=/head/; revision=310588
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
I'm not sure why this wasn't flagged as an issue by the compiler, yet
MFC after: 3 weeks
X-MFC with: r310586
Notes:
svn path=/head/; revision=310587
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Add recv callback to transport layer to better facilitate code reuse and
readability and for symmetry with send callback. Move recv_dgram and
recv_stream to udp_recv and lsock_recv, respectively, and make the
beforementioned functions recv callbacks for the udp and lsock transports,
respectively.
Consolidate the check_priv* functions in their relevant trans*.c source to
limit scope/use.
Note: this code is roughly based content from the submitter, although this
was modified to be more of a direct move from snmpd/main.c to the trans_*.c
sources, and to reduce unnecessary static function declarations.
MFC after: 2 weeks
Submitted by: Thor Steingrimsson <thor.steingrimsson@isilon.com>
Sponsored by: Dell EMC Isilon
Notes:
svn path=/head/; revision=310586
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Sort #includes
- Delete trailing whitespace
No functional change
MFC after: 3 days
Notes:
svn path=/head/; revision=310574
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
as discussed in RFC-5343
This fixes interoperability with net-snmp.
Tested with the following invocations of snmpwalk (from net-snmp):
- noAuthNoPriv:
% snmpwalk -v 3 -n '' -u public localhost snmpEngineTime
- authNoPriv:
% snmpwalk -v 3 -n '' -u bsnmp -A bsnmptest -l authNoPriv -a sha localhost \
localhost snmpEngineTime
- authPriv:
% snmpwalk -v 3 -n '' -u bsnmp -A bsnmptest -l authPriv -a sha -x des \
-X bsnmptest localhost snmpEngineTime
MFC after: 1 week
Obtained from: Isilon OneFS (5ec6d772cacbc, with minor tweaks)
Submitted by: Austin Voecks <austin.voecks@isilon.com>
Sponsored by: Dell EMC Isilon
Notes:
svn path=/head/; revision=310498
|
| | |
| |
| |
| |
| |
| |
| |
| |
| | |
No functional change
MFC after: 3 days
Notes:
svn path=/head/; revision=310459
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
- Explicitly test snmp_pdu_encode against SNMP_CODE_OK instead of assuming
any non-zero value is bad.
- Print out the code before calling abort() to give the end-user something
actionable to debug without having to recompile the binary, since the
core might not have these details.
MFC after: 1 week
Notes:
svn path=/head/; revision=310455
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
The CMSG_ family of macros take care of alignment, so we don't need r299830
at all, even if it was correct. Put NO_WCAST_ALIGN into Makefile.
Together with: peter
Notes:
svn path=/head/; revision=300167
|
| | |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
Today is the 14th, not the 10th of May
Reported by: igor (derp)
Sponsored by: EMC / Isilon Storage Division
Notes:
svn path=/head/; revision=299834
|