]> git.ipfire.org Git - thirdparty/wireguard-go.git/commitdiff
conn: fix windows situation with boundif
authorJason A. Donenfeld <Jason@zx2c4.com>
Sun, 7 Jun 2020 07:24:06 +0000 (01:24 -0600)
committerJason A. Donenfeld <Jason@zx2c4.com>
Sun, 7 Jun 2020 07:26:25 +0000 (01:26 -0600)
This was evidently never tested before committing.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
conn/conn.go
device/bindsocketshim.go

index 16311e479c24be32a801f3c48cc4888578c1e71a..6e043867f21bd7feaa1cd7e84aca9db795ab04b1 100644 (file)
@@ -50,11 +50,11 @@ func CreateBind(port uint16) (b Bind, actualPort uint16, err error) {
        return createBind(port)
 }
 
-// BindToInterface is implemented by Bind objects that support being
+// BindSocketToInterface is implemented by Bind objects that support being
 // tied to a single network interface.
-type BindToInterface interface {
-       BindToInterface4(interfaceIndex uint32, blackhole bool) error
-       BindToInterface6(interfaceIndex uint32, blackhole bool) error
+type BindSocketToInterface interface {
+       BindSocketToInterface4(interfaceIndex uint32, blackhole bool) error
+       BindSocketToInterface6(interfaceIndex uint32, blackhole bool) error
 }
 
 // An Endpoint maintains the source/destination caching for a peer.
index c2555b86272365a3b6ee21d54fa0dba2525b746f..896c7d27ed554e68013056407359caea24e0d47b 100644 (file)
@@ -17,8 +17,8 @@ func (device *Device) BindSocketToInterface4(interfaceIndex uint32, blackhole bo
                return errors.New("Bind is not yet initialized")
        }
 
-       if iface, ok := device.net.bind.(conn.BindToInterface); ok {
-               return iface.BindToInterface4(interfaceIndex, blackhole)
+       if iface, ok := device.net.bind.(conn.BindSocketToInterface); ok {
+               return iface.BindSocketToInterface4(interfaceIndex, blackhole)
        }
        return nil
 }
@@ -29,8 +29,8 @@ func (device *Device) BindSocketToInterface6(interfaceIndex uint32, blackhole bo
                return errors.New("Bind is not yet initialized")
        }
 
-       if iface, ok := device.net.bind.(conn.BindToInterface); ok {
-               return iface.BindToInterface6(interfaceIndex, blackhole)
+       if iface, ok := device.net.bind.(conn.BindSocketToInterface); ok {
+               return iface.BindSocketToInterface6(interfaceIndex, blackhole)
        }
        return nil
 }