From 02d3fd47589792e567d6eb2c855858be394372a2 Mon Sep 17 00:00:00 2001 From: Ivan Delamer Date: Tue, 31 Jan 2012 15:44:29 -0700 Subject: [PATCH] Fixes small bug in uip-nd6.c: when a packet is sent before DAD is completed, DAD-like message is sent that can create a DAD fail in another node (if it matches the destination of our packet). --- core/net/uip-nd6.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/core/net/uip-nd6.c b/core/net/uip-nd6.c index 13b650064..47ada0b20 100644 --- a/core/net/uip-nd6.c +++ b/core/net/uip-nd6.c @@ -351,6 +351,11 @@ uip_nd6_ns_output(uip_ipaddr_t * src, uip_ipaddr_t * dest, uip_ipaddr_t * tgt) } else { uip_ds6_select_src(&UIP_IP_BUF->srcipaddr, &UIP_IP_BUF->destipaddr); } + if (uip_is_addr_unspecified(&UIP_IP_BUF->srcipaddr)) { + PRINTF("Dropping NS due to no suitable source address\n"); + uip_len = 0; + return; + } UIP_IP_BUF->len[1] = UIP_ICMPH_LEN + UIP_ND6_NS_LEN + UIP_ND6_OPT_LLAO_LEN;