Emulate loopback: when sending an IP packet to one of our addresses, process it directly as input

This commit is contained in:
Simon Duquennoy 2017-07-06 19:24:27 +02:00
parent 74ed8bc585
commit 12d976f7b5

View File

@ -672,6 +672,15 @@ tcpip_ipv6_output(void)
goto send_packet;
}
/* We first check if the destination address is one of ours. There is no
* loopback interface -- instead, process this directly as incoming. */
if(uip_ds6_is_my_addr(&UIP_IP_BUF->destipaddr)) {
LOG_INFO("output: sending to ourself\n");
packet_input();
return;
}
/* Look for a next hop */
if((nexthop = get_nexthop(&ipaddr)) == NULL) {
goto exit;
}