diff options
Diffstat (limited to 'libgo/go/net/sockoptip_windows.go')
-rw-r--r-- | libgo/go/net/sockoptip_windows.go | 12 |
1 files changed, 9 insertions, 3 deletions
diff --git a/libgo/go/net/sockoptip_windows.go b/libgo/go/net/sockoptip_windows.go index a8a9d1c2bfb..b9db3334d5f 100644 --- a/libgo/go/net/sockoptip_windows.go +++ b/libgo/go/net/sockoptip_windows.go @@ -23,7 +23,9 @@ func setIPv4MulticastInterface(fd *netFD, ifi *Interface) error { } var x [4]byte copy(x[:], ip.To4()) - fd.incref() + if err := fd.incref(false); err != nil { + return err + } defer fd.decref() err = syscall.SetsockoptInet4Addr(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_IF, x) if err != nil { @@ -38,7 +40,9 @@ func ipv4MulticastTTL(fd *netFD) (int, error) { } func setIPv4MulticastTTL(fd *netFD, v int) error { - fd.incref() + if err := fd.incref(false); err != nil { + return err + } defer fd.decref() err := syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_TTL, v) if err != nil { @@ -54,7 +58,9 @@ func ipv4MulticastLoopback(fd *netFD) (bool, error) { } func setIPv4MulticastLoopback(fd *netFD, v bool) error { - fd.incref() + if err := fd.incref(false); err != nil { + return err + } defer fd.decref() err := syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_LOOP, boolint(v)) if err != nil { |