Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(83)

Delta Between Two Patch Sets: src/pkg/net/sockoptip_linux.go

Issue 12418043: code review 12418043: net: add special netFD mutex (Closed)
Left Patch Set: diff -r 50c9f3544eed https://go.googlecode.com/hg/ Created 11 years, 7 months ago
Right Patch Set: diff -r 5a51d54e34bb https://dvyukov%40google.com@code.google.com/p/go/ Created 11 years, 7 months ago
Left:
Right:
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
Right: Side by side diff | Download
« no previous file with change/comment | « src/pkg/net/sockoptip_bsd.go ('k') | src/pkg/net/sockoptip_posix.go » ('j') | no next file with change/comment »
Toggle Intra-line Diffs ('i') | Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
LEFTRIGHT
(no file at all)
1 // Copyright 2011 The Go Authors. All rights reserved. 1 // Copyright 2011 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style 2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file. 3 // license that can be found in the LICENSE file.
4 4
5 package net 5 package net
6 6
7 import ( 7 import (
8 "os" 8 "os"
9 "syscall" 9 "syscall"
10 ) 10 )
11 11
12 func setIPv4MulticastInterface(fd *netFD, ifi *Interface) error { 12 func setIPv4MulticastInterface(fd *netFD, ifi *Interface) error {
13 var v int32 13 var v int32
14 if ifi != nil { 14 if ifi != nil {
15 v = int32(ifi.Index) 15 v = int32(ifi.Index)
16 } 16 }
17 mreq := &syscall.IPMreqn{Ifindex: v} 17 mreq := &syscall.IPMreqn{Ifindex: v}
18 » if err := fd.incref(false); err != nil { 18 » if err := fd.incref(); err != nil {
19 return err 19 return err
20 } 20 }
21 defer fd.decref() 21 defer fd.decref()
22 return os.NewSyscallError("setsockopt", syscall.SetsockoptIPMreqn(fd.sys fd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_IF, mreq)) 22 return os.NewSyscallError("setsockopt", syscall.SetsockoptIPMreqn(fd.sys fd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_IF, mreq))
23 } 23 }
24 24
25 func setIPv4MulticastLoopback(fd *netFD, v bool) error { 25 func setIPv4MulticastLoopback(fd *netFD, v bool) error {
26 » if err := fd.incref(false); err != nil { 26 » if err := fd.incref(); err != nil {
27 return err 27 return err
28 } 28 }
29 defer fd.decref() 29 defer fd.decref()
30 return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_LOOP, boolint(v))) 30 return os.NewSyscallError("setsockopt", syscall.SetsockoptInt(fd.sysfd, syscall.IPPROTO_IP, syscall.IP_MULTICAST_LOOP, boolint(v)))
31 } 31 }
LEFTRIGHT

Powered by Google App Engine
RSS Feeds Recent Issues | This issue
This is Rietveld f62528b