Repository: pion/turn
Pull request #355 (2023-09-05 17:05:24)

Update module github.com/pion/stun to v2
[![Mend Renovate](https://app.renovatebot.com/images/banner.svg)](https://renovatebot.com)

This PR contains the following updates:

| Package | Type | Update | Change |
|---|---|---|---|
| [github.com/pion/stun](https://togithub.com/pion/stun) | require | major | `v0.6.1` -> `v2.0.0` |

---

### Release Notes

<details>
<summary>pion/stun (github.com/pion/stun)</summary>

### [`v2.0.0`](https://togithub.com/pion/stun/releases/tag/v2.0.0)

[Compare Source](https://togithub.com/pion/stun/compare/v0.6.1...v2.0.0)

#### Changelog

-   [`4ff55da`](https://togithub.com/pion/stun/commit/4ff55da) Start pion/stun@v2
-   [`26873a1`](https://togithub.com/pion/stun/commit/26873a1) Update module github.com/pion/transport/v2 to v3
-   [`d1f1ac8`](https://togithub.com/pion/stun/commit/d1f1ac8) Update module github.com/pion/transport/v2 to v2.2.2
-   [`ba204e8`](https://togithub.com/pion/stun/commit/ba204e8) Update CI configs to v0.10.11

</details>

---

### Configuration

📅 **Schedule**: Branch creation - At any time (no schedule defined), Automerge - At any time (no schedule defined).

🚦 **Automerge**: Disabled by config. Please merge this manually once you are satisfied.

♻ **Rebasing**: Whenever PR becomes conflicted, or you tick the rebase/retry checkbox.

🔕 **Ignore**: Close this PR and you won't be reminded about this update again.

---

 - [ ] <!-- rebase-check -->If you want to rebase/retry this PR, check this box

---

This PR has been generated by [Mend Renovate](https://www.mend.io/free-developer-tools/renovate/). View repository job log [here](https://developer.mend.io/github/pion/turn).
<!--renovate-debug:eyJjcmVhdGVkSW5WZXIiOiIzNi43OS4xIiwidXBkYXRlZEluVmVyIjoiMzYuNzkuMSIsInRhcmdldEJyYW5jaCI6Im1hc3RlciJ9-->


codecov[bot]: ## [Codecov](https://app.codecov.io/gh/pion/turn/pull/355?src=pr&el=h1&utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pion) Report
Patch has no changes to coverable lines.



:loudspeaker: Thoughts on this report? [Let us know!](https://about.codecov.io/pull-request-comment-report/?utm_medium=referral&utm_source=github&utm_content=comment&utm_campaign=pr+comments&utm_term=pion).


Patch:
diff --git a/client.go b/client.go
index 467036c..9d32a22 100644
--- a/client.go
+++ b/client.go
@@ -12,7 +12,7 @@ import (
 	"time"
 
 	"github.com/pion/logging"
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 	"github.com/pion/transport/v3"
 	"github.com/pion/transport/v3/stdnet"
 	"github.com/pion/turn/v3/internal/client"
diff --git a/examples/turn-server/add-software-attribute/main.go b/examples/turn-server/add-software-attribute/main.go
index f553c05..2deb3cb 100644
--- a/examples/turn-server/add-software-attribute/main.go
+++ b/examples/turn-server/add-software-attribute/main.go
@@ -15,7 +15,7 @@ import (
 	"strconv"
 	"syscall"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 	"github.com/pion/turn/v3"
 )
 
diff --git a/examples/turn-server/log/main.go b/examples/turn-server/log/main.go
index e0e4e5e..40a7534 100644
--- a/examples/turn-server/log/main.go
+++ b/examples/turn-server/log/main.go
@@ -15,7 +15,7 @@ import (
 	"strconv"
 	"syscall"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 	"github.com/pion/turn/v3"
 )
 
diff --git a/go.mod b/go.mod
index e33ae4e..34530f1 100644
--- a/go.mod
+++ b/go.mod
@@ -5,7 +5,7 @@ go 1.13
 require (
 	github.com/pion/logging v0.2.2
 	github.com/pion/randutil v0.1.0
-	github.com/pion/stun v0.6.1
+	github.com/pion/stun/v2 v2.0.0
 	github.com/pion/transport/v3 v3.0.1
 	github.com/stretchr/testify v1.8.4
 	golang.org/x/sys v0.11.0
diff --git a/go.sum b/go.sum
index 9bccd9e..652ef9f 100644
--- a/go.sum
+++ b/go.sum
@@ -7,8 +7,8 @@ github.com/pion/logging v0.2.2 h1:M9+AIj/+pxNsDfAT64+MAVgJO0rsyLnoJKCqf//DoeY=
 github.com/pion/logging v0.2.2/go.mod h1:k0/tDVsRCX2Mb2ZEmTqNa7CWsQPc+YYCB7Q+5pahoms=
 github.com/pion/randutil v0.1.0 h1:CFG1UdESneORglEsnimhUjf33Rwjubwj6xfiOXBa3mA=
 github.com/pion/randutil v0.1.0/go.mod h1:XcJrSMMbbMRhASFVOlj/5hQial/Y8oH/HVo7TBZq+j8=
-github.com/pion/stun v0.6.1 h1:8lp6YejULeHBF8NmV8e2787BogQhduZugh5PdhDyyN4=
-github.com/pion/stun v0.6.1/go.mod h1:/hO7APkX4hZKu/D0f2lHzNyvdkTGtIy3NDmLR7kSz/8=
+github.com/pion/stun/v2 v2.0.0 h1:A5+wXKLAypxQri59+tmQKVs7+l6mMM+3d+eER9ifRU0=
+github.com/pion/stun/v2 v2.0.0/go.mod h1:22qRSh08fSEttYUmJZGlriq9+03jtVmXNODgLccj8GQ=
 github.com/pion/transport/v2 v2.2.1 h1:7qYnCBlpgSJNYMbLCKuSY9KbQdBFoETvPNETv0y4N7c=
 github.com/pion/transport/v2 v2.2.1/go.mod h1:cXXWavvCnFF6McHTft3DWS9iic2Mftcz1Aq29pGcU5g=
 github.com/pion/transport/v3 v3.0.1 h1:gDTlPJwROfSfz6QfSi0ZmeCSkFcnWWiiR9ES0ouANiM=
diff --git a/internal/allocation/allocation.go b/internal/allocation/allocation.go
index cb68bd0..80a2c54 100644
--- a/internal/allocation/allocation.go
+++ b/internal/allocation/allocation.go
@@ -11,7 +11,7 @@ import (
 	"time"
 
 	"github.com/pion/logging"
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 	"github.com/pion/turn/v3/internal/ipnet"
 	"github.com/pion/turn/v3/internal/proto"
 )
diff --git a/internal/client/allocation.go b/internal/client/allocation.go
index c7b6d05..49b09b6 100644
--- a/internal/client/allocation.go
+++ b/internal/client/allocation.go
@@ -11,7 +11,7 @@ import (
 	"time"
 
 	"github.com/pion/logging"
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 	"github.com/pion/transport/v3"
 	"github.com/pion/turn/v3/internal/proto"
 )
diff --git a/internal/client/client.go b/internal/client/client.go
index 7c22858..615da80 100644
--- a/internal/client/client.go
+++ b/internal/client/client.go
@@ -7,7 +7,7 @@ package client
 import (
 	"net"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 )
 
 // Client is an interface for the public turn.Client in order to break cyclic dependencies
diff --git a/internal/client/tcp_alloc.go b/internal/client/tcp_alloc.go
index a94bf6d..69c2102 100644
--- a/internal/client/tcp_alloc.go
+++ b/internal/client/tcp_alloc.go
@@ -11,7 +11,7 @@ import (
 	"net"
 	"time"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 	"github.com/pion/transport/v3"
 	"github.com/pion/turn/v3/internal/proto"
 )
diff --git a/internal/client/transaction.go b/internal/client/transaction.go
index e447553..6031d6c 100644
--- a/internal/client/transaction.go
+++ b/internal/client/transaction.go
@@ -8,7 +8,7 @@ import (
 	"sync"
 	"time"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 )
 
 const (
diff --git a/internal/client/udp_conn.go b/internal/client/udp_conn.go
index 87239c0..8db3321 100644
--- a/internal/client/udp_conn.go
+++ b/internal/client/udp_conn.go
@@ -12,7 +12,7 @@ import (
 	"net"
 	"time"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 	"github.com/pion/turn/v3/internal/proto"
 )
 
diff --git a/internal/proto/chann.go b/internal/proto/chann.go
index f85c6a1..5bf9257 100644
--- a/internal/proto/chann.go
+++ b/internal/proto/chann.go
@@ -8,7 +8,7 @@ import (
 	"errors"
 	"strconv"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 )
 
 // ChannelNumber represents CHANNEL-NUMBER attribute.
diff --git a/internal/proto/connection_id.go b/internal/proto/connection_id.go
index 8827da6..8794d99 100644
--- a/internal/proto/connection_id.go
+++ b/internal/proto/connection_id.go
@@ -6,7 +6,7 @@ package proto
 import (
 	"encoding/binary"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 )
 
 // ConnectionID represents CONNECTION-ID attribute.
diff --git a/internal/proto/data.go b/internal/proto/data.go
index d3cf313..16aafc9 100644
--- a/internal/proto/data.go
+++ b/internal/proto/data.go
@@ -3,7 +3,7 @@
 
 package proto
 
-import "github.com/pion/stun"
+import "github.com/pion/stun/v2"
 
 // Data represents DATA attribute.
 //
diff --git a/internal/proto/dontfrag.go b/internal/proto/dontfrag.go
index 317938c..44f9090 100644
--- a/internal/proto/dontfrag.go
+++ b/internal/proto/dontfrag.go
@@ -4,7 +4,7 @@
 package proto
 
 import (
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 )
 
 // DontFragmentAttr is a deprecated alias for DontFragment
diff --git a/internal/proto/evenport.go b/internal/proto/evenport.go
index c41df32..3b41e2a 100644
--- a/internal/proto/evenport.go
+++ b/internal/proto/evenport.go
@@ -3,7 +3,7 @@
 
 package proto
 
-import "github.com/pion/stun"
+import "github.com/pion/stun/v2"
 
 // EvenPort represents EVEN-PORT attribute.
 //
diff --git a/internal/proto/lifetime.go b/internal/proto/lifetime.go
index 4405c77..ac26c3d 100644
--- a/internal/proto/lifetime.go
+++ b/internal/proto/lifetime.go
@@ -7,7 +7,7 @@ import (
 	"encoding/binary"
 	"time"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 )
 
 // DefaultLifetime in RFC 5766 is 10 minutes.
diff --git a/internal/proto/peeraddr.go b/internal/proto/peeraddr.go
index a562d5a..d6834a6 100644
--- a/internal/proto/peeraddr.go
+++ b/internal/proto/peeraddr.go
@@ -6,7 +6,7 @@ package proto
 import (
 	"net"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 )
 
 // PeerAddress implements XOR-PEER-ADDRESS attribute.
diff --git a/internal/proto/proto.go b/internal/proto/proto.go
index e584268..8d4f160 100644
--- a/internal/proto/proto.go
+++ b/internal/proto/proto.go
@@ -5,7 +5,7 @@
 package proto
 
 import (
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 )
 
 // Default ports for TURN from RFC 5766 Section 4.
diff --git a/internal/proto/relayedaddr.go b/internal/proto/relayedaddr.go
index d4dcc75..97a6cf9 100644
--- a/internal/proto/relayedaddr.go
+++ b/internal/proto/relayedaddr.go
@@ -6,7 +6,7 @@ package proto
 import (
 	"net"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 )
 
 // RelayedAddress implements XOR-RELAYED-ADDRESS attribute.
diff --git a/internal/proto/reqfamily.go b/internal/proto/reqfamily.go
index 8c18f9d..d859235 100644
--- a/internal/proto/reqfamily.go
+++ b/internal/proto/reqfamily.go
@@ -6,7 +6,7 @@ package proto
 import (
 	"errors"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 )
 
 // RequestedAddressFamily represents the REQUESTED-ADDRESS-FAMILY Attribute as
diff --git a/internal/proto/reqtrans.go b/internal/proto/reqtrans.go
index 5dd446d..2f80196 100644
--- a/internal/proto/reqtrans.go
+++ b/internal/proto/reqtrans.go
@@ -6,7 +6,7 @@ package proto
 import (
 	"strconv"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 )
 
 // Protocol is IANA assigned protocol number.
diff --git a/internal/proto/rsrvtoken.go b/internal/proto/rsrvtoken.go
index ec72fc7..b1f698b 100644
--- a/internal/proto/rsrvtoken.go
+++ b/internal/proto/rsrvtoken.go
@@ -3,7 +3,7 @@
 
 package proto
 
-import "github.com/pion/stun"
+import "github.com/pion/stun/v2"
 
 // ReservationToken represents RESERVATION-TOKEN attribute.
 //
diff --git a/internal/server/server.go b/internal/server/server.go
index 5b0be55..9dadf13 100644
--- a/internal/server/server.go
+++ b/internal/server/server.go
@@ -11,7 +11,7 @@ import (
 	"time"
 
 	"github.com/pion/logging"
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 	"github.com/pion/turn/v3/internal/allocation"
 	"github.com/pion/turn/v3/internal/proto"
 )
diff --git a/internal/server/stun.go b/internal/server/stun.go
index 5a69b8b..5eb67c1 100644
--- a/internal/server/stun.go
+++ b/internal/server/stun.go
@@ -4,7 +4,7 @@
 package server
 
 import (
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 	"github.com/pion/turn/v3/internal/ipnet"
 )
 
diff --git a/internal/server/turn.go b/internal/server/turn.go
index 25d82d5..69e2285 100644
--- a/internal/server/turn.go
+++ b/internal/server/turn.go
@@ -7,7 +7,7 @@ import (
 	"fmt"
 	"net"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 	"github.com/pion/turn/v3/internal/allocation"
 	"github.com/pion/turn/v3/internal/ipnet"
 	"github.com/pion/turn/v3/internal/proto"
diff --git a/internal/server/util.go b/internal/server/util.go
index 44ed0b3..9df12c2 100644
--- a/internal/server/util.go
+++ b/internal/server/util.go
@@ -13,7 +13,7 @@ import (
 	"strconv"
 	"time"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 	"github.com/pion/turn/v3/internal/proto"
 )
 
diff --git a/stun_conn.go b/stun_conn.go
index 3899295..7811716 100644
--- a/stun_conn.go
+++ b/stun_conn.go
@@ -9,7 +9,7 @@ import (
 	"net"
 	"time"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 	"github.com/pion/turn/v3/internal/proto"
 )
 


Test patch:
diff --git a/client_test.go b/client_test.go
index c9fb58c..0830af3 100644
--- a/client_test.go
+++ b/client_test.go
@@ -12,7 +12,7 @@ import (
 	"time"
 
 	"github.com/pion/logging"
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 	"github.com/pion/turn/v3/internal/proto"
 	"github.com/stretchr/testify/assert"
 	"github.com/stretchr/testify/require"
diff --git a/internal/allocation/allocation_test.go b/internal/allocation/allocation_test.go
index 6c8caa8..70c383a 100644
--- a/internal/allocation/allocation_test.go
+++ b/internal/allocation/allocation_test.go
@@ -13,7 +13,7 @@ import (
 	"testing"
 	"time"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 	"github.com/pion/turn/v3/internal/ipnet"
 	"github.com/pion/turn/v3/internal/proto"
 	"github.com/stretchr/testify/assert"
diff --git a/internal/client/client_test.go b/internal/client/client_test.go
index a73f87e..ad30688 100644
--- a/internal/client/client_test.go
+++ b/internal/client/client_test.go
@@ -6,7 +6,7 @@ package client
 import (
 	"net"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 )
 
 type mockClient struct {
diff --git a/internal/client/tcp_conn_test.go b/internal/client/tcp_conn_test.go
index c520577..69fdaa9 100644
--- a/internal/client/tcp_conn_test.go
+++ b/internal/client/tcp_conn_test.go
@@ -9,7 +9,7 @@ import (
 	"time"
 
 	"github.com/pion/logging"
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 	"github.com/pion/transport/v3"
 	"github.com/pion/turn/v3/internal/proto"
 	"github.com/stretchr/testify/assert"
diff --git a/internal/client/udp_conn_test.go b/internal/client/udp_conn_test.go
index 9701cfc..0671a84 100644
--- a/internal/client/udp_conn_test.go
+++ b/internal/client/udp_conn_test.go
@@ -7,7 +7,7 @@ import (
 	"net"
 	"testing"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 	"github.com/stretchr/testify/assert"
 )
 
diff --git a/internal/proto/chann_test.go b/internal/proto/chann_test.go
index f2a81d4..1a32f25 100644
--- a/internal/proto/chann_test.go
+++ b/internal/proto/chann_test.go
@@ -7,7 +7,7 @@ import (
 	"errors"
 	"testing"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 	"github.com/stretchr/testify/assert"
 )
 
diff --git a/internal/proto/chrome_test.go b/internal/proto/chrome_test.go
index 47c87c1..9ad81c7 100644
--- a/internal/proto/chrome_test.go
+++ b/internal/proto/chrome_test.go
@@ -9,7 +9,7 @@ import (
 	"encoding/hex"
 	"testing"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 )
 
 func TestChromeAllocRequest(t *testing.T) {
diff --git a/internal/proto/data_test.go b/internal/proto/data_test.go
index 8091ac5..875f13e 100644
--- a/internal/proto/data_test.go
+++ b/internal/proto/data_test.go
@@ -8,7 +8,7 @@ import (
 	"errors"
 	"testing"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 	"github.com/stretchr/testify/assert"
 )
 
diff --git a/internal/proto/dontfrag_test.go b/internal/proto/dontfrag_test.go
index e31f1e5..f276d06 100644
--- a/internal/proto/dontfrag_test.go
+++ b/internal/proto/dontfrag_test.go
@@ -6,7 +6,7 @@ package proto
 import (
 	"testing"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 )
 
 func TestDontFragment(t *testing.T) {
diff --git a/internal/proto/evenport_test.go b/internal/proto/evenport_test.go
index 7a87056..106ce1e 100644
--- a/internal/proto/evenport_test.go
+++ b/internal/proto/evenport_test.go
@@ -7,7 +7,7 @@ import (
 	"errors"
 	"testing"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 	"github.com/stretchr/testify/assert"
 )
 
diff --git a/internal/proto/fuzz_test.go b/internal/proto/fuzz_test.go
index 1bedc5e..be1bfcd 100644
--- a/internal/proto/fuzz_test.go
+++ b/internal/proto/fuzz_test.go
@@ -9,7 +9,7 @@ import (
 	"fmt"
 	"testing"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 )
 
 type attr interface {
diff --git a/internal/proto/lifetime_test.go b/internal/proto/lifetime_test.go
index f4ccfc2..cd52e83 100644
--- a/internal/proto/lifetime_test.go
+++ b/internal/proto/lifetime_test.go
@@ -8,7 +8,7 @@ import (
 	"testing"
 	"time"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 	"github.com/stretchr/testify/assert"
 )
 
diff --git a/internal/proto/peeraddr_test.go b/internal/proto/peeraddr_test.go
index 43ee6e2..5fb1ceb 100644
--- a/internal/proto/peeraddr_test.go
+++ b/internal/proto/peeraddr_test.go
@@ -7,7 +7,7 @@ import (
 	"net"
 	"testing"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 	"github.com/stretchr/testify/assert"
 )
 
diff --git a/internal/proto/relayedaddr_test.go b/internal/proto/relayedaddr_test.go
index a789711..c4320c9 100644
--- a/internal/proto/relayedaddr_test.go
+++ b/internal/proto/relayedaddr_test.go
@@ -7,7 +7,7 @@ import (
 	"net"
 	"testing"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 	"github.com/stretchr/testify/assert"
 )
 
diff --git a/internal/proto/reqfamily_test.go b/internal/proto/reqfamily_test.go
index 2f17423..12b6bf0 100644
--- a/internal/proto/reqfamily_test.go
+++ b/internal/proto/reqfamily_test.go
@@ -7,7 +7,7 @@ import (
 	"errors"
 	"testing"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 )
 
 func TestRequestedAddressFamily(t *testing.T) {
diff --git a/internal/proto/reqtrans_test.go b/internal/proto/reqtrans_test.go
index 4a5efee..9a95d27 100644
--- a/internal/proto/reqtrans_test.go
+++ b/internal/proto/reqtrans_test.go
@@ -7,7 +7,7 @@ import (
 	"errors"
 	"testing"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 )
 
 func TestRequestedTransport(t *testing.T) {
diff --git a/internal/proto/rsrvtoken_test.go b/internal/proto/rsrvtoken_test.go
index 7a027f1..5d11603 100644
--- a/internal/proto/rsrvtoken_test.go
+++ b/internal/proto/rsrvtoken_test.go
@@ -8,7 +8,7 @@ import (
 	"errors"
 	"testing"
 
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 )
 
 func TestReservationToken(t *testing.T) {
diff --git a/internal/server/turn_test.go b/internal/server/turn_test.go
index 4fc0830..3e41940 100644
--- a/internal/server/turn_test.go
+++ b/internal/server/turn_test.go
@@ -13,7 +13,7 @@ import (
 	"time"
 
 	"github.com/pion/logging"
-	"github.com/pion/stun"
+	"github.com/pion/stun/v2"
 	"github.com/pion/turn/v3/internal/allocation"
 	"github.com/pion/turn/v3/internal/proto"
 	"github.com/stretchr/testify/assert"