mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2024-08-26 08:02:51 +00:00
PPP, move VJ_SUPPORT disabling if LWIP_TCP is not enabled to PPP options
Van Jacobson TCP header compression only apply if TCP is enabled, therefore we need to disable VJ compression if TCP is disabled. We already have conditions to enforce VJ disabling if IPv4 is disabled or if PPPoS is disabled, add TCP to those conditions and remove unecessary VJ_SUPPORT && LWIP_TCP conditions.
This commit is contained in:
parent
898e69118a
commit
dd0779c204
@ -296,8 +296,8 @@
|
|||||||
#ifndef VJ_SUPPORT
|
#ifndef VJ_SUPPORT
|
||||||
#define VJ_SUPPORT 1
|
#define VJ_SUPPORT 1
|
||||||
#endif
|
#endif
|
||||||
/* VJ compression is only supported for IPv4 over PPPoS. */
|
/* VJ compression is only supported for TCP over IPv4 over PPPoS. */
|
||||||
#if !PPPOS_SUPPORT || !PPP_IPV4_SUPPORT
|
#if !PPPOS_SUPPORT || !PPP_IPV4_SUPPORT || !LWIP_TCP
|
||||||
#undef VJ_SUPPORT
|
#undef VJ_SUPPORT
|
||||||
#define VJ_SUPPORT 0
|
#define VJ_SUPPORT 0
|
||||||
#endif /* !PPPOS_SUPPORT */
|
#endif /* !PPPOS_SUPPORT */
|
||||||
|
@ -510,7 +510,7 @@ static err_t ppp_netif_output(struct netif *netif, struct pbuf *pb, u16_t protoc
|
|||||||
}
|
}
|
||||||
#endif /* MPPE_SUPPORT */
|
#endif /* MPPE_SUPPORT */
|
||||||
|
|
||||||
#if VJ_SUPPORT && LWIP_TCP
|
#if VJ_SUPPORT
|
||||||
/*
|
/*
|
||||||
* Attempt Van Jacobson header compression if VJ is configured and
|
* Attempt Van Jacobson header compression if VJ is configured and
|
||||||
* this is an IP packet.
|
* 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;
|
return ERR_VAL;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
#endif /* VJ_SUPPORT && LWIP_TCP */
|
#endif /* VJ_SUPPORT */
|
||||||
|
|
||||||
#if CCP_SUPPORT
|
#if CCP_SUPPORT
|
||||||
switch (pcb->ccp_transmit_method) {
|
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_comp, 0, sizeof(pcb->mppe_comp));
|
||||||
memset(&pcb->mppe_decomp, 0, sizeof(pcb->mppe_decomp));
|
memset(&pcb->mppe_decomp, 0, sizeof(pcb->mppe_decomp));
|
||||||
#endif /* MPPE_SUPPORT */
|
#endif /* MPPE_SUPPORT */
|
||||||
#if VJ_SUPPORT && LWIP_TCP
|
#if VJ_SUPPORT
|
||||||
vj_compress_init(&pcb->vj_comp);
|
vj_compress_init(&pcb->vj_comp);
|
||||||
#endif /* VJ_SUPPORT && LWIP_TCP */
|
#endif /* VJ_SUPPORT */
|
||||||
|
|
||||||
/* Start protocol */
|
/* Start protocol */
|
||||||
new_phase(pcb, PPP_PHASE_ESTABLISH);
|
new_phase(pcb, PPP_PHASE_ESTABLISH);
|
||||||
@ -871,7 +871,7 @@ void ppp_input(ppp_pcb *pcb, struct pbuf *pb) {
|
|||||||
return;
|
return;
|
||||||
#endif /* PPP_IPV6_SUPPORT */
|
#endif /* PPP_IPV6_SUPPORT */
|
||||||
|
|
||||||
#if VJ_SUPPORT && LWIP_TCP
|
#if VJ_SUPPORT
|
||||||
case PPP_VJC_COMP: /* VJ compressed TCP */
|
case PPP_VJC_COMP: /* VJ compressed TCP */
|
||||||
/*
|
/*
|
||||||
* Clip off the VJ header and prepend the rebuilt TCP/IP header and
|
* 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. */
|
/* Something's wrong so drop it. */
|
||||||
PPPDEBUG(LOG_WARNING, ("ppp_input[%d]: Dropping VJ uncompressed\n", pcb->netif->num));
|
PPPDEBUG(LOG_WARNING, ("ppp_input[%d]: Dropping VJ uncompressed\n", pcb->netif->num));
|
||||||
break;
|
break;
|
||||||
#endif /* VJ_SUPPORT && LWIP_TCP */
|
#endif /* VJ_SUPPORT */
|
||||||
|
|
||||||
default: {
|
default: {
|
||||||
int i;
|
int i;
|
||||||
|
@ -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));
|
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);
|
pppos_input_free_current_packet(pppos);
|
||||||
#if VJ_SUPPORT && LWIP_TCP
|
#if VJ_SUPPORT
|
||||||
vj_uncompress_err(&pppos->ppp->vj_comp);
|
vj_uncompress_err(&pppos->ppp->vj_comp);
|
||||||
#endif /* VJ_SUPPORT && LWIP_TCP */
|
#endif /* VJ_SUPPORT */
|
||||||
|
|
||||||
LINK_STATS_INC(link.drop);
|
LINK_STATS_INC(link.drop);
|
||||||
MIB2_STATS_NETIF_INC(pppos->ppp->netif, ifindiscards);
|
MIB2_STATS_NETIF_INC(pppos->ppp->netif, ifindiscards);
|
||||||
|
@ -29,7 +29,7 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
#include "netif/ppp/ppp_opts.h"
|
#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/ppp_impl.h"
|
||||||
#include "netif/ppp/pppdebug.h"
|
#include "netif/ppp/pppdebug.h"
|
||||||
@ -692,4 +692,4 @@ bad:
|
|||||||
return (-1);
|
return (-1);
|
||||||
}
|
}
|
||||||
|
|
||||||
#endif /* PPP_SUPPORT && VJ_SUPPORT && LWIP_TCP */
|
#endif /* PPP_SUPPORT && VJ_SUPPORT */
|
||||||
|
Loading…
Reference in New Issue
Block a user