mirror of
https://github.com/apache/nuttx.git
synced 2026-08-01 20:28:58 +00: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:
parent
39639282d1
commit
244ddfcc2c
1 changed files with 2 additions and 2 deletions
|
|
@ -251,7 +251,7 @@ convert_ipv4entry(FAR const struct ipt_entry *entry)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IPPROTO_UDP:
|
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);
|
FAR struct xt_udp *udp = (FAR struct xt_udp *)(match + 1);
|
||||||
convert_tcpudp(&filter->common, udp->spts, udp->dpts,
|
convert_tcpudp(&filter->common, udp->spts, udp->dpts,
|
||||||
|
|
@ -326,7 +326,7 @@ convert_ipv6entry(FAR const struct ip6t_entry *entry)
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case IPPROTO_UDP:
|
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);
|
FAR struct xt_udp *udp = (FAR struct xt_udp *)(match + 1);
|
||||||
convert_tcpudp(&filter->common, udp->spts, udp->dpts,
|
convert_tcpudp(&filter->common, udp->spts, udp->dpts,
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue