Преглед изворни кода

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 = []
             self.routes = []
             for r in iproute.get_routes():
             for r in iproute.get_routes():
                 attrs = dict(r['attrs'])
                 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:
                     if 'RTA_PRIORITY' in attrs and not attrs['RTA_PRIORITY'] < 255:
                         continue
                         continue
                     route = {}
                     route = {}