From 4c90858482bde72ba7ff92c69a660694383f2198 Mon Sep 17 00:00:00 2001 From: Axel Lin Date: Wed, 13 Dec 2017 20:15:23 +0800 Subject: [PATCH] ip4_reass: Fix build error when IP_REASS_CHECK_OVERLAP=0 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The goto freepbuf code path is also used when IP_REASS_CHECK_OVERLAP=0. Thus remove #if IP_REASS_CHECK_OVERLAP around the freepbuf label to fix below build error: cc -g -Wall -DLWIP_DEBUG -pedantic -Werror -Wparentheses -Wsequence-point -Wswitch-default -Wextra -Wundef -Wshadow -Wpointer-arith -Wcast-qual -Wc++-compat -Wwrite-strings -Wold-style-definition -Wcast-align -Wmissing-prototypes -Wredundant-decls -Wnested-externs -Wunreachable-code -Wuninitialized -Wlogical-op -I. -I../../.. -I../../../../lwip/src/include -I../../../ports/unix/port/include -I../../../../mbedtls/include -Wno-redundant-decls -DLWIP_HAVE_MBEDTLS=1 -c ../../../../lwip/src/core/ipv4/ip4_frag.c ../../../../lwip/src/core/ipv4/ip4_frag.c: In function ‘ip_reass_chain_frag_into_datagram_and_validate’: ../../../../lwip/src/core/ipv4/ip4_frag.c:412:7: error: label ‘freepbuf’ used but not defined goto freepbuf; ^~~~ Signed-off-by: Axel Lin Signed-off-by: goldsimon --- src/core/ipv4/ip4_frag.c | 2 -- 1 file changed, 2 deletions(-) diff --git a/src/core/ipv4/ip4_frag.c b/src/core/ipv4/ip4_frag.c index cf681a71..b08dd3da 100644 --- a/src/core/ipv4/ip4_frag.c +++ b/src/core/ipv4/ip4_frag.c @@ -491,14 +491,12 @@ ip_reass_chain_frag_into_datagram_and_validate(struct ip_reassdata *ipr, struct } /* If we come here, not all fragments were received, yet! */ return IP_REASS_VALIDATE_PBUF_QUEUED; /* not yet valid! */ -#if IP_REASS_CHECK_OVERLAP freepbuf: clen = pbuf_clen(new_p); LWIP_ASSERT("ip_reass_pbufcount >= clen", ip_reass_pbufcount >= clen); ip_reass_pbufcount = (u16_t)(ip_reass_pbufcount - clen); pbuf_free(new_p); return IP_REASS_VALIDATE_PBUF_DROPPED; -#endif /* IP_REASS_CHECK_OVERLAP */ } /**