[dts] [PATCH V1] fix FreeBSD get mac addr error

xu,gang gangx.xu at intel.com
Wed Aug 30 08:10:31 CEST 2017


get mac addr need restore interface

Signed-off-by: xu,gang <gangx.xu at intel.com>
---
 nics/net_device.py | 5 +++++
 1 file changed, 5 insertions(+)

diff --git a/nics/net_device.py b/nics/net_device.py
index 4861145..9edf6f6 100644
--- a/nics/net_device.py
+++ b/nics/net_device.py
@@ -330,6 +330,11 @@ class NetDevice(object):
         """
         Get the MAC by the default way on Freebsd.
         """
+        out = self.__send_expect('kldstat', '# ')
+        if 'nic_uio.ko' in out:
+            self.__send_expect('kldunload nic_uio.ko', '# ')
+            self.__send_expect('kldunload contigmem.ko', '# ')
+
         out = self.__send_expect('ifconfig %s' % intf, '# ')
         rexp = r"ether ([\da-f:]*)"
         pattern = re.compile(rexp)
-- 
1.9.3



More information about the dts mailing list