Improve ICMP matching.
This commit is contained in:
@@ -563,11 +563,8 @@ int xdp_prog_main(struct xdp_md *ctx)
|
||||
}
|
||||
else if (filter->icmpopts.enabled)
|
||||
{
|
||||
if (!icmph)
|
||||
if (icmph)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Code.
|
||||
if (filter->icmpopts.do_code && filter->icmpopts.code != icmph->code)
|
||||
{
|
||||
@@ -580,13 +577,8 @@ int xdp_prog_main(struct xdp_md *ctx)
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else if (icmp6h && filter->icmpopts.enabled)
|
||||
else if (icmp6h)
|
||||
{
|
||||
if (!icmp6h)
|
||||
{
|
||||
continue;
|
||||
}
|
||||
|
||||
// Code.
|
||||
if (filter->icmpopts.do_code && filter->icmpopts.code != icmp6h->icmp6_code)
|
||||
{
|
||||
@@ -599,6 +591,11 @@ int xdp_prog_main(struct xdp_md *ctx)
|
||||
continue;
|
||||
}
|
||||
}
|
||||
else
|
||||
{
|
||||
continue;
|
||||
}
|
||||
}
|
||||
|
||||
// Matched.
|
||||
#ifdef DEBUG
|
||||
|
||||
Reference in New Issue
Block a user