From f2f38f397ec9271ffeaf5f779ba8b6b611b4eb6a Mon Sep 17 00:00:00 2001 From: Stefan Lankes Date: Wed, 19 Oct 2016 12:48:55 +0200 Subject: [PATCH] forward packet to Linux, if the destination IP is a real address --- hermit/drivers/net/mmnif.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/hermit/drivers/net/mmnif.c b/hermit/drivers/net/mmnif.c index 064c60e0e..83659f1eb 100644 --- a/hermit/drivers/net/mmnif.c +++ b/hermit/drivers/net/mmnif.c @@ -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); }