diff --git a/core/net/ip/tcpip.c b/core/net/ip/tcpip.c index 67c837591..570793c48 100644 --- a/core/net/ip/tcpip.c +++ b/core/net/ip/tcpip.c @@ -586,7 +586,16 @@ tcpip_ipv6_output(void) /* This should be copied from the ext header... */ UIP_IP_BUF->proto = proto; } - UIP_FALLBACK_INTERFACE.output(); + /* Inform the other end that the destination is not reachable. If it's + * not informed routes might get lost unexpectedly until there's a need + * to send a new packet to the peer */ + if(UIP_FALLBACK_INTERFACE.output() < 0) { + PRINTF("FALLBACK: output error. Reporting DST UNREACH\n"); + uip_icmp6_error_output(ICMP6_DST_UNREACH, ICMP6_DST_UNREACH_ADDR, 0); + uip_flags = 0; + tcpip_ipv6_output(); + return; + } #else PRINTF("tcpip_ipv6_output: Destination off-link but no route\n"); #endif /* !UIP_FALLBACK_INTERFACE */ diff --git a/core/net/ip/uip.h b/core/net/ip/uip.h index a85929554..879b74421 100644 --- a/core/net/ip/uip.h +++ b/core/net/ip/uip.h @@ -1429,7 +1429,13 @@ extern struct uip_udp_conn uip_udp_conns[UIP_UDP_CONNS]; struct uip_fallback_interface { void (*init)(void); - void (*output)(void); + /** + * \retval >=0 + * in case of success + * \retval <0 + * in case of failure + */ + int (*output)(void); }; #if UIP_CONF_ICMP6