Merge pull request #234 from cetic/fix-icmp-error-source

Always use uip_ds6_select_src() when sending back an icmp error
This commit is contained in:
Simon Duquennoy 2017-12-12 20:15:24 +01:00 committed by GitHub
commit 49e86ed709
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -238,12 +238,8 @@ uip_icmp6_error_output(uint8_t type, uint8_t code, uint32_t param) {
return; return;
} }
} else { } else {
#if UIP_CONF_ROUTER
/* need to pick a source that corresponds to this node */ /* need to pick a source that corresponds to this node */
uip_ds6_select_src(&UIP_IP_BUF->srcipaddr, &tmp_ipaddr); uip_ds6_select_src(&UIP_IP_BUF->srcipaddr, &tmp_ipaddr);
#else
uip_ipaddr_copy(&UIP_IP_BUF->srcipaddr, &tmp_ipaddr);
#endif
} }
UIP_ICMP_BUF->type = type; UIP_ICMP_BUF->type = type;