aboutsummaryrefslogtreecommitdiff
path: root/plugin
diff options
context:
space:
mode:
authorGravatar Chris O'Haver <cohaver@infoblox.com> 2021-08-16 11:57:26 -0400
committerGravatar GitHub <noreply@github.com> 2021-08-16 08:57:26 -0700
commita9779987474eba673d7faabdbd6cf3571f80e872 (patch)
tree3cc320910cb75f754349d527105ab69bf0418cc6 /plugin
parent7d542fec67fff55b1717d22881749893915a3ec2 (diff)
downloadcoredns-a9779987474eba673d7faabdbd6cf3571f80e872.tar.gz
coredns-a9779987474eba673d7faabdbd6cf3571f80e872.tar.zst
coredns-a9779987474eba673d7faabdbd6cf3571f80e872.zip
Revert "pkg/reuseport: Remove pre-go1.11 impl (#4795)" (#4814)
This reverts commit 4a34e8b8979f23a77000ad6580051b06d2e97508.
Diffstat (limited to 'plugin')
-rw-r--r--plugin/pkg/reuseport/listen_go111.go (renamed from plugin/pkg/reuseport/listen.go)3
-rw-r--r--plugin/pkg/reuseport/listen_go_not111.go13
2 files changed, 16 insertions, 0 deletions
diff --git a/plugin/pkg/reuseport/listen.go b/plugin/pkg/reuseport/listen_go111.go
index c15cdb34f..fa6f365d6 100644
--- a/plugin/pkg/reuseport/listen.go
+++ b/plugin/pkg/reuseport/listen_go111.go
@@ -1,3 +1,6 @@
+// +build go1.11
+// +build aix darwin dragonfly freebsd linux netbsd openbsd
+
package reuseport
import (
diff --git a/plugin/pkg/reuseport/listen_go_not111.go b/plugin/pkg/reuseport/listen_go_not111.go
new file mode 100644
index 000000000..e3bdfb906
--- /dev/null
+++ b/plugin/pkg/reuseport/listen_go_not111.go
@@ -0,0 +1,13 @@
+// +build !go1.11 !aix,!darwin,!dragonfly,!freebsd,!linux,!netbsd,!openbsd
+
+package reuseport
+
+import "net"
+
+// Listen is a wrapper around net.Listen.
+func Listen(network, addr string) (net.Listener, error) { return net.Listen(network, addr) }
+
+// ListenPacket is a wrapper around net.ListenPacket.
+func ListenPacket(network, addr string) (net.PacketConn, error) {
+ return net.ListenPacket(network, addr)
+}