Allow non local udp connections in net_response (#5219)
This commit is contained in:
parent
d28e6aebfa
commit
bc45629b70
|
@ -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)
|
||||||
|
|
Loading…
Reference in New Issue