summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/header
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2020-03-13 01:43:15 +0000
committergVisor bot <gvisor-bot@google.com>2020-03-13 01:43:15 +0000
commit37e789e87f644506503548b039ffbd6c8b52d2cf (patch)
treeaa31e9fbb85d0cd940111796f9a7282c1c4fe908 /pkg/tcpip/header
parentbde75c795a8a66bedc6e962d5f15c786e065f61a (diff)
parentf693e1334b6fd0bea26fad770dfec3aa7e03c59a (diff)
Merge release-20200219.0-160-gf693e13 (automated)
Diffstat (limited to 'pkg/tcpip/header')
-rw-r--r--pkg/tcpip/header/ipv4.go5
1 files changed, 3 insertions, 2 deletions
diff --git a/pkg/tcpip/header/ipv4.go b/pkg/tcpip/header/ipv4.go
index e5360e7c1..76839eb92 100644
--- a/pkg/tcpip/header/ipv4.go
+++ b/pkg/tcpip/header/ipv4.go
@@ -38,7 +38,8 @@ const (
// IPv4Fields contains the fields of an IPv4 packet. It is used to describe the
// fields of a packet that needs to be encoded.
type IPv4Fields struct {
- // IHL is the "internet header length" field of an IPv4 packet.
+ // IHL is the "internet header length" field of an IPv4 packet. The value
+ // is in bytes.
IHL uint8
// TOS is the "type of service" field of an IPv4 packet.
@@ -138,7 +139,7 @@ func IPVersion(b []byte) int {
}
// HeaderLength returns the value of the "header length" field of the ipv4
-// header.
+// header. The length returned is in bytes.
func (b IPv4) HeaderLength() uint8 {
return (b[versIHL] & 0xf) * 4
}