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:
zhanghongyu
2026-04-13 14:36:25 +08:00
committed by Alan C. Assis
parent 39639282d1
commit 244ddfcc2c
+2 -2
View File
@@ -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,