]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r312331:
authorngie <ngie@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 20 Jan 2017 06:24:31 +0000 (06:24 +0000)
committerngie <ngie@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 20 Jan 2017 06:24:31 +0000 (06:24 +0000)
commit54d4a1f28e35db578d4745e66794893159ec528b
tree2e44bd0ea7799847127896cbcb01f874de0e46a9
parent592c23193b8e964abf7e461ca313a79a3c100dba
MFC r312331:
r312331 (by glebius):

Fix regression from r310655, which broke operation of bsnmpd if it is bound
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.

git-svn-id: svn://svn.freebsd.org/base/stable/10@312516 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
contrib/bsnmp/snmpd/trans_udp.c
contrib/bsnmp/snmpd/trans_udp.h