daemon: fixed issue not checking if an emane interface is a TunTap before using a specific function, fixed issue not looking for possible iface specific configuration for external
This commit is contained in:
parent
df9216e0f0
commit
cd6083aed9
1 changed files with 5 additions and 7 deletions
|
@ -17,7 +17,7 @@ from core.emulator.enumerations import (
|
||||||
)
|
)
|
||||||
from core.errors import CoreError
|
from core.errors import CoreError
|
||||||
from core.nodes.base import CoreNetworkBase
|
from core.nodes.base import CoreNetworkBase
|
||||||
from core.nodes.interface import CoreInterface
|
from core.nodes.interface import CoreInterface, TunTap
|
||||||
|
|
||||||
if TYPE_CHECKING:
|
if TYPE_CHECKING:
|
||||||
from core.emane.emanemodel import EmaneModel
|
from core.emane.emanemodel import EmaneModel
|
||||||
|
@ -151,18 +151,16 @@ class EmaneNet(CoreNetworkBase):
|
||||||
warntxt = "unable to publish EMANE events because the eventservice "
|
warntxt = "unable to publish EMANE events because the eventservice "
|
||||||
warntxt += "Python bindings failed to load"
|
warntxt += "Python bindings failed to load"
|
||||||
logging.error(warntxt)
|
logging.error(warntxt)
|
||||||
|
|
||||||
for iface in self.get_ifaces():
|
for iface in self.get_ifaces():
|
||||||
external = self.session.emane.get_config(
|
config = self.session.emane.get_iface_config(
|
||||||
"external", self.id, self.model.name
|
self.id, iface, self.model.name
|
||||||
)
|
)
|
||||||
if external == "0":
|
external = config["external"]
|
||||||
|
if isinstance(iface, TunTap) and external == "0":
|
||||||
iface.setaddrs()
|
iface.setaddrs()
|
||||||
|
|
||||||
if not self.session.emane.genlocationevents():
|
if not self.session.emane.genlocationevents():
|
||||||
iface.poshook = None
|
iface.poshook = None
|
||||||
continue
|
continue
|
||||||
|
|
||||||
# at this point we register location handlers for generating
|
# at this point we register location handlers for generating
|
||||||
# EMANE location events
|
# EMANE location events
|
||||||
iface.poshook = self.setnemposition
|
iface.poshook = self.setnemposition
|
||||||
|
|
Loading…
Reference in a new issue