net/ipforward: update IP buffer offset

Signed-off-by: chao an <anchao@xiaomi.com>
This commit is contained in:
chao an
2022-12-06 21:57:56 +08:00
committed by Xiang Xiao
parent d6c8c269f5
commit c738da048c
2 changed files with 5 additions and 3 deletions

View File

@@ -167,7 +167,8 @@ void ipfwd_dropstats(FAR struct forward_s *fwd)
if (fwd->f_domain == PF_INET) if (fwd->f_domain == PF_INET)
#endif #endif
{ {
ipv4_dropstats((FAR struct ipv4_hdr_s *)fwd->f_iob->io_data); ipv4_dropstats((FAR struct ipv4_hdr_s *)
&fwd->f_iob->io_data[CONFIG_NET_LL_GUARDSIZE]);
} }
#endif #endif
#ifdef CONFIG_NET_IPv6 #ifdef CONFIG_NET_IPv6
@@ -175,7 +176,8 @@ void ipfwd_dropstats(FAR struct forward_s *fwd)
else else
#endif #endif
{ {
ipv6_dropstats((FAR struct ipv6_hdr_s *)fwd->f_iob->io_data); ipv6_dropstats((FAR struct ipv6_hdr_s *)
&fwd->f_iob->io_data[CONFIG_NET_LL_GUARDSIZE]);
} }
#endif #endif
} }

View File

@@ -408,7 +408,7 @@ static int ipv6_dev_forward(FAR struct net_driver_s *dev,
* TTL decrements to zero, then do not forward the packet. * TTL decrements to zero, then do not forward the packet.
*/ */
ret = ipv6_decr_ttl((FAR struct ipv6_hdr_s *)fwd->f_iob->io_data); ret = ipv6_decr_ttl(ipv6);
if (ret < 1) if (ret < 1)
{ {
nwarn("WARNING: Hop limit exceeded... Dropping!\n"); nwarn("WARNING: Hop limit exceeded... Dropping!\n");