Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
G
golang
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Commits
Issue Boards
Open sidebar
go
golang
Commits
12104807
Commit
12104807
authored
May 22, 2011
by
Mikio Hara
Committed by
Brad Fitzpatrick
May 22, 2011
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
syscall: add IPv6 scope zone ID support
R=golang-dev, bradfitz CC=golang-dev
https://golang.org/cl/4515124
parent
8c6dc5fe
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
15 additions
and
8 deletions
+15
-8
syscall_bsd.go
src/pkg/syscall/syscall_bsd.go
+6
-3
syscall_linux.go
src/pkg/syscall/syscall_linux.go
+6
-3
syscall_windows.go
src/pkg/syscall/syscall_windows.go
+3
-2
No files found.
src/pkg/syscall/syscall_bsd.go
View file @
12104807
...
...
@@ -191,9 +191,10 @@ func (sa *SockaddrInet4) sockaddr() (uintptr, _Socklen, int) {
}
type
SockaddrInet6
struct
{
Port
int
Addr
[
16
]
byte
raw
RawSockaddrInet6
Port
int
ZoneId
uint32
Addr
[
16
]
byte
raw
RawSockaddrInet6
}
func
(
sa
*
SockaddrInet6
)
sockaddr
()
(
uintptr
,
_Socklen
,
int
)
{
...
...
@@ -205,6 +206,7 @@ func (sa *SockaddrInet6) sockaddr() (uintptr, _Socklen, int) {
p
:=
(
*
[
2
]
byte
)(
unsafe
.
Pointer
(
&
sa
.
raw
.
Port
))
p
[
0
]
=
byte
(
sa
.
Port
>>
8
)
p
[
1
]
=
byte
(
sa
.
Port
)
sa
.
raw
.
Scope_id
=
sa
.
ZoneId
for
i
:=
0
;
i
<
len
(
sa
.
Addr
);
i
++
{
sa
.
raw
.
Addr
[
i
]
=
sa
.
Addr
[
i
]
}
...
...
@@ -297,6 +299,7 @@ func anyToSockaddr(rsa *RawSockaddrAny) (Sockaddr, int) {
sa
:=
new
(
SockaddrInet6
)
p
:=
(
*
[
2
]
byte
)(
unsafe
.
Pointer
(
&
pp
.
Port
))
sa
.
Port
=
int
(
p
[
0
])
<<
8
+
int
(
p
[
1
])
sa
.
ZoneId
=
pp
.
Scope_id
for
i
:=
0
;
i
<
len
(
sa
.
Addr
);
i
++
{
sa
.
Addr
[
i
]
=
pp
.
Addr
[
i
]
}
...
...
src/pkg/syscall/syscall_linux.go
View file @
12104807
...
...
@@ -219,9 +219,10 @@ func (sa *SockaddrInet4) sockaddr() (uintptr, _Socklen, int) {
}
type
SockaddrInet6
struct
{
Port
int
Addr
[
16
]
byte
raw
RawSockaddrInet6
Port
int
ZoneId
uint32
Addr
[
16
]
byte
raw
RawSockaddrInet6
}
func
(
sa
*
SockaddrInet6
)
sockaddr
()
(
uintptr
,
_Socklen
,
int
)
{
...
...
@@ -232,6 +233,7 @@ func (sa *SockaddrInet6) sockaddr() (uintptr, _Socklen, int) {
p
:=
(
*
[
2
]
byte
)(
unsafe
.
Pointer
(
&
sa
.
raw
.
Port
))
p
[
0
]
=
byte
(
sa
.
Port
>>
8
)
p
[
1
]
=
byte
(
sa
.
Port
)
sa
.
raw
.
Scope_id
=
sa
.
ZoneId
for
i
:=
0
;
i
<
len
(
sa
.
Addr
);
i
++
{
sa
.
raw
.
Addr
[
i
]
=
sa
.
Addr
[
i
]
}
...
...
@@ -370,6 +372,7 @@ func anyToSockaddr(rsa *RawSockaddrAny) (Sockaddr, int) {
sa
:=
new
(
SockaddrInet6
)
p
:=
(
*
[
2
]
byte
)(
unsafe
.
Pointer
(
&
pp
.
Port
))
sa
.
Port
=
int
(
p
[
0
])
<<
8
+
int
(
p
[
1
])
sa
.
ZoneId
=
pp
.
Scope_id
for
i
:=
0
;
i
<
len
(
sa
.
Addr
);
i
++
{
sa
.
Addr
[
i
]
=
pp
.
Addr
[
i
]
}
...
...
src/pkg/syscall/syscall_windows.go
View file @
12104807
...
...
@@ -536,8 +536,9 @@ func (sa *SockaddrInet4) sockaddr() (uintptr, int32, int) {
}
type
SockaddrInet6
struct
{
Port
int
Addr
[
16
]
byte
Port
int
ZoneId
uint32
Addr
[
16
]
byte
}
func
(
sa
*
SockaddrInet6
)
sockaddr
()
(
uintptr
,
int32
,
int
)
{
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment