Code review - Issue 4119053: code review 4119053: syscall: add SetsockoptIpMreqhttps://codereview.appspot.com/2011-02-03T19:15:37+00:00rietveld
Message from unknown
2011-02-02T23:59:45+00:00dfcurn:md5:df001cbded2a913e1efdbe3799dacfb3
Message from unknown
2011-02-03T12:10:42+00:00dfcurn:md5:11014b0d1f99e81ab60999696cf181cf
Message from dave@cheney.net
2011-02-03T12:10:54+00:00dfcurn:md5:fd2bf3e7f2ec9cdbb46ace6855b62ca4
Hello rsc (cc: golang-dev@googlegroups.com),
I'd like you to review this change.
Message from mikioh.mikioh@gmail.com
2011-02-03T16:26:49+00:00mikiourn:md5:c7e33d5e27abb69c231b571dee0c56db
Hi,
Today IANA announced that no unicast IPv4/8s remain unallocated.
So I'd like to go IPv4/IPv6 instead of IP/IPv6.
http://codereview.appspot.com/4119053/diff/2001/src/pkg/syscall/syscall_bsd.go
File src/pkg/syscall/syscall_bsd.go (right):
http://codereview.appspot.com/4119053/diff/2001/src/pkg/syscall/syscall_bsd.go#newcode346
src/pkg/syscall/syscall_bsd.go:346: func SetsockoptIpMreq(fd, level, opt int, mreq *IpMreq) (errno int) {
To avoid naming confusion I'd suggest SetsockoptIPv4Mreq instead of SetsockoptIpMreq.
http://codereview.appspot.com/4119053/diff/2001/src/pkg/syscall/types_darwin.c
File src/pkg/syscall/types_darwin.c (right):
http://codereview.appspot.com/4119053/diff/2001/src/pkg/syscall/types_darwin.c#newcode107
src/pkg/syscall/types_darwin.c:107: typedef struct ip_mreq $IpMreq;
To avoid naming confusion I'd suggest IPv4Mreq instead of IPMreq.
http://codereview.appspot.com/4119053/diff/2001/src/pkg/syscall/types_darwin.c#newcode117
src/pkg/syscall/types_darwin.c:117: $SizeofIpMreq = sizeof(struct ip_mreq),
To avoid naming confusion I'd suggest SizeofIPv4Mreq instead of SizeofIpMreq.
Message from rsc@golang.org
2011-02-03T18:29:33+00:00rscurn:md5:d92a2ac5bdc7c60a2c16c1ab353b6a3e
LGTM
I understand mikioh's concern, but an even more important
one is that the types in syscall mirror the host OS types.
When OS X renames ip_mreq to ipv4_mreq then we can
do the same.
Russ
Message from rsc@golang.org
2011-02-03T19:15:37+00:00rscurn:md5:129e1b2463c4f5684d8b6d654f928aeb
*** Submitted as 7f8ffd20a14d ***
syscall: add SetsockoptIpMreq
notes:
* due to Issue 1466 the Msghdr struct for
src/pkg/syscall/ztypes_darwin_386.go
src/pkg/syscall/ztypes_darwin_amd64.go
had to be edited after the godefs generation.
* ztypes_*.go files for linux, freebsd and darwin
have been prepared on the correct host OS and ARCH.
While the total increase is a dozen lines per file
the diff is larger due to a change to godefs,
http://code.google.com/p/go/source/detail?r=c79e30afe9c8
while has altered the names of Pad members which
causes gofmt to realign the affected structs
R=rsc, mikioh
CC=golang-dev
http://codereview.appspot.com/4119053
Committer: Russ Cox <rsc@golang.org>