From d471e5f89e32d6a8e79456c4250ea2dd519cb0d8 Mon Sep 17 00:00:00 2001 From: David van Moolenbroek Date: Wed, 8 Feb 2017 22:16:32 +0100 Subject: [PATCH] Patch #9250 (slightly changed): fix source substitution in ip6_output_if() (broken in 2014 with be75c483d0adae9ce786e3e2d5760f8e37005ac7) Signed-off-by: sg (cherry picked from commit fffd61c746c9f98be3379d7488ab8f142e4f9878) --- src/core/ipv6/ip6.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/core/ipv6/ip6.c b/src/core/ipv6/ip6.c index a542a869..e119b006 100644 --- a/src/core/ipv6/ip6.c +++ b/src/core/ipv6/ip6.c @@ -815,8 +815,8 @@ ip6_output_if(struct pbuf *p, const ip6_addr_t *src, const ip6_addr_t *dest, const ip6_addr_t *src_used = src; if (dest != LWIP_IP_HDRINCL) { if (src != NULL && ip6_addr_isany(src)) { - src = ip_2_ip6(ip6_select_source_address(netif, dest)); - if ((src == NULL) || ip6_addr_isany(src)) { + src_used = ip_2_ip6(ip6_select_source_address(netif, dest)); + if ((src_used == NULL) || ip6_addr_isany(src_used)) { /* No appropriate source address was found for this packet. */ LWIP_DEBUGF(IP6_DEBUG | LWIP_DBG_LEVEL_SERIOUS, ("ip6_output: No suitable source address for packet.\n")); IP6_STATS_INC(ip6.rterr);