From dc092653f4cce58a48c7be147d645be6cda88e7e Mon Sep 17 00:00:00 2001 From: Sylvain Rochet Date: Sat, 23 Jun 2012 12:04:27 +0200 Subject: [PATCH] now displaying sent packet before PPPoS add its escaping, trailing flags, ... --- src/netif/ppp/ppp.c | 15 ++++++--------- src/netif/ppp/utils.c | 2 +- 2 files changed, 7 insertions(+), 10 deletions(-) diff --git a/src/netif/ppp/ppp.c b/src/netif/ppp/ppp.c index e2957e59..5793bf87 100644 --- a/src/netif/ppp/ppp.c +++ b/src/netif/ppp/ppp.c @@ -867,10 +867,6 @@ pppos_put(ppp_pcb *pcb, struct pbuf *nb) struct pbuf *b; int c; -#if PRINTPKT_SUPPORT - dump_packet("sent", (unsigned char *)nb->payload+2, nb->len-2); -#endif /* PRINTPKT_SUPPORT */ - for(b = nb; b != NULL; b = b->next) { if((c = sio_write(pcb->fd, b->payload, b->len)) != b->len) { PPPDEBUG(LOG_WARNING, @@ -946,7 +942,8 @@ static err_t ppp_netif_output_ip6(struct netif *netif, struct pbuf *pb, ip6_addr /* Send a packet on the given connection. * - * This is the low level function that send the PPP packet. + * This is the low level function that send the PPP packet, + * only for IPv4 and IPv6 packets coming from lwIP. */ static err_t ppp_netif_output(struct netif *netif, struct pbuf *pb, u_short protocol) { ppp_pcb *pcb = (ppp_pcb*)netif->state; @@ -1204,6 +1201,10 @@ int ppp_write(ppp_pcb *pcb, struct pbuf *p) { struct pbuf *head, *tail; #endif /* PPPOS_SUPPORT */ +#if PRINTPKT_SUPPORT + dump_packet("sent", (unsigned char *)p->payload+2, p->len-2); +#endif /* PRINTPKT_SUPPORT */ + #if PPPOE_SUPPORT if(pcb->ethif) { return ppp_write_over_ethernet(pcb, p); @@ -1279,10 +1280,6 @@ static int ppp_write_over_ethernet(ppp_pcb *pcb, struct pbuf *p) { /* skip address & flags */ pbuf_header(p, -(s16_t)2); -#if PRINTPKT_SUPPORT - dump_packet("sent", (unsigned char *)p->payload, p->len); -#endif /* PRINTPKT_SUPPORT */ - ph = pbuf_alloc(PBUF_LINK, (u16_t)(PPPOE_HDRLEN), PBUF_RAM); if(!ph) { LINK_STATS_INC(link.memerr); diff --git a/src/netif/ppp/utils.c b/src/netif/ppp/utils.c index d3e18428..9f94ca4e 100644 --- a/src/netif/ppp/utils.c +++ b/src/netif/ppp/utils.c @@ -481,7 +481,7 @@ static void format_packet(u_char *p, int len, printer(arg, "%.*B", len, p); len = 0; } else - printer(arg, "[proto=0x%x]", PP_NTOHS(proto)); + printer(arg, "[proto=0x%x]", proto); } }