From 3e130e4f7f7a613443b37a4487845ff1dcfe6851 Mon Sep 17 00:00:00 2001 From: goldsimon Date: Wed, 17 Feb 2010 16:57:16 +0000 Subject: [PATCH] Fixed input thread handling: pass all supported packets to netif->input --- ports/unix/netif/pcapif.c | 17 +++++++++-------- ports/unix/netif/tapif.c | 2 +- 2 files changed, 10 insertions(+), 9 deletions(-) diff --git a/ports/unix/netif/pcapif.c b/ports/unix/netif/pcapif.c index bf3710c..82a015e 100644 --- a/ports/unix/netif/pcapif.c +++ b/ports/unix/netif/pcapif.c @@ -79,7 +79,8 @@ static char errbuf[PCAP_ERRBUF_SIZE]; /*-----------------------------------------------------------------------------------*/ static err_t -pcapif_output(struct netif *netif, struct pbuf *p, ip_addr_t *ipaddr) +pcapif_output(struct netif *netif, struct pbuf *p, + ip_addr_t *ipaddr) { return ERR_OK; } @@ -106,15 +107,15 @@ timeout(void *arg) if (p != NULL) { /* We iterate over the pbuf chain until we have read the entire - packet into the pbuf. */ + packet into the pbuf. */ bufptr = (u_char *)pcapif->pkt; for(q = p; q != NULL; q = q->next) { - /* Read enough bytes to fill this pbuf in the chain. The - available data in the pbuf is given by the q->len - variable. */ - /* read data into(q->payload, q->len); */ - bcopy(bufptr, q->payload, q->len); - bufptr += q->len; + /* Read enough bytes to fill this pbuf in the chain. The + available data in the pbuf is given by the q->len + variable. */ + /* read data into(q->payload, q->len); */ + bcopy(bufptr, q->payload, q->len); + bufptr += q->len; } #if defined(LWIP_DEBUG) && defined(LWIP_TCPDUMP) diff --git a/ports/unix/netif/tapif.c b/ports/unix/netif/tapif.c index 556586b..5e18f50 100644 --- a/ports/unix/netif/tapif.c +++ b/ports/unix/netif/tapif.c @@ -332,7 +332,7 @@ tapif_init(struct netif *netif) netif->name[1] = IFNAME1; netif->output = etharp_output; netif->linkoutput = low_level_output; - netif->mtu = 1500; + netif->mtu = 1500; /* hardware address length */ netif->hwaddr_len = 6;