Commit Graph

7207 Commits

Author SHA1 Message Date
Aleksander Morgado
1f0dbd6790 modem-manager: let the `NMDeviceModem' handle hw_is_up() and hw_bring_up()
These actions don't require anything from the `NMModem' object, so just move
them back to `NMDeviceModem'.
2012-10-30 18:24:28 -05:00
Aleksander Morgado
24b6fc9e62 modem-manager: switch the state' property from NMModem' into just `connected'
We don't want to depend in the `NMModem' interface on an enumeration which is
very specific to the old ModemManager interface, so we'll just skip exposing it
and instead we'll just give a new boolean property which tells whether the modem
is connected or not (which was at the end the whole purpose of the `state'
property).
2012-10-30 18:24:25 -05:00
Aleksander Morgado
f98ef0fdc4 modem-manager: remove the device' property from NMModem'
This property is not really used anywhere; so pointless to have it around.

Also, we already make sure in `NMModemManager' that the so called 'master'
device is valid and exists.
2012-10-30 18:24:21 -05:00
Aleksander Morgado
1eca1b2648 modem-manager: split the `NMModem' object
The `NMModem' object is split into two objects now:

 * The new `NMModemGeneric' object contains all the implementation specific to
   the old ModemManager interface.

 * The `NMModem' object keeps all the generic stuff; e.g. it doesn't even depend
   on dbus-glib for anything. Several properties in `NMModem' are also now set
   as non-construct-only, as we know that the new ModemManager only knows some
   of the stuff once a bearer has been created, not once a modem is available.

See src/modem-manager/README for more information.
2012-10-30 18:24:17 -05:00
Colin Walters
77264eb682 build: various srcdir != builddir fixes 2012-10-30 12:24:26 -05:00
Pavel Šimerda
012c5f4b27 distro: replace --with-distro with feature-based options (bgo #663602)
Distribution-specific builds are now handled by feature and not by
distro. This allows you to fine-tune the options to your liking and
also allowed us to reduce the number of specific values.

The default values of these options are still derived from *-version
and *-release files in /etc.

The following five distribution-specific features are now available
(and default on distributions in parenthesis):

  --enable-ifcfg-rh (Fedora, RHEL and Mandriva)
  --enable-ifcfg-suse (SUSE)
  --enable-ifupdown (Debian and Ubuntu)
  --enable-ifnet (Gentoo)
  --with-netconfig (SUSE)

Since --with-distro is now removed, there is nothing to prevent generic
builds. If you build on an unknown distribution, all of the features
above will be disabled by default.
2012-10-30 00:36:05 +01:00
Pavel Šimerda
71e5437f18 distro: add --with-netconfig option for SUSE
NetworkManager can use resolvconf and netconfig as alternatives
to direct modifications to /etc/resolv.conf. You can now choose
whether to build with netconfig or not.

The default is --with-netconfig=yes on SUSE and --with-netconfig=no
on other distributions. Default --with-resolvconf=no still applies
on any distribution.
2012-10-30 00:35:57 +01:00
Dan Williams
b8e7e50c80 olpc: ensure correct teardown of mesh device and companion wifi
If the mesh device gets removed first, ensure it cleans up its
signal handlers so they don't get called when the wifi device
is removed.  Fixes warnings on NM shutdown where the mesh device
object could be used after being freed.
2012-10-25 14:23:50 -05:00
Colin Walters
fed48417c3 Revert "core: import libgsystem, use it for local-allocations in main.c (bgo #685440)"
This reverts commit 89623b99c4 pending
further discussion.

See: https://mail.gnome.org/archives/networkmanager-list/2012-October/msg00065.html
2012-10-23 16:40:46 -05:00
Dan Winship
ad74379c2c core, libnm-glib: expose "slaves" property on NMDeviceBond
https://bugzilla.gnome.org/show_bug.cgi?id=686367
2012-10-19 12:09:27 -04:00
Jiří Klimeš
f1bb254b4b core: use IN6_IS_ADDR_UNSPECIFIED() macro to test against ::
That expresses the intention more explicitly and simplifies the code a bit.
Also, the g_assert (gw_addr) is not necessary any more.
2012-10-18 11:18:59 +02:00
Dan Williams
3d9d70822c core: fix routing crash with WWAN/PTP configurations
Some configurations won't have a gateway address, because they
are point-to-point (/32).  The previous code expected one and
asserted if a gateway was not found; but even without the
assertion, other code expected a non-NULL gateway.  Handle that
by defaulting the gateway to 0.0.0.0 (IPv4) or :: (IPv6) and
override that with a better gateway if we have one, otherwise
just use 0.0.0.0/:: since we already know the IP config we're
settings should be the default one.
2012-10-18 11:18:51 +02: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
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
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
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
Jiří Klimeš
b95b6c8aa1 core: fix a crash due to GValueArray/GArray freeing mismatch (rh #865009) 2012-10-11 15:41:48 +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
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 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
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
6878d20ac4 all: Don't use ctype.h macros
The ctype macros (eg, isalnum(), tolower()) are locale-dependent. Use
glib's ASCII-only versions instead.

Also, replace isascii() with g_ascii_isprint(), since isascii()
accepts control characters, which isn't what the code wanted in any of
the places where it was using it.
2012-09-26 12:14:37 -04:00
Dan Winship
74b6b9c768 libnm-util: move nm_utils_is_uuid() here
This is useful outside the daemon too, so move it into libnm-utils.
2012-09-26 12:14:37 -04:00
Dan Winship
77c90d3f36 ifcfg-rh: Fix the filename in two error messages 2012-09-26 12:10:24 -04:00
Dan Winship
c87f1758be ifcfg-rh: Fix bonds-of-InfiniBand
Move the bond-slave check out of the wired-specific code so that it
can be shared with the infiniband code again.
2012-09-26 12:10:23 -04:00
Dan Winship
89b08a0243 ipv6: restore the ability to set a default IPv6 route via a device (rh #829010)
replace_default_ip6_route() was mistakenly requiring gw to be
non-NULL, which meant it could only set the route via a gateway, not
via a device (thus breaking IPv6-over-openconnect)
2012-09-26 10:24:33 -04:00
Pavel Šimerda
bbbf9ad37b distro: remove src/backends
It is no longer used. Also remove an obsolete comment about backends
in nm-system.h.
2012-09-25 16:44:12 -05:00
Pavel Šimerda
3efc2c4b9d distro: remove nm_backend_enable_loopback()
We don't need to use distribution-specific network scripts to just bring
up the loopback interface.

I'm not aware of any init dependency problems but even if there are some,
it is more practical to solve them in the respective configuration files.

This function also tried to add 127.0.0.1 to the list of addresses but
not ::1. We don't need to set the interfaces up as this is done by the
kernel.
2012-09-25 16:44:12 -05:00
Pavel Šimerda
3ada5b5a6a distro: remove nm_backend_ipv6_use_tempaddr()
This function was *not* distribution specific and was used only in one place.
2012-09-25 16:44:12 -05:00
Pavel Šimerda
97745c7498 distro: remove nm_backend_update_dns()
This function was basically the same for all distributions and
was used only in one place. It tried to restart nscd or ask it
to reload configuration. This is not necessary as nscd uses
inotify to watch /etc/resolv.conf.
2012-09-25 16:44:11 -05:00