zephyr/subsys/net/ip
Shrek Wang 0b24b960fe net: Add onlink and forwarding check to IPv6-prepare
Deadloop happens when CONFIG_NET_ROUTING and VLAN are enabled.
In function net_ipv6_prepare_for_send(), pkt->iface will be
updated with net_pkt_set_iface(pkt, iface) in 2 scenarios:
1. ip_hdr->dst is onlink
2. check_route or nbr_lookup
VLAN is virtual-iface which attaches to a physical-iface. Each
time a packet being sent to a VLAN port will invoke twice of
the net_send_data(). The 1st time, pkt->iface is set to virtual
iface and the 2nd time to physical iface.
However in above 2 scenarios, at the 2nd time of calling the
net_send_data(), the pkt-iface will be changed back to virtual
iface. The system runs into a deadloop. This can be proved by
enabling CONFIG_NET_ROUTING with the VLAN sample.
The main purpose for net_ipv6_prepare_for_send() is to set the
right ll_dst address. If the ll_dst address is already set, then
no need to go through it again. If the packet has done with the
forwarding and set the ll_dst, then no need to check_route again.
And, the pkt->iface will not be changed back to virtual iface.

Fixes: #77402

Signed-off-by: Shrek Wang <shrek.wang@nxp.com>
2024-09-17 20:11:32 -04:00
..
6lo_private.h
6lo.c
6lo.h
canbus_socket.c
canbus_socket.h
CMakeLists.txt
connection.c
connection.h
icmp.c
icmpv4.c
icmpv4.h
icmpv6.c
icmpv6.h
igmp.c
ipv4_acd.c
ipv4_autoconf.c
ipv4_fragment.c
ipv4.c
ipv4.h
ipv6_fragment.c
ipv6_mld.c
ipv6_nbr.c net: Add onlink and forwarding check to IPv6-prepare 2024-09-17 20:11:32 -04:00
ipv6_pe.c
ipv6.c net: ipv6: Allow incoming DAD NS message 2024-08-26 11:07:59 -04:00
ipv6.h
Kconfig
Kconfig.debug
Kconfig.ipv4
Kconfig.ipv6
Kconfig.mgmt
Kconfig.stack
Kconfig.stats
Kconfig.tcp
nbr.c
nbr.h
net_context.c net: context: Set IPv4 address properly for sendmsg() 2024-09-17 05:22:48 -04:00
net_core.c
net_if.c net: iface: Add missing interface mutex locks 2024-09-17 17:45:34 +01:00
net_mgmt.c
net_pkt.c lib: net_buf: rename header file from zephyr/net/buf.h to zephyr/net_buf.h 2024-09-07 11:19:05 -05:00
net_private.h
net_stats.c
net_stats.h
net_tc_mapping.h
net_tc.c
net_timeout.c
packet_socket.c
packet_socket.h
promiscuous.c
route.c
route.h
tcp_internal.h
tcp_private.h
tcp.c
tcp.h
tp_priv.h
tp.c
tp.h
udp_internal.h
udp.c
utils.c