mirror of
https://github.com/netbirdio/gvisor.git
synced 2026-05-22 17:12:49 -07:00
Check that IP headers contain correct version
PiperOrigin-RevId: 257888338
This commit is contained in:
committed by
gVisor bot
parent
c8ae00eb8a
commit
17bab652af
@@ -272,6 +272,10 @@ func (b IPv4) IsValid(pktSize int) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
if IPVersion(b) != IPv4Version {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
@@ -184,6 +184,10 @@ func (b IPv6) IsValid(pktSize int) bool {
|
||||
return false
|
||||
}
|
||||
|
||||
if IPVersion(b) != IPv6Version {
|
||||
return false
|
||||
}
|
||||
|
||||
return true
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user