瀏覽代碼

Fix having interfaces without RTA_OIF

JDierkse 4 年之前
父節點
當前提交
efe246e394
共有 1 個文件被更改,包括 1 次插入1 次删除
  1. 1 1
      net-dhcp/interface.py

+ 1 - 1
net-dhcp/interface.py

@@ -93,7 +93,7 @@ class Interface:
             self.routes = []
             for r in iproute.get_routes():
                 attrs = dict(r['attrs'])
-                if attrs['RTA_OIF'] == self['index']:
+                if 'RTA_OIF' in attrs and attrs['RTA_OIF'] == self['index']:
                     if 'RTA_PRIORITY' in attrs and not attrs['RTA_PRIORITY'] < 255:
                         continue
                     route = {}