Skip to content

Commit 8968b02

Browse files
kderdarlubos
authored andcommitted
[nrf fromlist] net: ipv6: routing: do not loop back already routed packets
If the packet was routed between interfaces by IPv6 module it should not be looped back but has to be passed to the destination interface instead. Upstream PR: zephyrproject-rtos/zephyr#76150 Signed-off-by: Konrad Derda <[email protected]>
1 parent bdb9641 commit 8968b02

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

subsys/net/ip/net_core.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -255,12 +255,13 @@ static inline int check_ip(struct net_pkt *pkt)
255255
}
256256

257257
/* If the destination address is our own, then route it
258-
* back to us.
258+
* back to us (if it is not already forwarded).
259259
*/
260-
if (net_ipv6_is_addr_loopback(
260+
if ((net_ipv6_is_addr_loopback(
261261
(struct in6_addr *)NET_IPV6_HDR(pkt)->dst) ||
262262
net_ipv6_is_my_addr(
263-
(struct in6_addr *)NET_IPV6_HDR(pkt)->dst)) {
263+
(struct in6_addr *)NET_IPV6_HDR(pkt)->dst)) &&
264+
!net_pkt_forwarding(pkt)) {
264265
struct in6_addr addr;
265266

266267
/* Swap the addresses so that in receiving side

0 commit comments

Comments
 (0)