From 6b7fe6ea8e2916f6c06a77c965bcce2d1e53e011 Mon Sep 17 00:00:00 2001 From: wengzhe Date: Mon, 10 Oct 2022 10:53:51 +0800 Subject: [PATCH] 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 --- 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