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).
This commit is contained in:
Ivan Delamer 2012-01-31 15:44:29 -07:00
parent aecb4b03cc
commit 02d3fd4758

View File

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