Skip to content
Projects
Groups
Snippets
Help
Loading...
Sign in
Toggle navigation
N
net
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
net
Commits
3064e1c1
Commit
3064e1c1
authored
Nov 10, 2014
by
Mikio Hara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
x/net/ipv4: better wording for TODOs
LGTM=iant R=iant CC=golang-codereviews
https://golang.org/cl/167450043
parent
5af45f39
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
header.go
ipv4/header.go
+3
-3
No files found.
ipv4/header.go
View file @
3064e1c1
...
@@ -100,7 +100,7 @@ func (h *Header) Marshal() ([]byte, error) {
...
@@ -100,7 +100,7 @@ func (h *Header) Marshal() ([]byte, error) {
b
[
posTotalLen
],
b
[
posTotalLen
+
1
]
=
byte
(
h
.
TotalLen
>>
8
),
byte
(
h
.
TotalLen
)
b
[
posTotalLen
],
b
[
posTotalLen
+
1
]
=
byte
(
h
.
TotalLen
>>
8
),
byte
(
h
.
TotalLen
)
b
[
posFragOff
],
b
[
posFragOff
+
1
]
=
byte
(
flagsAndFragOff
>>
8
),
byte
(
flagsAndFragOff
)
b
[
posFragOff
],
b
[
posFragOff
+
1
]
=
byte
(
flagsAndFragOff
>>
8
),
byte
(
flagsAndFragOff
)
}
else
{
}
else
{
// TODO(mikio): fix
spurious word bounda
ry access
// TODO(mikio): fix
potential misaligned memo
ry access
*
(
*
uint16
)(
unsafe
.
Pointer
(
&
b
[
posTotalLen
:
posTotalLen
+
1
][
0
]))
=
uint16
(
h
.
TotalLen
)
*
(
*
uint16
)(
unsafe
.
Pointer
(
&
b
[
posTotalLen
:
posTotalLen
+
1
][
0
]))
=
uint16
(
h
.
TotalLen
)
*
(
*
uint16
)(
unsafe
.
Pointer
(
&
b
[
posFragOff
:
posFragOff
+
1
][
0
]))
=
uint16
(
flagsAndFragOff
)
*
(
*
uint16
)(
unsafe
.
Pointer
(
&
b
[
posFragOff
:
posFragOff
+
1
][
0
]))
=
uint16
(
flagsAndFragOff
)
}
}
...
@@ -142,12 +142,12 @@ func ParseHeader(b []byte) (*Header, error) {
...
@@ -142,12 +142,12 @@ func ParseHeader(b []byte) (*Header, error) {
h
.
TotalLen
=
int
(
b
[
posTotalLen
])
<<
8
|
int
(
b
[
posTotalLen
+
1
])
h
.
TotalLen
=
int
(
b
[
posTotalLen
])
<<
8
|
int
(
b
[
posTotalLen
+
1
])
h
.
FragOff
=
int
(
b
[
posFragOff
])
<<
8
|
int
(
b
[
posFragOff
+
1
])
h
.
FragOff
=
int
(
b
[
posFragOff
])
<<
8
|
int
(
b
[
posFragOff
+
1
])
}
else
{
}
else
{
// TODO(mikio): fix
spurious word bounda
ry access
// TODO(mikio): fix
potential misaligned memo
ry access
h
.
TotalLen
=
int
(
*
(
*
uint16
)(
unsafe
.
Pointer
(
&
b
[
posTotalLen
:
posTotalLen
+
1
][
0
])))
h
.
TotalLen
=
int
(
*
(
*
uint16
)(
unsafe
.
Pointer
(
&
b
[
posTotalLen
:
posTotalLen
+
1
][
0
])))
if
runtime
.
GOOS
!=
"freebsd"
||
freebsdVersion
<
1000000
{
if
runtime
.
GOOS
!=
"freebsd"
||
freebsdVersion
<
1000000
{
h
.
TotalLen
+=
hdrlen
h
.
TotalLen
+=
hdrlen
}
}
// TODO(mikio): fix
spurious word bounda
ry access
// TODO(mikio): fix
potential misaligned memo
ry access
h
.
FragOff
=
int
(
*
(
*
uint16
)(
unsafe
.
Pointer
(
&
b
[
posFragOff
:
posFragOff
+
1
][
0
])))
h
.
FragOff
=
int
(
*
(
*
uint16
)(
unsafe
.
Pointer
(
&
b
[
posFragOff
:
posFragOff
+
1
][
0
])))
}
}
h
.
Flags
=
HeaderFlags
(
h
.
FragOff
&
0xe000
)
>>
13
h
.
Flags
=
HeaderFlags
(
h
.
FragOff
&
0xe000
)
>>
13
...
...
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