do not listen on IPv6 when host is 0.0.0.0 (#240)

(https://github.com/aler9/mediamtx/issues/1665)
This commit is contained in:
Alessandro Ros
2023-04-10 22:42:19 +02:00
committed by GitHub
parent 9ca5e130fe
commit c56eee37f8
7 changed files with 34 additions and 16 deletions

View File

@@ -1232,8 +1232,8 @@ func (c *Client) doSetup(
err := cm.allocateUDPListeners(
false,
":"+strconv.FormatInt(int64(rtpPort), 10),
":"+strconv.FormatInt(int64(rtcpPort), 10),
net.JoinHostPort("", strconv.FormatInt(int64(rtpPort), 10)),
net.JoinHostPort("", strconv.FormatInt(int64(rtcpPort), 10)),
)
if err != nil {
return nil, err
@@ -1377,8 +1377,8 @@ func (c *Client) doSetup(
err := cm.allocateUDPListeners(
true,
thRes.Destination.String()+":"+strconv.FormatInt(int64(thRes.Ports[0]), 10),
thRes.Destination.String()+":"+strconv.FormatInt(int64(thRes.Ports[1]), 10),
net.JoinHostPort(thRes.Destination.String(), strconv.FormatInt(int64(thRes.Ports[0]), 10)),
net.JoinHostPort(thRes.Destination.String(), strconv.FormatInt(int64(thRes.Ports[1]), 10)),
)
if err != nil {
return nil, err