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)
|
else if (filter->icmpopts.enabled)
|
||||||
{
|
{
|
||||||
if (!icmph)
|
if (icmph)
|
||||||
{
|
{
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code.
|
// Code.
|
||||||
if (filter->icmpopts.do_code && filter->icmpopts.code != icmph->code)
|
if (filter->icmpopts.do_code && filter->icmpopts.code != icmph->code)
|
||||||
{
|
{
|
||||||
@@ -580,13 +577,8 @@ int xdp_prog_main(struct xdp_md *ctx)
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
else if (icmp6h && filter->icmpopts.enabled)
|
else if (icmp6h)
|
||||||
{
|
{
|
||||||
if (!icmp6h)
|
|
||||||
{
|
|
||||||
continue;
|
|
||||||
}
|
|
||||||
|
|
||||||
// Code.
|
// Code.
|
||||||
if (filter->icmpopts.do_code && filter->icmpopts.code != icmp6h->icmp6_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;
|
continue;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
{
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
// Matched.
|
// Matched.
|
||||||
#ifdef DEBUG
|
#ifdef DEBUG
|
||||||
|
|||||||
Reference in New Issue
Block a user