[PATCH V2 08/11] NaCl: Bypass ioctls during tunnel setup

Kevin Cernekee cernekee at gmail.com
Mon Feb 8 22:34:14 PST 2016


NaCl VPN implementations need to pass tunneled packets through the
JavaScript APIs, as there is no tun device in the sandbox.  Stub out
os_setup_tun() so we don't get a compile error on ioctl(SIOCSIFMTU).

Signed-off-by: Kevin Cernekee <cernekee at gmail.com>
---
 tun.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/tun.c b/tun.c
index 89dc87bd0561..b9a7465b36f5 100644
--- a/tun.c
+++ b/tun.c
@@ -175,7 +175,16 @@ intptr_t os_setup_tun(struct openconnect_info *vpninfo)
 
 	return tun_fd;
 }
-#else /* !__sun__ */
+#elif defined(__native_client__)
+
+intptr_t os_setup_tun(struct openconnect_info *vpninfo)
+{
+	vpn_progress(vpninfo, PRG_ERR,
+		     _("tun device is unsupported on this platform\n"));
+	return -EOPNOTSUPP;
+}
+
+#else /* !__sun__ && !__native_client__ */
 
 /* MTU setting code for both Linux and BSD systems */
 static void ifreq_set_ifname(struct openconnect_info *vpninfo, struct ifreq *ifr)
-- 
2.7.0




More information about the openconnect-devel mailing list