summaryrefslogtreecommitdiffstats
path: root/contrib/bsnmp/snmpd/main.c
Commit message (Collapse)AuthorAgeFilesLines
* Re-do r240271:glebius2012-09-201-1/+9
| | | | | | | | | | | - Set IP_RECVDSTADDR sockopt on the socket only in case if it is INADDR_ANY bound. - Supply IP_SENDSRCADDR control message only if we did receive IP_RECVDSTADDR control message. This fixes operation of snmpd bound to a specific local IP address. PR: bin/171279
* For UDP transport set IP_RECVDSTADDR sockopt on the socket, and provideglebius2012-09-091-6/+33
| | | | | | | | IP_SENDSRCADDR control with datagram message we reply with. This makes bsnmpd reply from exactly same address that request was sent to, thus successfully bypassing stateful firewalls or other kinds of strict checking. PR: bin/171279
* The first part of check_priv() function, that attempts to obtain credsglebius2012-09-081-43/+31
| | | | | | | | | | | | | | | | | | | | | | | | | from the control message, actually never worked. This means check_priv() didn't work for local dgram sockets. The SCM_CREDS control messages is received only in two cases: 1) If we did setsockopt(LOCAL_CREDS) on our socket, and in this case the message is struct sockcred. 2) If sender did supplied SCM_CREDS control message in his sendmsg() syscall. In this case the message is struct cmsgcred. We can't rely on 2), so we will use 1) for dgram sockets. For stream sockets it is more reliable to obtain accept-time credentials, since SCM_CREDS control message is attached only on first read. Thus: o Do setsockopt(LOCAL_CREDS) on local dgram sockets. o Split check_priv() into check_priv_stream() and check_priv_dgram(), and call them from recv_stream() and recv_dgram() respectively. o Don't provide space for SCM_CREDS control message in recv_stream(). o Provide space for SCM_CREDS control message in recv_dgram(), but there is no need to initialize anything in it. o In recv_dgram() do not blindly expect that first message is SCM_CREDS, instead use correct search cycle through control messages.
* memset() wants the size of the structure to clear, not the sizeharti2012-03-181-1/+1
| | | | | | of the pointer to it. Submitted by: Pawel Worach
* Don't spam syslog with "inet_ntop(): Address family not supportedru2011-04-201-2/+3
| | | | | | | by protocol family" when processing requests received from the UNIX domain socket. MFC after: 3 days
* Bring in a SNMP module that allows configuration of SNMPv3 Notification targets.syrinx2010-12-201-3/+11
| | | | | | Sponsored by: The FreeBSD Foundation Reviewed by: philip Approved by: philip
* In bsnmpd(1) add support for SNMPv3 message processing model, including ↵syrinx2010-12-081-27/+896
| | | | | | | | message authentication, packet encryption & view-based access control (RFC 3412, 3414, 3415). Sponsored by: The FreeBSD Foundation Reviewed by: philip@ (mostly) Approved by: philip@
* Vendor patch: Prevent bsnmpd from dumping core when a module's init hooksyrinx2008-03-071-0/+2
| | | | | | returns an error. Approved by: bz (mentor), harti
* Virgin import of bsnmpd 1.12harti2006-02-271-7/+4
|
* Vendor patch: prevent a core dump when the trace option is not followedharti2006-01-311-1/+3
| | | | | | by an option value. Submitted by: Shteryana Shopova <shteryana@yahoo.com>
* Vendor fix: make the default read and write communities NULL. Thisharti2006-01-101-2/+2
| | | | | | basically disables any access unless other strings are set in the config file. Note, that there is no way to set the communities back to NULL once they're set to something not NULL.
* Vendor fix for the build problem of snmp_pf. Move the fallback definitionsharti2005-10-051-0/+4
| | | | | for U?INT32_{MAX,MIN} from asn1.h into the .c files that actually require them (the .h file doesn't refer to these macros).
* Virgin import of bsnmpd 1.11harti2005-10-041-4/+75
|
* Virgin import of bsnmpd 1.10harti2005-05-231-11/+11
|
* Vendor patch: fix a bug that was introduced when moving from libisc toharti2005-04-291-14/+4
| | | | | libbegemot: the rpoll_start_timer function needs the timeout value in milli-seconds, not the absolute time when the timer should tick.
* Virgin import of bsnmp 1.9harti2005-04-261-1/+39
|
* Virgin import of bsnmpd 1.8harti2005-02-281-2/+2
|
* Virgin import of bsnmpd 1.7harti2004-08-061-37/+40
|
* Import of bsnmpd 1.6harti2004-04-141-5/+5
|
* Virgin import of bsnmpd 1.5aharti2004-01-231-349/+580
|
* Virgin import of bsnmp 1.4harti2003-11-101-0/+2038
OpenPOWER on IntegriCloud