diff options
author | Mikio Hara <mikioh.mikioh@gmail.com> | 2014-11-11 06:57:22 +0900 |
---|---|---|
committer | Mikio Hara <mikioh.mikioh@gmail.com> | 2014-11-11 06:57:22 +0900 |
commit | 3064e1c1ca42eea4ab594caa2bf440f367c9e1f5 (patch) | |
tree | ccc50c4ba3813e57aad28268667ef11471ef4192 /ipv4 | |
parent | 5af45f3924d33914f7e990eb68c514fea2378265 (diff) | |
download | net-3064e1c1ca42eea4ab594caa2bf440f367c9e1f5.tar.gz |
x/net/ipv4: better wording for TODOs
LGTM=iant
R=iant
CC=golang-codereviews
https://golang.org/cl/167450043
Diffstat (limited to 'ipv4')
-rw-r--r-- | ipv4/header.go | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/ipv4/header.go b/ipv4/header.go index 58b131c..2919607 100644 --- a/ipv4/header.go +++ b/ipv4/header.go @@ -100,7 +100,7 @@ func (h *Header) Marshal() ([]byte, error) { b[posTotalLen], b[posTotalLen+1] = byte(h.TotalLen>>8), byte(h.TotalLen) b[posFragOff], b[posFragOff+1] = byte(flagsAndFragOff>>8), byte(flagsAndFragOff) } else { - // TODO(mikio): fix spurious word boundary access + // TODO(mikio): fix potential misaligned memory access *(*uint16)(unsafe.Pointer(&b[posTotalLen : posTotalLen+1][0])) = uint16(h.TotalLen) *(*uint16)(unsafe.Pointer(&b[posFragOff : posFragOff+1][0])) = uint16(flagsAndFragOff) } @@ -142,12 +142,12 @@ func ParseHeader(b []byte) (*Header, error) { h.TotalLen = int(b[posTotalLen])<<8 | int(b[posTotalLen+1]) h.FragOff = int(b[posFragOff])<<8 | int(b[posFragOff+1]) } else { - // TODO(mikio): fix spurious word boundary access + // TODO(mikio): fix potential misaligned memory access h.TotalLen = int(*(*uint16)(unsafe.Pointer(&b[posTotalLen : posTotalLen+1][0]))) if runtime.GOOS != "freebsd" || freebsdVersion < 1000000 { h.TotalLen += hdrlen } - // TODO(mikio): fix spurious word boundary access + // TODO(mikio): fix potential misaligned memory access h.FragOff = int(*(*uint16)(unsafe.Pointer(&b[posFragOff : posFragOff+1][0]))) } h.Flags = HeaderFlags(h.FragOff&0xe000) >> 13 |