From 5c8e1dffc8a021a520b39e389baa9ff700aa04c9 Mon Sep 17 00:00:00 2001 From: Simon Goldschmidt Date: Thu, 5 Jul 2018 21:31:34 +0200 Subject: [PATCH] unix port: fix compiling tapif for NO_SYS Signed-off-by: Simon Goldschmidt --- ports/unix/example_app/default_netif.c | 7 ++++--- ports/unix/port/include/netif/tapif.h | 1 + ports/unix/port/netif/tapif.c | 6 ++++++ 3 files changed, 11 insertions(+), 3 deletions(-) diff --git a/ports/unix/example_app/default_netif.c b/ports/unix/example_app/default_netif.c index f07c718..8a9138d 100644 --- a/ports/unix/example_app/default_netif.c +++ b/ports/unix/example_app/default_netif.c @@ -49,16 +49,17 @@ void init_default_netif(void) #endif { #if NO_SYS - #error tapif not implemented for NO_SYS mode -#else /* NO_SYS */ +netif_add(&netif, NETIF_ADDRS NULL, tapif_init, netif_input); +#else netif_add(&netif, NETIF_ADDRS NULL, tapif_init, tcpip_input); -#endif /* NO_SYS */ +#endif netif_set_default(&netif); } void default_netif_poll(void) { + tapif_poll(&netif); } void diff --git a/ports/unix/port/include/netif/tapif.h b/ports/unix/port/include/netif/tapif.h index 7f8b616..4c0fa6b 100644 --- a/ports/unix/port/include/netif/tapif.h +++ b/ports/unix/port/include/netif/tapif.h @@ -35,6 +35,7 @@ #include "lwip/netif.h" err_t tapif_init(struct netif *netif); +void tapif_poll(struct netif *netif); #if NO_SYS int tapif_select(struct netif *netif); #endif /* NO_SYS */ diff --git a/ports/unix/port/netif/tapif.c b/ports/unix/port/netif/tapif.c index 752e391..3a71715 100644 --- a/ports/unix/port/netif/tapif.c +++ b/ports/unix/port/netif/tapif.c @@ -368,6 +368,12 @@ tapif_init(struct netif *netif) /*-----------------------------------------------------------------------------------*/ +void +tapif_poll(struct netif *netif) +{ + tapif_input(netif); +} + #if NO_SYS int