From 5f0fbdcde9855abd382c81f4e2cb0cef72644e5a Mon Sep 17 00:00:00 2001 From: goldsimon Date: Wed, 1 Mar 2017 21:46:36 +0100 Subject: [PATCH] fixed warning about potentially unused variable 'netif' after changing ip4/6_input_accept to return in, not netif* --- src/core/ipv4/ip4.c | 3 ++- src/core/ipv6/ip6.c | 3 ++- 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/core/ipv4/ip4.c b/src/core/ipv4/ip4.c index b9de7c34..23354525 100644 --- a/src/core/ipv4/ip4.c +++ b/src/core/ipv4/ip4.c @@ -529,6 +529,7 @@ ip4_input(struct pbuf *p, struct netif *inp) if (ip4_input_accept(inp)) { netif = inp; } else { + netif = NULL; #if !LWIP_NETIF_LOOPBACK || LWIP_HAVE_LOOPIF /* Packets sent to the loopback address must not be accepted on an * interface that does not have the loopback address assigned to it, @@ -536,7 +537,7 @@ ip4_input(struct pbuf *p, struct netif *inp) if (!ip4_addr_isloopback(ip4_current_dest_addr())) #endif /* !LWIP_NETIF_LOOPBACK || LWIP_HAVE_LOOPIF */ { -#if ! LWIP_SINGLE_NETIF +#if !LWIP_SINGLE_NETIF NETIF_FOREACH(netif) { if (netif == inp) { /* we checked that before already */ diff --git a/src/core/ipv6/ip6.c b/src/core/ipv6/ip6.c index c2111446..39e282ef 100644 --- a/src/core/ipv6/ip6.c +++ b/src/core/ipv6/ip6.c @@ -620,6 +620,7 @@ ip6_input(struct pbuf *p, struct netif *inp) if (ip6_input_accept(inp)) { netif = inp; } else { + netif = NULL; #if !IPV6_CUSTOM_SCOPES /* Shortcut: stop looking for other interfaces if either the source or * the destination has a scope constrained to this interface. Custom @@ -641,7 +642,7 @@ ip6_input(struct pbuf *p, struct netif *inp) goto netif_found; } #endif /* !LWIP_NETIF_LOOPBACK || LWIP_HAVE_LOOPIF */ -#if ! LWIP_SINGLE_NETIF +#if !LWIP_SINGLE_NETIF NETIF_FOREACH(netif) { if (netif == inp) { /* we checked that before already */