From 5b0b36c39eb805586cec01e5ea9f250c32229d87 Mon Sep 17 00:00:00 2001 From: joxe Date: Thu, 12 Nov 2009 14:05:42 +0000 Subject: [PATCH] accept messages to all routers if UIP_CONF_ROUTER is set. --- core/net/uip.h | 15 ++++++++++++++- core/net/uip6.c | 5 +++-- 2 files changed, 17 insertions(+), 3 deletions(-) diff --git a/core/net/uip.h b/core/net/uip.h index 4484e3343..d7ead657b 100644 --- a/core/net/uip.h +++ b/core/net/uip.h @@ -47,7 +47,7 @@ * * This file is part of the uIP TCP/IP stack. * - * $Id: uip.h,v 1.24 2009/04/06 13:18:50 nvt-se Exp $ + * $Id: uip.h,v 1.25 2009/11/12 14:05:42 joxe Exp $ * */ @@ -1950,6 +1950,19 @@ CCIF extern uip_lladdr_t uip_lladdr; (((a)->u8[14]) == 0) && \ (((a)->u8[15]) == 0x01)) +/** \brief Is IPv6 address a the link local all-routers multicast address */ +#define uip_is_addr_linklocal_allrouters_mcast(a) \ + ((((a)->u8[0]) == 0xff) && \ + (((a)->u8[1]) == 0x02) && \ + (((a)->u16[1]) == 0) && \ + (((a)->u16[2]) == 0) && \ + (((a)->u16[3]) == 0) && \ + (((a)->u16[4]) == 0) && \ + (((a)->u16[5]) == 0) && \ + (((a)->u16[6]) == 0) && \ + (((a)->u8[14]) == 0) && \ + (((a)->u8[15]) == 0x02)) + /** \brief set IP address a to unspecified */ #define uip_create_unspecified(a) uip_ip6addr(a, 0, 0, 0, 0, 0, 0, 0, 0) diff --git a/core/net/uip6.c b/core/net/uip6.c index a9cb65ecc..c4e647af3 100644 --- a/core/net/uip6.c +++ b/core/net/uip6.c @@ -41,7 +41,7 @@ * * This file is part of the uIP TCP/IP stack. * - * $Id: uip6.c,v 1.7 2009/10/27 22:34:08 adamdunkels Exp $ + * $Id: uip6.c,v 1.8 2009/11/12 14:05:42 joxe Exp $ * */ @@ -1103,7 +1103,8 @@ uip_process(u8_t flag) UIP_IP_BUF->ttl = UIP_IP_BUF->ttl - 1; UIP_STAT(++uip_stat.ip.forwarded); goto send; - } else if(!uip_is_addr_linklocal_allnodes_mcast(&UIP_IP_BUF->destipaddr)) { + } else if(!uip_is_addr_linklocal_allnodes_mcast(&UIP_IP_BUF->destipaddr) && + !uip_is_addr_linklocal_allrouters_mcast(&UIP_IP_BUF->destipaddr)) { PRINTF("Dropping packet, not for me\n"); UIP_STAT(++uip_stat.ip.drop); goto drop;