From: Jason A. Donenfeld Date: Sun, 7 Jun 2020 07:24:06 +0000 (-0600) Subject: conn: fix windows situation with boundif X-Git-Tag: 0.0.20201118~32 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=59e556f24ec7503eda8ff15f026b2df44e096b6f;p=thirdparty%2Fwireguard-go.git conn: fix windows situation with boundif This was evidently never tested before committing. Signed-off-by: Jason A. Donenfeld --- diff --git a/conn/conn.go b/conn/conn.go index 16311e4..6e04386 100644 --- a/conn/conn.go +++ b/conn/conn.go @@ -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. diff --git a/device/bindsocketshim.go b/device/bindsocketshim.go index c2555b8..896c7d2 100644 --- a/device/bindsocketshim.go +++ b/device/bindsocketshim.go @@ -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 }