1
0
mirror of https://git.zx2c4.com/wireguard-go synced 2024-11-15 01:05:15 +01:00

conn: fix windows situation with boundif

This was evidently never tested before committing.

Signed-off-by: Jason A. Donenfeld <Jason@zx2c4.com>
This commit is contained in:
Jason A. Donenfeld 2020-06-07 01:24:06 -06:00
parent 31faf4c159
commit 59e556f24e
2 changed files with 8 additions and 8 deletions

View File

@ -50,11 +50,11 @@ func CreateBind(port uint16) (b Bind, actualPort uint16, err error) {
return createBind(port) 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. // tied to a single network interface.
type BindToInterface interface { type BindSocketToInterface interface {
BindToInterface4(interfaceIndex uint32, blackhole bool) error BindSocketToInterface4(interfaceIndex uint32, blackhole bool) error
BindToInterface6(interfaceIndex uint32, blackhole bool) error BindSocketToInterface6(interfaceIndex uint32, blackhole bool) error
} }
// An Endpoint maintains the source/destination caching for a peer. // An Endpoint maintains the source/destination caching for a peer.

View File

@ -17,8 +17,8 @@ func (device *Device) BindSocketToInterface4(interfaceIndex uint32, blackhole bo
return errors.New("Bind is not yet initialized") return errors.New("Bind is not yet initialized")
} }
if iface, ok := device.net.bind.(conn.BindToInterface); ok { if iface, ok := device.net.bind.(conn.BindSocketToInterface); ok {
return iface.BindToInterface4(interfaceIndex, blackhole) return iface.BindSocketToInterface4(interfaceIndex, blackhole)
} }
return nil return nil
} }
@ -29,8 +29,8 @@ func (device *Device) BindSocketToInterface6(interfaceIndex uint32, blackhole bo
return errors.New("Bind is not yet initialized") return errors.New("Bind is not yet initialized")
} }
if iface, ok := device.net.bind.(conn.BindToInterface); ok { if iface, ok := device.net.bind.(conn.BindSocketToInterface); ok {
return iface.BindToInterface6(interfaceIndex, blackhole) return iface.BindSocketToInterface6(interfaceIndex, blackhole)
} }
return nil return nil
} }