Improve ICMP matching.

This commit is contained in:
gamemann
2020-12-18 18:53:10 +00:00
parent cf10bd5696
commit 4420cb2f00

View File

@@ -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