TUN driver: Implement TAP (OSI layer 2) mode.

Enable by setting the IFF_TAP flag instead of the IFF_TUN flag in ifr_flags.
This commit is contained in:
Thomas Keh
2017-04-13 13:07:03 +02:00
parent dc2890904d
commit 7e293b28ee
2 changed files with 17 additions and 2 deletions
+1 -1
View File
@@ -251,7 +251,7 @@ int netdev_register(FAR struct net_driver_s *dev, enum net_lltype_e lltype)
#ifdef CONFIG_NET_TUN
case NET_LL_TUN: /* Virtual Network Device (TUN) */
dev->d_llhdrlen = 0;
dev->d_llhdrlen = 0; /* this will be overwritten by tun_ioctl if used as a TAP (layer 2) device */
dev->d_mtu = CONFIG_NET_TUN_MTU;
#ifdef CONFIG_NET_TCP
dev->d_recvwndo = CONFIG_NET_TUN_TCP_RECVWNDO;