mirror of
https://github.com/apache/nuttx.git
synced 2026-05-09 23:12:17 +08:00
net/netfilter: fix match name for UDP in ipt_filter
In both convert_ipv4entry() and convert_ipv6entry(), the IPPROTO_UDP case was incorrectly comparing against XT_MATCH_NAME_TCP instead of XT_MATCH_NAME_UDP. This caused UDP filter rules to never match. Signed-off-by: zhanghongyu <zhanghongyu@xiaomi.com>
This commit is contained in:
committed by
Alan C. Assis
parent
39639282d1
commit
244ddfcc2c
@@ -251,7 +251,7 @@ convert_ipv4entry(FAR const struct ipt_entry *entry)
|
||||
break;
|
||||
|
||||
case IPPROTO_UDP:
|
||||
if (strcmp(match->u.user.name, XT_MATCH_NAME_TCP) == 0)
|
||||
if (strcmp(match->u.user.name, XT_MATCH_NAME_UDP) == 0)
|
||||
{
|
||||
FAR struct xt_udp *udp = (FAR struct xt_udp *)(match + 1);
|
||||
convert_tcpudp(&filter->common, udp->spts, udp->dpts,
|
||||
@@ -326,7 +326,7 @@ convert_ipv6entry(FAR const struct ip6t_entry *entry)
|
||||
break;
|
||||
|
||||
case IPPROTO_UDP:
|
||||
if (strcmp(match->u.user.name, XT_MATCH_NAME_TCP) == 0)
|
||||
if (strcmp(match->u.user.name, XT_MATCH_NAME_UDP) == 0)
|
||||
{
|
||||
FAR struct xt_udp *udp = (FAR struct xt_udp *)(match + 1);
|
||||
convert_tcpudp(&filter->common, udp->spts, udp->dpts,
|
||||
|
||||
Reference in New Issue
Block a user