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

Delta Between Two Patch Sets: ipv4/sockopt_mreqn.go

Issue 97800043: code review 97800043: go.net/ipv4: add support for dragonfly (Closed)
Left Patch Set: diff -r f3fd9e904a78 https://code.google.com/p/go.net Created 9 years, 10 months ago
Right Patch Set: diff -r 9c33002573cb https://code.google.com/p/go.net Created 9 years, 10 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 | « ipv4/sockopt_mreq.go ('k') | ipv4/sockopt_nonpktinfo.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 2014 The Go Authors. All rights reserved.
2 // Use of this source code is governed by a BSD-style
3 // license that can be found in the LICENSE file.
4
5 // +build freebsd linux
6
7 package ipv4
8
9 import (
10 "net"
11 "os"
12 "syscall"
13 )
14
15 func joinIPv4Group(fd int, ifi *net.Interface, grp net.IP) error {
16 mreqn := syscall.IPMreqn{Multiaddr: [4]byte{grp[0], grp[1], grp[2], grp[ 3]}}
17 if ifi != nil {
18 mreqn.Ifindex = int32(ifi.Index)
19 }
20 return os.NewSyscallError("setsockopt", syscall.SetsockoptIPMreqn(fd, ia naProtocolIP, sysSockoptJoinGroup, &mreqn))
21 }
22
23 func leaveIPv4Group(fd int, ifi *net.Interface, grp net.IP) error {
24 mreqn := syscall.IPMreqn{Multiaddr: [4]byte{grp[0], grp[1], grp[2], grp[ 3]}}
25 if ifi != nil {
26 mreqn.Ifindex = int32(ifi.Index)
27 }
28 return os.NewSyscallError("setsockopt", syscall.SetsockoptIPMreqn(fd, ia naProtocolIP, sysSockoptLeaveGroup, &mreqn))
29 }
LEFTRIGHT

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