From 9d6542d49b3c13b2818486b16c9b0375fb3ce6e0 Mon Sep 17 00:00:00 2001 From: David Kopf Date: Sat, 11 Feb 2012 15:03:24 -0500 Subject: [PATCH] Fix minimal-net webserver6, broken after native border router changes. --- cpu/native/net/wpcap-drv.c | 3 +-- cpu/native/net/wpcap.c | 13 +++++++------ 2 files changed, 8 insertions(+), 8 deletions(-) diff --git a/cpu/native/net/wpcap-drv.c b/cpu/native/net/wpcap-drv.c index e447ed84c..bbba1bdf4 100644 --- a/cpu/native/net/wpcap-drv.c +++ b/cpu/native/net/wpcap-drv.c @@ -28,7 +28,6 @@ * * This file is part of the Contiki operating system. * - * @(#)$Id: wpcap-drv.c,v 1.7 2010/10/19 18:29:04 adamdunkels Exp $ */ #include "contiki-net.h" @@ -86,7 +85,7 @@ pollhandler(void) if(uip_len > 0) { #if UIP_CONF_IPV6 if(BUF->type == uip_htons(UIP_ETHTYPE_IPV6)) { - printf("wpcap poll calls tcpip"); +// printf("wpcap poll calls tcpip"); tcpip_input(); } else #endif /* UIP_CONF_IPV6 */ diff --git a/cpu/native/net/wpcap.c b/cpu/native/net/wpcap.c index b289322fb..6daf737ec 100644 --- a/cpu/native/net/wpcap.c +++ b/cpu/native/net/wpcap.c @@ -167,6 +167,10 @@ static struct pcap *(* pcap_open_live)(char *, int, int, int, char *); static int (* pcap_next_ex)(struct pcap *, struct pcap_pkthdr **, unsigned char **); static int (* pcap_sendpacket)(struct pcap *, unsigned char *, int); +#define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN]) +#define BUF ((struct uip_eth_hdr *)&uip_buf[0]) +#define IPBUF ((struct uip_tcpip_hdr *)&uip_buf[UIP_LLH_LEN]) + #ifdef UIP_FALLBACK_INTERFACE static struct pcap *pfall; struct in_addr addrfall; @@ -183,14 +187,9 @@ init(void) /*---------------------------------------------------------------------------*/ u8_t wfall_send(uip_lladdr_t *lladdr); #if FALLBACK_HAS_ETHERNET_HEADERS -#define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN]) -#define BUF ((struct uip_eth_hdr *)&uip_buf[0]) +#undef IPBUF #define IPBUF ((struct uip_tcpip_hdr *)&uip_buf[14]) static uip_ipaddr_t last_sender; -#else -#define UIP_IP_BUF ((struct uip_ip_hdr *)&uip_buf[UIP_LLH_LEN]) -#define BUF ((struct uip_eth_hdr *)&uip_buf[0]) -#define IPBUF ((struct uip_tcpip_hdr *)&uip_buf[UIP_LLH_LEN]) #endif static void @@ -375,6 +374,8 @@ init_pcap(struct in_addr addr) } #ifdef UIP_FALLBACK_INTERFACE log_message("init_pcap: Opened as primary interface",""); +#else + log_message("init_pcap: Opened as interface",""); #endif // pcap_setdirection(PCAP_D_IN); //Not implemented in windows yet? set_ethaddr(addr);