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
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
7 additions
and
0 deletions
+7
-0
syscall_bsd.go
src/pkg/syscall/syscall_bsd.go
+3
-0
syscall_linux.go
src/pkg/syscall/syscall_linux.go
+3
-0
syscall_windows.go
src/pkg/syscall/syscall_windows.go
+1
-0
No files found.
src/pkg/syscall/syscall_bsd.go
View file @
12104807
...
...
@@ -192,6 +192,7 @@ func (sa *SockaddrInet4) sockaddr() (uintptr, _Socklen, int) {
type
SockaddrInet6
struct
{
Port
int
ZoneId
uint32
Addr
[
16
]
byte
raw
RawSockaddrInet6
}
...
...
@@ -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
...
...
@@ -220,6 +220,7 @@ func (sa *SockaddrInet4) sockaddr() (uintptr, _Socklen, int) {
type
SockaddrInet6
struct
{
Port
int
ZoneId
uint32
Addr
[
16
]
byte
raw
RawSockaddrInet6
}
...
...
@@ -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
...
...
@@ -537,6 +537,7 @@ func (sa *SockaddrInet4) sockaddr() (uintptr, int32, int) {
type
SockaddrInet6
struct
{
Port
int
ZoneId
uint32
Addr
[
16
]
byte
}
...
...
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