Check that IP headers contain correct version
PiperOrigin-RevId: 257888338
This commit is contained in:
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
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue