This is an automated email from the ASF dual-hosted git repository.

xiaoxiang pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/nuttx-apps.git


The following commit(s) were added to refs/heads/master by this push:
     new 5f634815c iptables: fix the ipv4 mask conversion error
5f634815c is described below

commit 5f634815cb8b6fef16f7be5615a786efc4861370
Author: zhanghongyu <[email protected]>
AuthorDate: Tue Aug 5 10:57:55 2025 +0800

    iptables: fix the ipv4 mask conversion error
    
    the configured mask should be in network byte order, but the logic here
    calculates it as host byte order.
    
    Signed-off-by: zhanghongyu <[email protected]>
---
 system/iptables/iptables_utils.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/system/iptables/iptables_utils.c b/system/iptables/iptables_utils.c
index 9428e0fea..86c1492de 100644
--- a/system/iptables/iptables_utils.c
+++ b/system/iptables/iptables_utils.c
@@ -546,7 +546,7 @@ int iptables_parse_ip(FAR const char *str, FAR void *addr, 
FAR void *mask,
               return -EINVAL;
             }
 
-          *mask4 <<= 32 - prefixlen;
+          *mask4 >>= 32 - prefixlen;
         }
 #endif
 

Reply via email to