From 1d25366c4f37f2273b6cc09ca9bfabdbbcb3fd31 Mon Sep 17 00:00:00 2001 From: Dan Williams Date: Fri, 6 Apr 2007 15:50:57 -0400 Subject: [PATCH] Don't show Ad-Hoc mode networks in mesh view --- shell/hardware/nmclient.py | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/shell/hardware/nmclient.py b/shell/hardware/nmclient.py index 3bb682d7..da1f18c9 100644 --- a/shell/hardware/nmclient.py +++ b/shell/hardware/nmclient.py @@ -80,6 +80,9 @@ DEVICE_STATE_ACTIVATING = 0 DEVICE_STATE_ACTIVATED = 1 DEVICE_STATE_INACTIVE = 2 +IW_MODE_ADHOC = 1 +IW_MODE_INFRA = 2 + class Network(gobject.GObject): __gsignals__ = { 'initialized' : (gobject.SIGNAL_RUN_FIRST, @@ -118,6 +121,15 @@ class Network(gobject.GObject): self._valid = False self.emit('initialized', self._valid) return + if self._mode != IW_MODE_INFRA: + # Don't show Ad-Hoc networks; they usually don't DHCP and therefore + # won't work well here. This also works around the bug where we show + # our own mesh SSID on the Mesh view when in mesh mode + logging.debug("Net(%s): ssid '%s' is adhoc; not showing" % (self._op, + self._ssid)) + self._valid = False + self.emit('initialized', self._valid) + return self._valid = True logging.debug("Net(%s): ssid '%s', mode %d, strength %d" % (self._op,