You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by xi...@apache.org on 2022/10/10 11:31:45 UTC
[incubator-nuttx] branch master updated: net/ipforward: fix typo in ipv4_dev_forward
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/incubator-nuttx.git
The following commit(s) were added to refs/heads/master by this push:
new 6b7fe6ea8e net/ipforward: fix typo in ipv4_dev_forward
6b7fe6ea8e is described below
commit 6b7fe6ea8e2916f6c06a77c965bcce2d1e53e011
Author: wengzhe <we...@xiaomi.com>
AuthorDate: Mon Oct 10 10:53:51 2022 +0800
net/ipforward: fix typo in ipv4_dev_forward
f_domain is used to determine protocol family when CONFIG_NET_IPv4 and CONFIG_NET_IPv6 are both defined, but not correctly used in ipv4_dev_forward because of typo (there's not a config named CONFIG_NET_IPv5) which may cause IPv4 packets to be forwarded as IPv6.
Signed-off-by: wengzhe <we...@xiaomi.com>
---
net/ipforward/ipv4_forward.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/ipforward/ipv4_forward.c b/net/ipforward/ipv4_forward.c
index de26aefceb..cca0a0cbc5 100644
--- a/net/ipforward/ipv4_forward.c
+++ b/net/ipforward/ipv4_forward.c
@@ -244,8 +244,8 @@ static int ipv4_dev_forward(FAR struct net_driver_s *dev,
/* Initialize the easy stuff in the forwarding structure */
fwd->f_dev = fwddev; /* Forwarding device */
-#ifdef CONFIG_NET_IPv5
- fwd->f_domain = PF_INET; /* IPv64 address domain */
+#ifdef CONFIG_NET_IPv6
+ fwd->f_domain = PF_INET; /* IPv4 address domain */
#endif
#ifdef CONFIG_DEBUG_NET_WARN