diff --git a/src/api/api_lib.c b/src/api/api_lib.c index 68a2e129..82b5fda8 100644 --- a/src/api/api_lib.c +++ b/src/api/api_lib.c @@ -721,11 +721,13 @@ netconn_close_shutdown(struct netconn *conn, u8_t how) { API_MSG_VAR_DECLARE(msg); err_t err; + LWIP_UNUSED_ARG(how); LWIP_ERROR("netconn_close: invalid conn", (conn != NULL), return ERR_ARG;); API_MSG_VAR_ALLOC(msg); API_MSG_VAR_REF(msg).msg.conn = conn; +#if LWIP_TCP /* shutting down both ends is the same as closing */ API_MSG_VAR_REF(msg).msg.msg.sd.shut = how; #if LWIP_SO_SNDTIMEO || LWIP_SO_LINGER @@ -736,6 +738,7 @@ netconn_close_shutdown(struct netconn *conn, u8_t how) API_MSG_VAR_REF(msg).msg.msg.sd.polls_left = ((LWIP_TCP_CLOSE_TIMEOUT_MS_DEFAULT + TCP_SLOW_INTERVAL - 1) / TCP_SLOW_INTERVAL) + 1; #endif /* LWIP_SO_SNDTIMEO || LWIP_SO_LINGER */ +#endif /* LWIP_TCP */ TCPIP_APIMSG(&API_MSG_VAR_REF(msg), lwip_netconn_do_close, err); API_MSG_VAR_FREE(msg); diff --git a/src/core/tcp.c b/src/core/tcp.c index ed713fe7..d025d441 100644 --- a/src/core/tcp.c +++ b/src/core/tcp.c @@ -508,7 +508,6 @@ static err_t tcp_accept_null(void *arg, struct tcp_pcb *pcb, err_t err) { LWIP_UNUSED_ARG(arg); - LWIP_UNUSED_ARG(pcb); LWIP_UNUSED_ARG(err); tcp_abort(pcb); diff --git a/src/include/lwip/priv/api_msg.h b/src/include/lwip/priv/api_msg.h index ac0e5064..70371bfb 100644 --- a/src/include/lwip/priv/api_msg.h +++ b/src/include/lwip/priv/api_msg.h @@ -118,6 +118,7 @@ struct api_msg_msg { struct { u32_t len; } r; +#if LWIP_TCP /** used for lwip_netconn_do_close (/shutdown) */ struct { u8_t shut; @@ -127,6 +128,7 @@ struct api_msg_msg { u8_t polls_left; #endif /* LWIP_SO_SNDTIMEO || LWIP_SO_LINGER */ } sd; +#endif /* LWIP_TCP */ #if LWIP_IGMP || (LWIP_IPV6 && LWIP_IPV6_MLD) /** used for lwip_netconn_do_join_leave_group */ struct { diff --git a/src/netif/ppp/ppp.c b/src/netif/ppp/ppp.c index 883b943c..65082fe0 100644 --- a/src/netif/ppp/ppp.c +++ b/src/netif/ppp/ppp.c @@ -480,7 +480,7 @@ static err_t ppp_netif_output(struct netif *netif, struct pbuf *pb, u16_t protoc } #endif /* MPPE_SUPPORT */ -#if VJ_SUPPORT +#if VJ_SUPPORT && LWIP_TCP /* * Attempt Van Jacobson header compression if VJ is configured and * this is an IP packet. @@ -505,7 +505,7 @@ static err_t ppp_netif_output(struct netif *netif, struct pbuf *pb, u16_t protoc return ERR_VAL; } } -#endif /* VJ_SUPPORT */ +#endif /* VJ_SUPPORT && LWIP_TCP */ #if CCP_SUPPORT if (pcb->ccp_is_up) { @@ -665,9 +665,9 @@ void ppp_clear(ppp_pcb *pcb) { (*protp->init)(pcb); } -#if VJ_SUPPORT +#if VJ_SUPPORT && LWIP_TCP vj_compress_init(&pcb->vj_comp); -#endif /* VJ_SUPPORT */ +#endif /* VJ_SUPPORT && LWIP_TCP */ new_phase(pcb, PPP_PHASE_INITIALIZE); } @@ -822,7 +822,7 @@ void ppp_input(ppp_pcb *pcb, struct pbuf *pb) { return; #endif /* PPP_IPV6_SUPPORT */ -#if VJ_SUPPORT +#if VJ_SUPPORT && LWIP_TCP case PPP_VJC_COMP: /* VJ compressed TCP */ /* * Clip off the VJ header and prepend the rebuilt TCP/IP header and @@ -850,7 +850,7 @@ void ppp_input(ppp_pcb *pcb, struct pbuf *pb) { /* Something's wrong so drop it. */ PPPDEBUG(LOG_WARNING, ("ppp_input[%d]: Dropping VJ uncompressed\n", pcb->netif->num)); break; -#endif /* VJ_SUPPORT */ +#endif /* VJ_SUPPORT && LWIP_TCP */ default: { int i; diff --git a/src/netif/ppp/pppos.c b/src/netif/ppp/pppos.c index e3168127..83480659 100644 --- a/src/netif/ppp/pppos.c +++ b/src/netif/ppp/pppos.c @@ -808,9 +808,9 @@ pppos_input_drop(pppos_pcb *pppos) PPPDEBUG(LOG_INFO, ("pppos_input_drop: pbuf len=%d, addr %p\n", pppos->in_head->len, (void*)pppos->in_head)); } pppos_input_free_current_packet(pppos); -#if VJ_SUPPORT +#if VJ_SUPPORT && LWIP_TCP vj_uncompress_err(&pppos->ppp->vj_comp); -#endif /* VJ_SUPPORT */ +#endif /* VJ_SUPPORT && LWIP_TCP */ LINK_STATS_INC(link.drop); MIB2_STATS_NETIF_INC(pppos->ppp->netif, ifindiscards); diff --git a/src/netif/ppp/vj.c b/src/netif/ppp/vj.c index 71fbc68d..0819afe1 100644 --- a/src/netif/ppp/vj.c +++ b/src/netif/ppp/vj.c @@ -29,7 +29,7 @@ */ #include "lwip/opt.h" -#if PPP_SUPPORT && VJ_SUPPORT /* don't build if not configured for use in lwipopts.h */ +#if PPP_SUPPORT && VJ_SUPPORT && LWIP_TCP /* don't build if not configured for use in lwipopts.h */ #include "netif/ppp/ppp_impl.h" #include "netif/ppp/pppdebug.h" @@ -654,4 +654,4 @@ bad: return (-1); } -#endif /* PPP_SUPPORT && VJ_SUPPORT */ +#endif /* PPP_SUPPORT && VJ_SUPPORT && LWIP_TCP */