Fixed input thread handling: pass all supported packets to netif->input

This commit is contained in:
goldsimon 2010-02-17 16:57:16 +00:00
parent 44273aed6f
commit 3e130e4f7f
2 changed files with 10 additions and 9 deletions

View File

@ -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)

View File

@ -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;