mirror of
https://github.com/lwip-tcpip/lwip.git
synced 2025-01-15 22:49:16 +00:00
PPP, using ip4_input() instead of ip_input()
In PPP, we previously know if we are dealing with a IPv4 or a IPv6 packet, we don't need to use the ip_input() dispatch function, removing a useless if and reducing call stack by one.
This commit is contained in:
parent
c1c65777b6
commit
0e1aec4348
@ -90,7 +90,7 @@
|
||||
#include "lwip/snmp.h"
|
||||
#include "lwip/sio.h"
|
||||
#include "lwip/sys.h"
|
||||
#include "lwip/ip.h" /* for ip_input() */
|
||||
#include "lwip/ip4.h" /* for ip4_input() */
|
||||
#if PPP_IPV6_SUPPORT
|
||||
#include "lwip/ip6.h" /* for ip6_input() */
|
||||
#endif /* PPP_IPV6_SUPPORT */
|
||||
@ -683,7 +683,7 @@ void ppp_input(ppp_pcb *pcb, struct pbuf *pb) {
|
||||
|
||||
case PPP_IP: /* Internet Protocol */
|
||||
PPPDEBUG(LOG_INFO, ("ppp_input[%d]: ip in pbuf len=%d\n", pcb->netif->num, pb->tot_len));
|
||||
ip_input(pb, pcb->netif);
|
||||
ip4_input(pb, pcb->netif);
|
||||
return;
|
||||
|
||||
#if PPP_IPV6_SUPPORT
|
||||
|
@ -45,7 +45,7 @@
|
||||
#include "lwip/tcpip.h"
|
||||
#include "lwip/api.h"
|
||||
#include "lwip/sio.h"
|
||||
#include "lwip/ip.h" /* for ip_input() */
|
||||
#include "lwip/ip4.h" /* for ip4_input() */
|
||||
|
||||
#include "netif/ppp/ppp_impl.h"
|
||||
#include "netif/ppp/pppos.h"
|
||||
@ -892,7 +892,7 @@ pppos_netif_input(ppp_pcb *ppp, void *ctx, struct pbuf *p, u16_t protocol)
|
||||
PPPDEBUG(LOG_INFO, ("pppos_vjc_comp[%d]: vj_comp in pbuf len=%d\n", ppp->netif->num, p->len));
|
||||
ret = vj_uncompress_tcp(&p, &pppos->vj_comp);
|
||||
if (ret >= 0) {
|
||||
ip_input(p, pppos->ppp->netif);
|
||||
ip4_input(p, pppos->ppp->netif);
|
||||
return ERR_OK;
|
||||
}
|
||||
/* Something's wrong so drop it. */
|
||||
@ -910,7 +910,7 @@ pppos_netif_input(ppp_pcb *ppp, void *ctx, struct pbuf *p, u16_t protocol)
|
||||
PPPDEBUG(LOG_INFO, ("pppos_vjc_uncomp[%d]: vj_un in pbuf len=%d\n", ppp->netif->num, p->len));
|
||||
ret = vj_uncompress_uncomp(p, &pppos->vj_comp);
|
||||
if (ret >= 0) {
|
||||
ip_input(p, pppos->ppp->netif);
|
||||
ip4_input(p, pppos->ppp->netif);
|
||||
return ERR_OK;
|
||||
}
|
||||
/* Something's wrong so drop it. */
|
||||
|
Loading…
Reference in New Issue
Block a user