Permalink
Browse files

Don't crash if we can't start the nl80211 listener.

  • Loading branch information...
1 parent bc42538 commit 09c449104c15f7c4518eff77055d70af08bcc42a @cyphermox cyphermox committed Dec 22, 2016
Showing with 10 additions and 4 deletions.
  1. +10 −4 probert/network.py
View
@@ -334,13 +334,19 @@ def start(self):
self.rtlistener = _rtnetlink.listener(self)
self.rtlistener.start()
- self.wlan_listener = _nl80211.listener(self)
- self.wlan_listener.start()
-
self._fdmap = {
self.rtlistener.fileno(): self.rtlistener.data_ready,
- self.wlan_listener.fileno(): self.wlan_listener.data_ready,
}
+
+ try:
+ self.wlan_listener = _nl80211.listener(self)
+ self.wlan_listener.start()
+ self._fdmap.update({
+ self.wlan_listener.fileno(): self.wlan_listener.data_ready,
+ })
+ except RuntimeError:
+ log.debug('could not start wlan_listener')
+
return list(self._fdmap)
def data_ready(self, fd):

2 comments on commit 09c4491

Why can the nl80211 lister fail in the first place? I have the problem with porting snappy to Pine64. See https://bugs.launchpad.net/ubuntu/+source/subiquity/+bug/1652262 for the bug entry.

2016-12-23 08:05:59,789 subiquitycore.core:159 Exception in controller.run():
Traceback (most recent call last):
File "/usr/share/subiquity/subiquitycore/core.py", line 154, in run
self.common['controllers'][k] = klass(self.common)
File "/usr/share/subiquity/subiquitycore/controllers/network.py", line 327, in init
self.observer.start()
File "/usr/share/subiquity/subiquitycore/controllers/network.py", line 226, in start
fds = super().start()
File "/usr/lib/python3/dist-packages/probert/network.py", line 319, in start
self.wlan_listener.start()
RuntimeError: nl_get_multicast_ids failed: -2

I also tried to replicate the issue with a simple c program, but there it works just fine. See https://gist.github.com/longsleep/03e034a8cd27e112ed64968df8b37501 for the code.

Collaborator

mwhudson replied Jan 1, 2017

Please sign in to comment.