Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 05 Jul 2024 11:25:19 +0000
From:      bugzilla-noreply@freebsd.org
To:        ports-bugs@FreeBSD.org
Subject:   [Bug 280141] net/net-snmp: Tries to bind twice
Message-ID:  <bug-280141-7788@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D280141

            Bug ID: 280141
           Summary: net/net-snmp: Tries to bind twice
           Product: Ports & Packages
           Version: Latest
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Only Me
          Priority: ---
         Component: Individual Port(s)
          Assignee: ports-bugs@FreeBSD.org
          Reporter: freebsd-ports@charlieroot.de

I just upgraded from 13.2 to 14.1 using freebsd-update. Start of net-snmpd
fails:

 58220 snmpd    RET   getsockopt 0
 58220 snmpd    CALL  bind(0x8,0x820833524,0x10)
 58220 snmpd    STRU  struct sockaddr { AF_INET, 192.168.124.35:161 }
 58220 snmpd    RET   bind 0
 58220 snmpd    CALL  socket(PF_INET,0x2<SOCK_DGRAM>,IPPROTO_IP)
 58220 snmpd    RET   socket 9
 58220 snmpd    CALL=20
getsockopt(0x9,SOL_SOCKET,SO_SNDBUF,0x820833388,0x820833384)
 58220 snmpd    RET   getsockopt 0
 58220 snmpd    CALL=20
getsockopt(0x9,SOL_SOCKET,SO_RCVBUF,0x8208333a8,0x8208333a4)
 58220 snmpd    RET   getsockopt 0
 58220 snmpd    CALL  bind(0x9,0x820833524,0x10)
 58220 snmpd    STRU  struct sockaddr { AF_INET, 192.168.124.35:161 }
 58220 snmpd    RET   bind -1 errno 48 Address already in use
 58220 snmpd    CALL  close(0x9)
 58220 snmpd    RET   close 0
 58220 snmpd    CALL  write(0x3,0x2d4ec227800,0x3a)
 58220 snmpd    GIO   fd 3 wrote 58 bytes
       "Error opening specified endpoint "udp:192.168.124.35:161"
       "
 58220 snmpd    RET   write 58/0x3a
 58220 snmpd    CALL  write(0x3,0x2d4ec227800,0x1b)
 58220 snmpd    GIO   fd 3 wrote 27 bytes
       "Server Exiting with code 1
       "

It tries to bind twice.

When I uncomment

agentaddress udp:192.168.124.35:161

from /usr/local/etc/snmp/snmpd.conf it starts fine.

[helmut@BSDHelmut ~]$ sudo kdump -f /tmp/snmpd_ktrace.out 2>&1 | grep "stru=
ct
sockaddr"
 66920 snmpd    STRU  struct sockaddr { AF_INET, 0.0.0.0:161 }
 66920 snmpd    STRU  struct sockaddr { AF_INET, 0.0.0.0:199 }
[helmut@BSDHelmut ~]$

[helmut@BSDHelmut ~]$ cat /usr/local/etc/snmp/snmpd.conf
#agentaddress udp:192.168.124.35:161
rocommunity public 127.0.0.1
rocommunity public 10.0.124.129
rocommunity public 192.168.124.35
[helmut@BSDHelmut ~]$

[helmut@BSDHelmut ~]$ ps auxww | grep snmp
snmpd     11549   0.0  0.1   34648   21588  -  S    13:16     0:00.04
/usr/local/sbin/snmpd -p /var/run/net_snmpd.pid -u snmpd -g snmpd -c
/usr/local/etc/snmp/snmpd.conf
[helmut@BSDHelmut ~]$

Changing agentaddress to

udp:12345

 26689 snmpd    CALL  bind(0x8,0x82085f7a4,0x10)
 26689 snmpd    STRU  struct sockaddr { AF_INET, 0.0.0.0:12345 }
 26689 snmpd    RET   bind 0
 26689 snmpd    CALL  socket(PF_INET,0x2<SOCK_DGRAM>,IPPROTO_IP)
 26689 snmpd    RET   socket 9
 26689 snmpd    CALL=20
getsockopt(0x9,SOL_SOCKET,SO_SNDBUF,0x82085f608,0x82085f604)
 26689 snmpd    RET   getsockopt 0
 26689 snmpd    CALL=20
getsockopt(0x9,SOL_SOCKET,SO_RCVBUF,0x82085f628,0x82085f624)
 26689 snmpd    RET   getsockopt 0
 26689 snmpd    CALL  bind(0x9,0x82085f7a4,0x10)
 26689 snmpd    STRU  struct sockaddr { AF_INET, 0.0.0.0:12345 }
 26689 snmpd    RET   bind -1 errno 48 Address already in use

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-280141-7788>