Check that IP headers contain correct version

PiperOrigin-RevId: 257888338
This commit is contained in:
Tamir Duberstein 2019-07-12 16:17:18 -07:00 committed by gVisor bot
parent c8ae00eb8a
commit 17bab652af
2 changed files with 8 additions and 0 deletions

View File

@ -272,6 +272,10 @@ func (b IPv4) IsValid(pktSize int) bool {
return false
}
if IPVersion(b) != IPv4Version {
return false
}
return true
}

View File

@ -184,6 +184,10 @@ func (b IPv6) IsValid(pktSize int) bool {
return false
}
if IPVersion(b) != IPv6Version {
return false
}
return true
}