summaryrefslogtreecommitdiffhomepage
path: root/pkg/tcpip/header
diff options
context:
space:
mode:
authorgVisor bot <gvisor-bot@google.com>2019-07-13 01:17:01 +0000
committergVisor bot <gvisor-bot@google.com>2019-07-13 01:17:01 +0000
commit5ae571182025283ed8272a3e5456d795f4ef0c80 (patch)
tree64d43beec76fe84277ed4d0d47f61a3936be0da8 /pkg/tcpip/header
parente9e36c40dfab1748fed1ef18270540133c91ee24 (diff)
parent9b4d3280e172063a6563d9e72a75b500442ed9b9 (diff)
Merge 9b4d3280 (automated)
Diffstat (limited to 'pkg/tcpip/header')
-rw-r--r--pkg/tcpip/header/ipv4.go4
-rw-r--r--pkg/tcpip/header/ipv6.go4
2 files changed, 8 insertions, 0 deletions
diff --git a/pkg/tcpip/header/ipv4.go b/pkg/tcpip/header/ipv4.go
index 7b8034de4..94a3af289 100644
--- a/pkg/tcpip/header/ipv4.go
+++ b/pkg/tcpip/header/ipv4.go
@@ -272,6 +272,10 @@ func (b IPv4) IsValid(pktSize int) bool {
return false
}
+ if IPVersion(b) != IPv4Version {
+ return false
+ }
+
return true
}
diff --git a/pkg/tcpip/header/ipv6.go b/pkg/tcpip/header/ipv6.go
index 7163eaa36..95fe8bfc3 100644
--- a/pkg/tcpip/header/ipv6.go
+++ b/pkg/tcpip/header/ipv6.go
@@ -184,6 +184,10 @@ func (b IPv6) IsValid(pktSize int) bool {
return false
}
+ if IPVersion(b) != IPv6Version {
+ return false
+ }
+
return true
}