aboutsummaryrefslogtreecommitdiffstats
path: root/conn/bind_linux.go
diff options
context:
space:
mode:
authorJason A. Donenfeld <Jason@zx2c4.com>2021-04-09 17:21:35 -0600
committerJason A. Donenfeld <Jason@zx2c4.com>2021-04-12 15:35:32 -0600
commit54dbe2471f8ed67f49e8b5e5c92f6f4eb4a5a912 (patch)
tree192f5dc94cddab9552d3e5da6ed20432cd5c6add /conn/bind_linux.go
parentdevice: allocate new buffer in receive death spiral (diff)
downloadwireguard-go-54dbe2471f8ed67f49e8b5e5c92f6f4eb4a5a912.tar.xz
wireguard-go-54dbe2471f8ed67f49e8b5e5c92f6f4eb4a5a912.zip
conn: reconstruct v4 vs v6 receive function based on symtab
This is kind of gross but it's better than the alternatives. Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
Diffstat (limited to 'conn/bind_linux.go')
-rw-r--r--conn/bind_linux.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/conn/bind_linux.go b/conn/bind_linux.go
index 9eec384..c10d8b6 100644
--- a/conn/bind_linux.go
+++ b/conn/bind_linux.go
@@ -148,11 +148,11 @@ again:
var fns []ReceiveFunc
if sock4 != -1 {
- fns = append(fns, makeReceiveIPv4(sock4))
+ fns = append(fns, bind.makeReceiveIPv4(sock4))
bind.sock4 = sock4
}
if sock6 != -1 {
- fns = append(fns, makeReceiveIPv6(sock6))
+ fns = append(fns, bind.makeReceiveIPv6(sock6))
bind.sock6 = sock6
}
if len(fns) == 0 {
@@ -224,7 +224,7 @@ func (bind *LinuxSocketBind) Close() error {
return err2
}
-func makeReceiveIPv6(sock int) ReceiveFunc {
+func (*LinuxSocketBind) makeReceiveIPv6(sock int) ReceiveFunc {
return func(buff []byte) (int, Endpoint, error) {
var end LinuxSocketEndpoint
n, err := receive6(sock, buff, &end)
@@ -232,7 +232,7 @@ func makeReceiveIPv6(sock int) ReceiveFunc {
}
}
-func makeReceiveIPv4(sock int) ReceiveFunc {
+func (*LinuxSocketBind) makeReceiveIPv4(sock int) ReceiveFunc {
return func(buff []byte) (int, Endpoint, error) {
var end LinuxSocketEndpoint
n, err := receive4(sock, buff, &end)