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

Issue 7449046: code review 7449046: syscall: handle getsockname for unix sockets on openbsd 5.2 (Closed)

Can't Edit
Can't Publish+Mail
Start Review
Created:
12 years ago by jsing
Modified:
12 years ago
Reviewers:
CC:
golang-dev, minux1, rsc, mikio
Visibility:
Public.

Description

syscall: handle getsockname for unix sockets on openbsd 5.2 On OpenBSD 5.2, calling getsockname on an unbound Unix domain socket results in a successful syscall, however the AF is unset and the length is returned as zero. This has been changed to more portable behaviour, which will be included in the OpenBSD 5.3 release. For now, work around this by treating a successful getsockname() call that returns a family of AF_UNSPEC and length of zero as a AF_UNIX socket. Makes TestPassFD work on OpenBSD 5.2. Fixes issue 4956.

Patch Set 1 #

Patch Set 2 : diff -r e87718bbdf73 https://go.googlecode.com/hg/ #

Patch Set 3 : diff -r e87718bbdf73 https://go.googlecode.com/hg/ #

Total comments: 1

Patch Set 4 : diff -r db1736b03009 https://go.googlecode.com/hg/ #

Patch Set 5 : diff -r db1736b03009 https://go.googlecode.com/hg/ #

Unified diffs Side-by-side diffs Delta from patch set Stats (+5 lines, -4 lines) Patch
M src/pkg/syscall/passfd_test.go View 1 2 3 2 chunks +0 lines, -4 lines 0 comments Download
M src/pkg/syscall/syscall_bsd.go View 1 2 3 1 chunk +5 lines, -0 lines 0 comments Download

Messages

Total messages: 8
jsing
Hello golang-dev@googlegroups.com, I'd like you to review this change to https://go.googlecode.com/hg/
12 years ago (2013-03-01 15:20:10 UTC) #1
minux1
Fixes issue 4956.
12 years ago (2013-03-01 15:28:21 UTC) #2
jsing
On 2013/03/01 15:28:21, minux wrote: > Fixes issue 4956. Heh. New issues appearing while working ...
12 years ago (2013-03-01 15:31:52 UTC) #3
minux1
Is this "bug" documented anywhere? I couldn't find at http://www.openbsd.org/plus.html. On my OpenBSD/amd64 5.2 VM, ...
12 years ago (2013-03-01 15:45:47 UTC) #4
rsc
LGTM Please edit the test to re-enable it, and add to this CL before submitting.
12 years ago (2013-03-01 21:49:47 UTC) #5
mikio
LGTM https://codereview.appspot.com/7449046/diff/5001/src/pkg/syscall/syscall_bsd.go File src/pkg/syscall/syscall_bsd.go (right): https://codereview.appspot.com/7449046/diff/5001/src/pkg/syscall/syscall_bsd.go#newcode331 src/pkg/syscall/syscall_bsd.go:331: if runtime.GOOS == "openbsd" && rsa.Addr.Family == 0 ...
12 years ago (2013-03-01 23:52:19 UTC) #6
jsing
On 2013/03/01 15:45:47, minux wrote: > Is this "bug" documented anywhere? > I couldn't find ...
12 years ago (2013-03-05 10:39:50 UTC) #7
jsing
12 years ago (2013-03-05 10:40:46 UTC) #8
*** Submitted as https://code.google.com/p/go/source/detail?r=84a41a2c376b ***

syscall: handle getsockname for unix sockets on openbsd 5.2

On OpenBSD 5.2, calling getsockname on an unbound Unix domain socket
results in a successful syscall, however the AF is unset and the length
is returned as zero. This has been changed to more portable behaviour,
which will be included in the OpenBSD 5.3 release.

For now, work around this by treating a successful getsockname() call
that returns a family of AF_UNSPEC and length of zero as a AF_UNIX
socket.

Makes TestPassFD work on OpenBSD 5.2.

Fixes issue 4956.

R=golang-dev, minux.ma, rsc, mikioh.mikioh
CC=golang-dev
https://codereview.appspot.com/7449046
Sign in to reply to this message.

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