diff --git a/src/include/netif/ppp/ppp_opts.h b/src/include/netif/ppp/ppp_opts.h index 75541f44..fa79c090 100644 --- a/src/include/netif/ppp/ppp_opts.h +++ b/src/include/netif/ppp/ppp_opts.h @@ -296,8 +296,8 @@ #ifndef VJ_SUPPORT #define VJ_SUPPORT 1 #endif -/* VJ compression is only supported for IPv4 over PPPoS. */ -#if !PPPOS_SUPPORT || !PPP_IPV4_SUPPORT +/* VJ compression is only supported for TCP over IPv4 over PPPoS. */ +#if !PPPOS_SUPPORT || !PPP_IPV4_SUPPORT || !LWIP_TCP #undef VJ_SUPPORT #define VJ_SUPPORT 0 #endif /* !PPPOS_SUPPORT */ diff --git a/src/netif/ppp/ppp.c b/src/netif/ppp/ppp.c index 6d4f3a62..4c06083c 100644 --- a/src/netif/ppp/ppp.c +++ b/src/netif/ppp/ppp.c @@ -510,7 +510,7 @@ static err_t ppp_netif_output(struct netif *netif, struct pbuf *pb, u16_t protoc } #endif /* MPPE_SUPPORT */ -#if VJ_SUPPORT && LWIP_TCP +#if VJ_SUPPORT /* * Attempt Van Jacobson header compression if VJ is configured and * this is an IP packet. @@ -541,7 +541,7 @@ static err_t ppp_netif_output(struct netif *netif, struct pbuf *pb, u16_t protoc return ERR_VAL; } } -#endif /* VJ_SUPPORT && LWIP_TCP */ +#endif /* VJ_SUPPORT */ #if CCP_SUPPORT switch (pcb->ccp_transmit_method) { @@ -720,9 +720,9 @@ void ppp_start(ppp_pcb *pcb) { memset(&pcb->mppe_comp, 0, sizeof(pcb->mppe_comp)); memset(&pcb->mppe_decomp, 0, sizeof(pcb->mppe_decomp)); #endif /* MPPE_SUPPORT */ -#if VJ_SUPPORT && LWIP_TCP +#if VJ_SUPPORT vj_compress_init(&pcb->vj_comp); -#endif /* VJ_SUPPORT && LWIP_TCP */ +#endif /* VJ_SUPPORT */ /* Start protocol */ new_phase(pcb, PPP_PHASE_ESTABLISH); @@ -871,7 +871,7 @@ void ppp_input(ppp_pcb *pcb, struct pbuf *pb) { return; #endif /* PPP_IPV6_SUPPORT */ -#if VJ_SUPPORT && LWIP_TCP +#if VJ_SUPPORT case PPP_VJC_COMP: /* VJ compressed TCP */ /* * Clip off the VJ header and prepend the rebuilt TCP/IP header and @@ -899,7 +899,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 && LWIP_TCP */ +#endif /* VJ_SUPPORT */ default: { int i; diff --git a/src/netif/ppp/pppos.c b/src/netif/ppp/pppos.c index 69ed80e9..b4d435e8 100644 --- a/src/netif/ppp/pppos.c +++ b/src/netif/ppp/pppos.c @@ -785,9 +785,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 && LWIP_TCP +#if VJ_SUPPORT vj_uncompress_err(&pppos->ppp->vj_comp); -#endif /* VJ_SUPPORT && LWIP_TCP */ +#endif /* VJ_SUPPORT */ 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 b297c78d..dadb38d6 100644 --- a/src/netif/ppp/vj.c +++ b/src/netif/ppp/vj.c @@ -29,7 +29,7 @@ */ #include "netif/ppp/ppp_opts.h" -#if PPP_SUPPORT && VJ_SUPPORT && LWIP_TCP /* don't build if not configured for use in lwipopts.h */ +#if PPP_SUPPORT && VJ_SUPPORT /* don't build if not configured for use in lwipopts.h */ #include "netif/ppp/ppp_impl.h" #include "netif/ppp/pppdebug.h" @@ -692,4 +692,4 @@ bad: return (-1); } -#endif /* PPP_SUPPORT && VJ_SUPPORT && LWIP_TCP */ +#endif /* PPP_SUPPORT && VJ_SUPPORT */