def i2h(self, pkt, x): if x is None: try: x = conf.neighbor.resolve(pkt, pkt.payload) except socket.error: pass if x is None: x = "ff:ff:ff:ff:ff:ff" warning("Mac address to reach destination not found. Using broadcast.") # noqa: E501 return MACField.i2h(self, pkt, x)
def i2h(self, pkt, x): if x is None: iff = self.getif(pkt) if iff is None: iff = conf.iface if iff: try: x = get_if_hwaddr(iff) except Exception as e: warning("Could not get the source MAC: %s" % e) if x is None: x = "00:00:00:00:00:00" return MACField.i2h(self, pkt, x)
def i2h(self, pkt, x): if x is None: iff = self.getif(pkt) if iff is None: iff = conf.iface if iff: try: x = get_if_hwaddr(iff) except: pass if x is None: x = "00:00:00:00:00:00" return MACField.i2h(self, pkt, x)