Commit Graph

8762 Commits

Author SHA1 Message Date
Jiří Klimeš
c0458cb433 docs: correct the description of nm_utils_ap_mode_security_valid() 2012-10-18 11:01:06 +02:00
Dan Williams
e6bdb8bc55 libnm-util: add methods for AP-mode security filtering
Add a helper like nm_utils_security_valid() except for access point
mode.  We can't use nm_utils_security_valid() without changing the
arguments, hence the new function.  Plus in AP mode all you care about
are the device capabilities, not AP flags since the device *is*
the AP.
2012-10-17 14:07:37 -05:00
Dan Williams
7c34a37e73 wifi: mode changes must happen when device is down
With both WEXT and nl80211; this wasn't an issue before because
devices can still scan in adhoc mode.  But we do need to ensure
that the device is in Infrastructure mode when we deactivate a
Hotspot.
2012-10-17 14:07:37 -05:00
Dan Williams
25f9801ebd wifi: implement nl80211 set_mode hook
We do need it to ensure the device is in Infrastructure mode when
deactivating a Hotspot.
2012-10-17 14:07:37 -05:00
Dan Williams
dadff884a3 wifi: update Hotspot AP object with BSSID and frequency when known
Since the frequency and/or BSSID may not be known immediately, it's
nice to update the export AP object when we do know them, so you
don't end up with missing information like:

SSID     BSSID               MODE FREQ
'testap' 00:00:00:00:00:00   AP   0 MHz

Note that the "rate" is never updated, because in AP-mode the bitrate
is actually different for each client, so no single rate makes sense.
2012-10-17 14:07:36 -05:00
Dan Williams
f83ae16d10 wifi: request scan after deactivating a hotspot connection
Otherwise it might be a while until a scan gets done.
2012-10-17 14:06:54 -05:00
Dan Williams
28ebea3440 wifi: various AP mode fixups
Scanning doesn't work well in AP mode, because then you're off-channel
and not serving your clients, which isn't good for anyone.  Plus,
nl80211 refuses to scan in AP mode anyway, so just don't scan.

Second, track the device's mode based on the connection we're activating
or have activated, not based on whatever mode the kernel drivers are
using that second.  That is  more consistent, since there's a race between
when the connection starts being activated, when the device will be in
INFRA mode, and when the supplicant actually gets around to changing the
mode.

Third, fix various other codepaths that weren't quite expecting AP mode.
2012-10-17 14:06:54 -05:00
Dan Williams
6ae1def061 libnm-glib: fix wifi device 'mode' property for AP mode 2012-10-17 14:06:54 -05:00
Dan Williams
b89990ae2c wifi: detect whether supplicant supports AP mode or not
And return an error when trying to activate an AP mode connection
if the supplicant does not support it.

With wpa_supplicant 1.0 and earlier there is no way to positively detect
whether AP mode is supported, so we simply try to start AP mode
and then fail if it doesn't work.

With more recent versions we can check the Introspection data
(if the supplicant has been built with introspection enabled) or
check the global Capabilities (if the supplicant is recent enough)
for positive indication of AP mode support.
2012-10-17 14:06:51 -05:00
Dan Williams
323ff852ba trivial: fix AP mode message log level 2012-10-17 12:08:12 -05:00
Jan Luebbe
f9c72dee3e wifi: support ap-mode with wpa_supplicant
A new value for NM80211Mode is introduced (NM_802_11_MODE_AP) and the
new mode is passed to wpa_supplicant analogous to adhoc-mode.
The places which need to know the interface mode have been extended to
handle the new mode.

