1
0
Fork 0
mirror of https://github.com/hermitcore/libhermit.git synced 2025-03-09 00:00:03 +01:00

forward packet to Linux, if the destination IP is a real address

This commit is contained in:
Stefan Lankes 2016-10-19 12:48:55 +02:00
parent 210dbc1773
commit f2f38f397e

View file

@ -309,6 +309,10 @@ static uint8_t mmnif_get_destination(struct netif *netif, struct pbuf *p)
iphdr = (struct ip_hdr *)(p->payload);
ip = iphdr->dest;
// forward packet to Linux (= isle 1), if the destination IP is a real address
if ((ip4_addr1(&ip) != 192) || (ip4_addr2(&ip) != 168) || (ip4_addr3(&ip) != 28))
return 1;
return ip4_addr4(&ip);
}