From d75ec2da53ad53077c90fbd1e9542779d18bad5b Mon Sep 17 00:00:00 2001 From: joxe Date: Thu, 11 Mar 2010 18:07:37 +0000 Subject: [PATCH] fixed so that uip6 sends icmp6 errors from correct source when acting as router - improves support for tracert, etc. --- core/net/uip-icmp6.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/core/net/uip-icmp6.c b/core/net/uip-icmp6.c index d9cb95582..7888f6f85 100644 --- a/core/net/uip-icmp6.c +++ b/core/net/uip-icmp6.c @@ -161,7 +161,12 @@ uip_icmp6_error_output(u8_t type, u8_t code, u32_t param) { return; } } else { - uip_ipaddr_copy(&UIP_IP_BUF->srcipaddr, &tmp_ipaddr); +#if UIP_CONF_ROUTER + /* need to pick a source that corresponds to this node */ + uip_netif_select_src(&UIP_IP_BUF->srcipaddr, &tmp_ipaddr); +#else + uip_ipaddr_copy(&UIP_IP_BUF->srcipaddr, &tmp_ipaddr); +#endif } UIP_ICMP_BUF->type = type;