If the configuration does not contain a fixed frequency, a channel is
selected the same way as with adhoc-mode before.
2012-10-17 12:08:11 -05:00
Sandeep Shedmake
802e868f0f po: updated Marathi (mr) translation (bgo #686069) 2012-10-17 13:36:35 +02:00
Dan Williams
cb3450b32f libnm-glib: fix introspection annotation for nm_device_adsl_new() 2012-10-16 15:53:08 -05:00
Giovanni Campagna
246633a854 NMRemoteSettings: fix async initialization
If async GetProperties completed before the GetConnections, init_left would
be 0 and thus we never connected to connections-read, causing us to terminate
initialization before connections were actually read.

https://bugzilla.gnome.org/show_bug.cgi?id=686226
2012-10-16 14:31:38 -04:00
Colin Walters
89623b99c4 core: import libgsystem, use it for local-allocations in main.c (bgo #685440)
See http://git.gnome.org/browse/libgsystem/tree/README
for a description of libgsystem.

What we specifically are using it for here is the local allocation
macros; this patch just modifies main.c as a demo.

Note this patch fixes a double-free in an error condition in
check_pidfile(); those sort of mistakes are basically impossible
to make when using these macros.
2012-10-16 12:08:03 -05:00
Colin Walters
6a14c4ad58 build: drop subdir-objects from automake options
This breaks a future libgsystem patch.  The original use dates
to:

    commit ae6f88b3dd
    Author: Dan Williams <dcbw@redhat.com>
    Date:   Tue Aug 24 00:31:47 2004 +0000

Which who knows where it came from or why.
2012-10-16 12:08:03 -05:00
Jiří Klimeš
347e149e39 libnm-util: un-deprecate seen-bssids property and adjust its description 2012-10-16 15:48:53 +02:00
Jiří Klimeš
65029e0f89 settings: update seen-bssids property in 802-11-wireless setting for GetSettings
https://bugzilla.gnome.org/show_bug.cgi?id=672501
2012-10-16 15:48:41 +02:00
Dan Williams
dd42da51a8 core: fix suspend/resume signal names which the manager listens for
Introduced in 64fd8eea7706038e5d38c8463a1c765ed9331db2; but honestly
I also thought GObject lower-cased signal names since it munges them
for - and _ too.  Apparently not.
2012-10-14 10:44:34 -05:00
Dan Williams
c5744bc73d core: DBusGConnections are not GObjects
Introduced in 64fd8eea77.
2012-10-14 10:43:54 -05:00
Matthias Clasen
ea0c3a3e0f core: add a systemd suspend/resume monitor (bgo #677694)
This implementation uses a delay inhibitor to get systemd to
emit PrepareForSleep, and then emits ::Sleeping and ::Resuming
when receiving the before/after PrepareForSleep emissions.
2012-10-13 09:20:00 -05:00
Matthias Clasen
64fd8eea77 core: factor out the upower suspend/resume code (bgo #677694)
Factor the code that listens for upower sleeping and resuming
signals out into a class code NMSleepMonitor.
2012-10-13 09:20:00 -05:00
Dan Williams
27a14a7d11 core: fix routing if gateway not given in the first address
The gateway doesn't have to be there, but can be associated with
any address.  NM should look through all addresses and find the
first usable gateway.  Previously it was just using the first
address' gateway even if it was 0.

Broken by 2384dea3 (policy: split routing and DNS updates)
2012-10-11 17:07:21 -05:00
Marius Kotsbak
b4f2f6f596 ifupdown: fix for compile error 2012-10-11 15:49:50 -05:00
Alberto Ruiz
48a84c1271 libnm-glib: add missing NMSettingHashFlags argument to NMSecretAgentGetSecretsFunc docs
The nm_connection_to_hash() call in the NMSecretAgentGetSecretsFunc
documentation missed the last argument. This patch adds
NM_SETTING_HASH_FLAG_ALL as the last argument in the example.
2012-10-11 09:12:47 -05:00
Jiří Klimeš
b95b6c8aa1 core: fix a crash due to GValueArray/GArray freeing mismatch (rh #865009) 2012-10-11 15:41:48 +02:00
Chris Leonard
d4049c5c0a po: updated British English (en_GB) translation (bgo #684757) 2012-10-11 13:02:52 +02:00
Sandeep Shedmake
4cda9b0969 po: updated Marathi (mr) translation (bgo #684659) 2012-10-11 12:57:46 +02:00
chandankumar
826767bd8f po: updated Hindi (hi) translation (bgo #684647) 2012-10-11 12:50:42 +02:00
A S Alam
82dc54a9fe po: updated Punjabi (pa) translation (bgo #685017) 2012-10-11 12:42:28 +02:00
Ani Peter
3bbca1f57e po: updated Malayalam (ml) translation (bgo #684497) 2012-10-11 12:36:31 +02:00
Sweta Kothari
b0cfd271ce po: updated Gujarati (gu) translation (bgo #684191) 2012-10-11 12:28:09 +02:00
Nilamdyuti Goswami
1e40483f9a po: updated Assamese (as) translation (bgo #684016) 2012-10-11 12:20:47 +02:00
Aleksander Morgado
8aac52bce3 device: clear nm_device_state_changed() re-entry check on early exit 2012-10-10 11:03:50 -05:00
Dan Williams
4cccab61ab supplicant: handle some D-Bus spawn errors better
If D-Bus fails to spawn the supplicant it sometimes returns a method
timeout error instead of a spawn error.  We've seen that happen on
F18 when systemd is used to autolaunch the supplicant.  That causes
NM to assume that the supplicant crashed and thus never try to talk
to it again, on the assumption that (a) it crashed and (b) it will
crash again if we try to use it, and thus we'll be in a spawn loop.

First, (a) is not necessarily the case, and second, the supplicant
doesn't crash like that anymore.  So we're pretty safe to just talk
to the supplicant if it starts later instead of ignoring it if
we detect the timeout error.
2012-10-06 17:08:53 -05:00
Dan Williams
14e87a583a trivial: warn if we ever re-enter nm_device_state_changed()
Motivated by ba48be3a34.
2012-10-06 12:38:41 -05:00
Dan Winship
ba48be3a34 core: fix NMDevice::state-changed emission of ACTIVATED (bgo #685581)
NMPolicy was calling nm_device_state_changed() from inside its
NMDevice::state-changed handler, which caused the D-Bus signal to get
lost. Use nm_device_queue_state() instead.
2012-10-05 17:15:01 -04:00
Dan Williams
30db13ae5a libnm-glib: don't try to query for connections synchronously when NM isn't running (bgo #685345)
And ensure we clear out properties when NM quits, and that we request them
when NM starts up again.
2012-10-05 08:54:35 -05:00
Colin Walters
50712597ae dispatcher: Don't segfault if no dispatcher scripts exist (bgo #685451)
If /etc/NetworkManager/dispatcher.d didn't exist or was
empty, we'd try to pull the first element of a 0-sized array.

To fix this cleanly, we need to explicitly separate discovery
of binaries to execute from setting up the callback data.
2012-10-04 16:33:54 -04:00
Dan Williams
ae0fd58a75 hosts: reduce warnings to debug messages
No point in always printing warnings when we can't open files
we don't meaningfully change.
2012-10-04 14:40:27 -05:00
Dan Williams
c0d3004d44 ifcfg-rh: trivial: fix possibly uninitialized variable usage 2012-10-04 13:38:13 -05:00
Dan Winship
f14ecfb9f5 build: distcheck fixes 2012-10-04 09:36:19 -04:00
Dan Winship
7005762f50 build: "make check" fixes 2012-10-04 09:07:49 -04:00
Dan Williams
8bbd7f207e modem: reduce "starting the modem manager" to a debug message 2012-10-02 17:02:31 -05:00
Dan Winship
0fdf2e7438 core: implement NMDevice::state-changed more idiomatically
Rather than having NMDevice subclasses connect to their own
::state-changed signal, fix up the signal definition so they can just
override the class handler.
2012-10-02 15:46:08 -04:00
Dan Winship
565c43e91d core: remove "real_" prefix from method implementation names
The idea was copied from gtk, but it's only used there in cases where
the method's wrapper function and default implementation would
otherwise have the same name, which never happens in NM because our
method implementations aren't prefixed with the type name, so it's
just noise here.
2012-10-02 15:43:24 -04:00
Dan Winship
14b19982f6 policy: add a configure option for a permissive modify.system default
Add --enable-modify-system, to change the default for
org.freedesktop.NetworkManager.settings.modify.system to allow users
to edit system connections without needing to authenticate.
2012-09-28 08:45:05 -04:00
Dan Winship
a7ad36987a ifcfg-rh: write out wired settings on vlan connections
VLAN connections can have "hardware" settings in addition to the
VLAN-specific ones. ifcfg-rh was reading in wired settings for VLANs,
but was not writing them back out.
2012-09-27 13:57:47 -04:00
Dan Winship
0a30843caa core: don't try to create VLANs on devices that don't support them
VLANs are only supported on certain kinds of devices, so don't try to
create them on other devices. (In fact, NM currently assumes that
VLANs are only created on Ethernet devices, so we need to be even more
picky than that.)
2012-09-27 13:57:47 -04:00
Dan Winship
de0163fc5c libnm-util: Improve NMSettingVlan's verify()
Do slightly more validation if NMSettingVlan properties, and make sure
that at least one method of specifying a parent is used.

Remove the check that id is in range, since gobject will not allow you
to set the property to a value outside its declared range anyway.
2012-09-27 13:57:20 -04:00