Skip to content

Commit

Permalink
Merge pull request #513 from mwhudson/lp-1837822
Browse files Browse the repository at this point in the history
assume a default route on a down link has gone away
  • Loading branch information
mwhudson authored Jul 25, 2019
2 parents 6849aea + 6bbe027 commit 59d8822
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion subiquitycore/controllers/network.py
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,13 @@ def del_link(self, ifindex):

def update_link(self, ifindex):
netdev = self.model.update_link(ifindex)
if self.view is not None and netdev is not None:
if netdev is None:
return
if not (netdev.info.flags & IFF_UP) and ifindex in self.default_routes:
self.default_routes.remove(ifindex)
for watcher in self.default_route_watchers:
watcher(self.default_routes)
if self.view is not None:
self.view.update_link(netdev)

def route_change(self, action, data):
Expand Down

0 comments on commit 59d8822

Please sign in to comment.