Allow non local udp connections in net_response (#5219)

This commit is contained in:
Greg 2019-01-02 14:53:58 -07:00 committed by Daniel Nelson
parent d28e6aebfa
commit bc45629b70
1 changed files with 1 additions and 2 deletions

View File

@ -141,9 +141,8 @@ func (n *NetResponse) UDPGather() (tags map[string]string, fields map[string]int
start := time.Now() start := time.Now()
// Resolving // Resolving
udpAddr, err := net.ResolveUDPAddr("udp", n.Address) udpAddr, err := net.ResolveUDPAddr("udp", n.Address)
LocalAddr, err := net.ResolveUDPAddr("udp", "127.0.0.1:0")
// Connecting // Connecting
conn, err := net.DialUDP("udp", LocalAddr, udpAddr) conn, err := net.DialUDP("udp", nil, udpAddr)
// Handle error // Handle error
if err != nil { if err != nil {
setResult(ConnectionFailed, fields, tags, n.Expect) setResult(ConnectionFailed, fields, tags, n.Expect)