diff --git a/src/include/lwip/opt.h b/src/include/lwip/opt.h index ecc59540..97f99cfa 100644 --- a/src/include/lwip/opt.h +++ b/src/include/lwip/opt.h @@ -2061,7 +2061,7 @@ #ifndef VJ_SUPPORT #define VJ_SUPPORT 1 #endif -#if !PPPOS_SUPPORT +#if !PPPOS_SUPPORT || !PPP_IPV4_SUPPORT #undef VJ_SUPPORT #define VJ_SUPPORT 0 /* VJ compression is only supported for PPPoS. */ #endif /* !PPPOS_SUPPORT */ diff --git a/src/include/netif/ppp/ppp.h b/src/include/netif/ppp/ppp.h index 815e18c1..d7208bf5 100644 --- a/src/include/netif/ppp/ppp.h +++ b/src/include/netif/ppp/ppp.h @@ -330,7 +330,12 @@ struct ppp_pcb_s { unsigned int ipcp_is_up :1; /* have called ipcp_up() */ unsigned int if4_up :1; /* True when the IPv4 interface is up. */ unsigned int proxy_arp_set :1; /* Have created proxy arp entry */ +#if VJ_SUPPORT + unsigned int vj_enabled :1; /* Flag indicating VJ compression enabled. */ #else + unsigned int :1; /* 1 bit of padding */ +#endif /* VJ_SUPPORT */ +#else /* PPP_IPV4_SUPPORT */ unsigned int :4; /* 4 bit of padding */ #endif /* PPP_IPV4_SUPPORT */ #if PPP_IPV6_SUPPORT @@ -341,11 +346,6 @@ struct ppp_pcb_s { #endif /* PPP_IPV6_SUPPORT */ unsigned int ask_for_local :1; /* request our address from peer */ unsigned int lcp_echo_timer_running :1; /* set if a timer is running */ -#if VJ_SUPPORT - unsigned int vj_enabled :1; /* Flag indicating VJ compression enabled. */ -#else - unsigned int :1; /* 1 bit of padding */ -#endif /* VJ_SUPPORT */ unsigned int :5; /* 5 bits of padding to round out to 16 bits */ u32_t last_xmit; /* Time of last transmission. */ diff --git a/src/include/netif/ppp/ppp_impl.h b/src/include/netif/ppp/ppp_impl.h index 96648d99..f6cee65a 100644 --- a/src/include/netif/ppp/ppp_impl.h +++ b/src/include/netif/ppp/ppp_impl.h @@ -431,7 +431,9 @@ int sifproxyarp(ppp_pcb *pcb, u32_t his_adr); int cifproxyarp(ppp_pcb *pcb, u32_t his_adr); int sdns(ppp_pcb *pcb, u32_t ns1, u32_t ns2); int cdns(ppp_pcb *pcb, u32_t ns1, u32_t ns2); +#if VJ_SUPPORT int sifvjcomp(ppp_pcb *pcb, int vjcomp, int cidcomp, int maxcid); +#endif /* VJ_SUPPORT */ int sifup(ppp_pcb *pcb); int sifdown (ppp_pcb *pcb); #endif /* PPP_IPV4_SUPPORT */ diff --git a/src/netif/ppp/ipcp.c b/src/netif/ppp/ipcp.c index 72b47951..4e97284f 100644 --- a/src/netif/ppp/ipcp.c +++ b/src/netif/ppp/ipcp.c @@ -1852,8 +1852,10 @@ static void ipcp_up(fsm *f) { } #endif /* Unused */ +#if VJ_SUPPORT /* set tcp compression */ sifvjcomp(pcb, ho->neg_vj, ho->cflag, ho->maxslotindex); +#endif /* VJ_SUPPORT */ #if DEMAND_SUPPORT /* @@ -2012,7 +2014,9 @@ static void ipcp_down(fsm *f) { pcb->ipcp_is_up = 0; np_down(pcb, PPP_IP); } +#if VJ_SUPPORT sifvjcomp(pcb, 0, 0, 0); +#endif /* VJ_SUPPORT */ #if PPP_STATS_SUPPORT print_link_stats(); /* _after_ running the notifiers and ip_down_hook(), diff --git a/src/netif/ppp/ppp.c b/src/netif/ppp/ppp.c index d52eba13..18880c4b 100644 --- a/src/netif/ppp/ppp.c +++ b/src/netif/ppp/ppp.c @@ -957,6 +957,7 @@ int cdns(ppp_pcb *pcb, u32_t ns1, u32_t ns2) { return 1; } +#if VJ_SUPPORT /******************************************************************** * * sifvjcomp - config tcp header compression @@ -967,6 +968,7 @@ int sifvjcomp(ppp_pcb *pcb, int vjcomp, int cidcomp, int maxcid) { } return 0; } +#endif /* VJ_SUPPORT */ /* * sifup - Config the interface up and enable IP packets to pass.