use the modified tun_flowctl driver if it exists

From: weston
This commit is contained in:
tgoff0 2015-06-01 17:52:49 +00:00
parent d92f1ff89d
commit b1322df827

View file

@ -12,6 +12,7 @@ share the same MAC+PHY model.
'''
import sys
import os.path
from core.api import coreapi
from core.coreobj import PyCoreNet
@ -183,8 +184,12 @@ class EmaneNode(EmaneNet):
flowcontrol = True
if "virtual" in type.lower():
trans.appendChild(emane.xmlparam(transdoc, "devicepath",
"/dev/net/tun"))
if os.path.exists("/dev/net/tun_flowctl"):
trans.appendChild(emane.xmlparam(transdoc, "devicepath",
"/dev/net/tun_flowctl"))
else:
trans.appendChild(emane.xmlparam(transdoc, "devicepath",
"/dev/net/tun"))
if flowcontrol:
trans.appendChild(emane.xmlparam(transdoc, "flowcontrolenable",
"on"))