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
24877817
Commit
24877817
authored
Jul 22, 2013
by
Mikio Hara
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
go.net/ipv4: remove unnecessary bit masking
R=dave CC=golang-dev
https://golang.org/cl/11666044
parent
46c4a49e
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
3 additions
and
3 deletions
+3
-3
mockicmp_test.go
ipv4/mockicmp_test.go
+3
-3
No files found.
ipv4/mockicmp_test.go
View file @
24877817
...
...
@@ -49,7 +49,7 @@ func (m *icmpMessage) Marshal() ([]byte, error) {
s
=
s
+
s
>>
16
// Place checksum back in header; using ^= avoids the
// assumption the checksum bytes are zero.
b
[
2
]
^=
byte
(
^
s
&
0xff
)
b
[
2
]
^=
byte
(
^
s
)
b
[
3
]
^=
byte
(
^
s
>>
8
)
return
b
,
nil
}
...
...
@@ -92,8 +92,8 @@ func (p *icmpEcho) Len() int {
// reply message body p.
func
(
p
*
icmpEcho
)
Marshal
()
([]
byte
,
error
)
{
b
:=
make
([]
byte
,
4
+
len
(
p
.
Data
))
b
[
0
],
b
[
1
]
=
byte
(
p
.
ID
>>
8
),
byte
(
p
.
ID
&
0xff
)
b
[
2
],
b
[
3
]
=
byte
(
p
.
Seq
>>
8
),
byte
(
p
.
Seq
&
0xff
)
b
[
0
],
b
[
1
]
=
byte
(
p
.
ID
>>
8
),
byte
(
p
.
ID
)
b
[
2
],
b
[
3
]
=
byte
(
p
.
Seq
>>
8
),
byte
(
p
.
Seq
)
copy
(
b
[
4
:
],
p
.
Data
)
return
b
,
nil
}
...
...
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