From 48049f120c2990161e8e8f5f8ae77e2ba7b13263 Mon Sep 17 00:00:00 2001 From: Joakim Eriksson Date: Sat, 23 Sep 2017 19:54:46 +0200 Subject: [PATCH] fixed compilation issue on cooja-net driver --- arch/platform/cooja/net/uip-driver.c | 7 ++----- examples/ipv6/packet-processing/packet-debug.c | 6 ++++-- 2 files changed, 6 insertions(+), 7 deletions(-) diff --git a/arch/platform/cooja/net/uip-driver.c b/arch/platform/cooja/net/uip-driver.c index ea2fa5a9a..0b5b2008b 100644 --- a/arch/platform/cooja/net/uip-driver.c +++ b/arch/platform/cooja/net/uip-driver.c @@ -41,15 +41,12 @@ #include "net/ipv6/tcpip.h" #include "net/packetbuf.h" #include "net/uip-driver.h" +#include "net/linkaddr.h" #include /*--------------------------------------------------------------------*/ uint8_t -#if NETSTACK_CONF_WITH_IPV6 -uip_driver_send(const uip_lladdr_t *addr) -#else -uip_driver_send(void) -#endif +uip_driver_send(const linkaddr_t *addr) { packetbuf_copyfrom(&uip_buf[UIP_LLH_LEN], uip_len); diff --git a/examples/ipv6/packet-processing/packet-debug.c b/examples/ipv6/packet-processing/packet-debug.c index 19dff001b..37ea6b04f 100644 --- a/examples/ipv6/packet-processing/packet-debug.c +++ b/examples/ipv6/packet-processing/packet-debug.c @@ -108,11 +108,13 @@ static enum netstack_ip_action ip_output(const linkaddr_t *localdest) { uint8_t proto; + uint8_t is_me = 0; uipbuf_get_last_header(uip_buf, uip_len, &proto); - PRINTF("Send packet proto: %d to ", proto); + is_me = uip_ds6_is_my_addr(&UIP_IP_BUF->srcipaddr); + PRINTF("%s packet proto: %d to ", is_me ? "Send" : "Fwd ", proto); PRINT6ADDR(&UIP_IP_BUF->destipaddr); PRINTF("\n"); - if(proto == UIP_PROTO_UDP) { + if(is_me && proto == UIP_PROTO_UDP) { /* fake server-ip address here - just to emulate the UDP-example */ PRINTF("DATA send to %d 'Hello %d'\n", 1, seq_id); }