Commit Graph

7207 Commits

Author SHA1 Message Date
Dan Williams
e8c58c957b platform: specify link-added signal as asynchronous
With the move of udev logic into the Linux platform class, the
link-added signals are asynchronous, that is they are not emitted
during the call to nm_platform_*_add(), but after that call has
returned.  The Fake implementation still emitted them synchronously,
which broke the testcases.  Convert the Fake implementation to emit
link-added signals asynchronously and update the testcases to handle
this.
2013-06-20 16:14:08 -05:00
Dan Williams
ed9f6b0843 build: fix distcheck after b294a1ef63 2013-06-20 16:14:08 -05:00
Pavel Šimerda
0b07a5301e settings: publish add_new_connection() as nm_settings_add_connection_internal() 2013-06-20 20:20:08 +02:00
Colin Walters
c1d3d3f2e9 device: queuing two transitions to the same state is not an error
Just ignore this, since it happens in the current code and is
harmless.  While we're here, improve the warning in the case where it
does occur to say whiich state we're overwriting.  This should help
debug any future cases.
2013-06-19 18:06:16 -05:00
Dan Williams
c77c566983 core: ignore default routes when creating configuration for generic interface
NM handles the default routes, so they shouldn't show up in the NMIP4Config
for any interface.  They get exposed via the 'default' and 'default6' properties
of the ActiveConnection instead.
2013-06-19 13:49:12 -05:00
Jiří Klimeš
eea23747ce ifcfg-rh: fix storing connections in the hash table
We have to copy the UUID (key) because otherwise the pointer can be invalidated
when the connection is destroyed and problems will start.

The issue showed up as an unability to delete a conenction via D-Bus.

Reproducer:
$ nmcli con add type eth con-name AAA ifname blah
$ nmcli con delete AAA
$ nmcli con add type eth con-name AAA ifname blah
$ nmcli con delete AAA
-- here the connection is not removed from NM
   (even though ifcfg- file) was removed --
2013-06-19 12:41:36 -05:00
Dan Williams
5c705e643a platform: update linux platform testcases for udev/platform merge
Since the platform started using udev for link-added signals, we need
to run the glib mainloop to wait for the udev signals to come in,
instead of expecting them to be emitted immediately.
2013-06-19 12:33:54 -05:00
Dan Williams
7c5bd0c64d platform: fix return value for no-firmware case
The function returns 'gboolean' so it shouldn't be returning an
enum, but it should instead set the platform error and return FALSE.
2013-06-19 12:28:48 -05:00
Pavel Šimerda
b294a1ef63 platform: add minimal Makefile.am for convenience
When working only with nm-platform and its testsuite, it's convenient to
call 'make', 'make check', etc from 'src/platform' directory.
2013-06-19 13:48:29 +02:00
Pavel Šimerda
ed37ceeb91 trivial: platform: add_kernel_object now returns int, not gboolean 2013-06-19 13:28:00 +02:00
Dan Williams
4182deb398 core: remove possibly dangling idle handler in ip6 manager
If things happen just right, where a bond is the first device to use
IPv6 and thus has the only reference to the NMIP6Manager, and the
RTM_NEWROUTE event comes in and triggers manager_request_ip6_info()
but then the device is removed by 'rmmod bonding', the call to
manager_request_ip6_info() could be dangling after the IP6Manager
has been disposed.  Fix that.
2013-06-18 14:41:26 -05:00
Dan Williams
caed0243f5 bluetooth: fix crash creating device
Due to the hardware address changes in 77dda53b (danw/hwlen) creating
a new Bluetooth device was crashing.  The changes there assumed that the
NMDeviceBt's hardware address should only be valid when we were connected
to the device, but that's not quite true.  Since we already know the remote
device's Bluetooth hardware address, we already know the hardware address
for the NMDeviceBt as well.
2013-06-17 12:04:54 -05:00
Dan Williams
c73e891a4c wifi: fix checking AP mode and EAP-FAST support
Classic strcmp() return value thinko.  Oops.
2013-06-14 14:24:19 -05:00
Dan Williams
cf1d2f81f2 core: rename nm_device_hw_* to nm_device_*
Now that we only have one set of is_up/bring_up/take_down functions
lets rename the _hw_ variants.
2013-06-14 13:45:39 -05:00
Dan Williams
4d4a99beaa wimax: hw_bring_up is pointless
The function only checked whether wimax was enabled (rfkill/user pref)
and whether wimaxd was running.  Only nm-device.c calls this function
for WiMAX devices, and the only two uses of it were during activation
(which is already covered by nm-device-wimax.c's is_available() function)
and when the device enters the UNAVAILABLE state, where it is used
to check for missing firmware, which is implemented by the parent
class, not WiMAX.
2013-06-14 13:45:39 -05:00
Dan Williams
17ce00ff27 core: remove bring_up, take_down, is_up device class methods
These turn out to be pretty useless, since their functions are already
covered by each device's state-changed handler or can be done in other
places like deactivate().

https://bugzilla.gnome.org/show_bug.cgi?id=702190
2013-06-14 13:45:32 -05:00
Colin Walters
907d99c2ac Make no-auto-default=* work again
Sadly '*' is a valid interface name, and so the config processing was
thinking it was shorthand for "interface-name:*".
2013-06-14 13:40:27 -03:00
Dan Winship
ac1692a17b keyfile: remove some debugging 2013-06-14 12:57:47 -03:00
Dan Winship
1f81851017 core: add monitor-connection-files=false and ReloadConnections
Add a "monitor-connection-files" config option, which can be set to
"false" to disable automatic reloading of connections on file change.

To go with this, add a new ReloadConnections method on
o.fd.NM.Settings that can be used to manually reload connections, and
add an nm-cli command to call it.
2013-06-14 12:57:47 -03:00
Dan Winship
4b74009b23 settings: don't connect to plugin signals until after initial load
Some plugins may emit :new-connection or :unmanaged-specs-changed
while reading connections, so don't connect to those signals until
after the initial load_connections() (and just unconditionally emit
:unmanaged-specs-changed at that point).

In ifcfg-rh's get_unmanaged_specs(), don't bother to try to read the
connections first; if they haven't been read yet, just return NULL;
NMSettings will call it again after the connections have been read.
2013-06-14 12:57:32 -03:00
Dan Winship
547f448640 core: initial InfiniBand partition support 2013-06-13 15:56:15 -03:00
Dan Winship
c19da3c71f platform: add support for creating InfiniBand subdevices 2013-06-13 15:56:14 -03:00
Dan Winship
cb5606cf1c ifcfg-rh: add support for Infiniband partitions 2013-06-13 15:56:14 -03:00
Dan Winship
d575381c28 settings: fix unmanaging of InfiniBand devices
ifcfg-rh didn't let you unmanage an InfiniBand device by hardware
address because it was recording the hardware address with uppercase
letters, while nm_match_spec_hwaddr() required lowercase. Fix this by
making nm_match_spec_hwaddr() match case-insensitively (and remove the
manual lowercasing that several other places were doing to work around
this.)

keyfile didn't let you unmanage an InfiniBand device by hardware
address because it only accepted ARPHRD_ETHER hardware addresses. Fix
that by using nm_utils_hwaddr_valid() instead.
2013-06-13 15:52:51 -03:00
Dan Winship
bc1a764e1a platform: fix recognition of InfiniBand devices 2013-06-13 15:52:50 -03:00
Dan Williams
2cb9bc9bda settings: let NMSettingsConnection unregister itself
Originally it was to keep logical balance, since NMSettings exports
the NMSettingsConnection to D-Bus, but it's kind of pointless to
spend some LoC just for that.
2013-06-11 12:48:15 -05:00
Dan Winship
77dda53b50 devices: use NMPlatform to find the hardware address length
For device types that don't override it, make
nm_device_get_hw_addr_len() use NMPlatform to find out the actual
hardware address length, rather than just defaulting to ETH_ALEN.
Fixes warnings in the logs when using tun or gre devices.
2013-06-11 09:27:45 -03:00
Dan Winship
6975645497 core: Use length-based hwaddr functions
Use nm_utils_hwaddr_aton_len() and nm_utils_hwaddr_ntoa_len(), to
simplify code, and (eventually) better support non-ethernet,
non-infiniband devices.
2013-06-11 09:27:45 -03:00
Dan Winship
8566f6090d vpn-manager: fix previous commit
Somehow this got broken...
2013-06-10 11:07:37 -03:00
Dan Winship
63ea8e5779 devices: fix warning when creating bluetooth device
nm_device_bt_new() was trying to set NM_DEVICE_MANAGED, but that's
been read-only now for a while. Fortunately, it was already trying to
set it to FALSE, which is the default, so we can just remove that
line.

https://bugzilla.gnome.org/show_bug.cgi?id=701715
2013-06-10 10:36:13 -03:00
Dan Winship
8feb3878f9 vpn-manager: fix PropertiesChanged on NMVpnConnection
We need to register NMVpnConnection's properties with the
PropertiesChanged signal (which it inherits from NMActiveConnection)
or it will ignore them.

https://bugzilla.gnome.org/show_bug.cgi?id=701713
2013-06-10 10:35:13 -03:00
Dan Williams
790c102fff wired: ignore carrier state for manual/static bridge and bond connections
NM is supposed to ignore carrier and slave states for manual/static
connections when bringing up bonds and bridges, on the theory that
since static configuration does not require connectivity, there's
no need to wait for that connectivity to happen. This wasn't
happening during the IP configuration phase, but was happening
before getting to the IP config phase where the device waits
for slaves before starting IP configuration if the method
requires connectivity.
2013-06-07 15:22:24 -05:00
Dan Williams
309ecf4f90 wifi: remove NMSupplicantInfo pending call tracking struct
The sole purpose of this structure was to track in-progress D-Bus
pending calls, so that they could be selectively canceled if the
supplicant got disconnected during assocation (canceling only
assocation-related calls) or if the supplicant went away (canceling
both assocation-related and general calls).  But its only benefit
over NMCallStore alone was knowing which list of pending calls to
remove the current pending call from, and we can just explicitly
do that in the code instead.

Thus, the SupplicantInfo structure is removed and replaced with
explicitly adding and removing the pending calls from the call
store.

(The DBusGProxy is not referenced by dbus_g_proxy_begin_call(),
the caller is expected to hold a reference to the proxy for as long
as necessary, and when the proxy is destroyed, all its pending calls
will be canceled.  Since the supplicant interface owns the proxies,
there's no possibility that the proxy will outlive the supplicant
interface and thus call back into it when its dead.  The old code
referenced the supplicant interface over the life of the pending
call, but that's not necessary.)
2013-06-07 11:33:42 -05:00
Dan Williams
1666b0c306 wifi: move NMCallStore to the supplicant code
Which is the only place it's used.
2013-06-07 11:33:42 -05:00
Dan Williams
e65c2e6eb4 wifi: simplify NMCallStore
Its only purpose is to track a number of DBusGProxyCalls to let
us cancel them all at the same time, without having to track each
call individually in the supplicant code.  Instead of abstracting
it to the level of GObject and gpointer, just use the types it's
meant for.
2013-06-07 11:33:42 -05:00
Dan Williams
a95c57887c wifi: fix obvious copy & paste bug
The supplicant info object should be passed the DBusGProxy that
we're about to use, not some other proxy.
2013-06-07 11:33:21 -05:00
Dan Williams
2702ea573a Revert "wifi: fix compatibility with wpa_supplicant 0.7.x"
This reverts commit 7902787263.

We'll be requiring wpa_supplicant 1.0+ from now on. wpa_supplicant
1.0 is over a year old a this point, so it's not unrealistic to
bump the requirement.

NOTE: you really do want 1.1 or later anyway if you want to
successfully use WPA-EAP networks, since that version has fixes
to correctly handle PMKSA preauthentication, otherwise you'll
get periodic disconnections on enterprise networks.
2013-06-07 11:33:21 -05:00
Aleksander Morgado
9d52a32c8f device-modem: fix setting initial ip-iface in old MM managed modems
'NM_DEVICE_IP_IFACE' has never been a writable property, just skip it and
explicitly call 'nm_device_set_ip_iface()' when the modem is managed by the old
ModemManager.

https://bugzilla.gnome.org/show_bug.cgi?id=701712
2013-06-07 13:17:37 -03:00
Dan Winship
8a93c83161 platform: fix type_name of unknown devices
The whole point of having type_name separate from type was so that
unknown devices could still have known device types. But I wrote it
wrong and then didn't notice until explicitly vxlan support got
removed and vxlans started showing up as "unknown".
2013-06-07 11:07:40 -03:00
Dan Williams
bc60d37050 platform: fix enumeration of devices at startup to use udev after 2fe8019a
nm_platform_query_devices() was just looking in the link_cache,
completely ignoring udev, which means that the link list wasn't
filtered for things NM wants to ignore.
2013-06-06 11:41:30 -05:00
Dan Winship
1dac0722d1 devices: fix a small bug in earlier commit that causes warnings 2013-06-06 08:46:45 -03:00
Dan Winship
b322c0dc81 devices: make constructors take an NMPlatformLink
Rather than passing UDI, ifname, and driver name to the device
constructors as separate arguments, just pass the NMPlatformLink
instead and let it parse them out.

Virtual types still take UDI and ifname separately, since we create
fake NMDevices for them for autoactivating connections. That's weird
in other ways too though, so perhaps this should be revisted.
2013-06-05 17:49:25 -03:00
Dan Winship
05216f67d6 platform: add NMPlatformLink.parent, sort link_get_all() output
Add a "parent" field to NMPlatformLink, giving the parent device
ifindex for devices that have a parent.

Make nm_platform_link_get_all() sort the links before returning them,
so that masters appear after all of their slaves, and parent devices
appear before their children.

Remove the second call to nm_platform_query_devices() from NMManager
since it is now guaranteed that an NMDeviceVLAN's parent NMDevice will
have been created before the NMDeviceVLAN.
2013-06-05 17:49:25 -03:00
Dan Winship
2fe8019a79 platform: merge remaining NMUdevManager functionality into NMLinuxPlatform
Merge the net-subsystem-monitoring functionality of NMUdevManager into
NMLinuxPlatform (and kill NMUdevManager). NMLinuxPlatform now only
emits link-added signals after udev processes the device, and uses
udev attributes to further identify the device. NMManager now
identifies devices solely based on the NMLinkType provided by the
platform.
2013-06-05 17:49:25 -03:00
Dan Winship
ce5da1933d core: split NMAtmManager out of NMUdevManager
Split the "atm"-subsystem-monitoring parts of NMUdevManager into a
separate class. Now NMUdevManager only handles "net"-subsystem device
enumeration.
2013-06-05 17:49:25 -03:00
Dan Winship
b15fb8641e core: split NMRfkillManager out of NMUdevManager
Split the rfkill-monitoring parts of NMUdevManager into a separate
class. Now NMUdevManager only handles device enumeration.
2013-06-05 17:49:24 -03:00
Aleksander Morgado
c3706810ef modem-manager: read 'SupportedCapabilities' instead of 'ModemCapabilities' (bgo #701668)
There is no longer a 'ModemCapabilities' uint32 property; instead we have
'SupportedCapabilities' giving a list of uint32 values. Just read the list and
merge the values into a single mask; NM doesn't care about the exact
combinations supported.

https://bugzilla.gnome.org/show_bug.cgi?id=701668
2013-06-05 12:59:32 -05:00
Dan Williams
b0863cbc4d mobile: don't fail in old MM code when using deprecated functions
We want to keep using these deprecated functions when talking to
the old ModemManager to ensure behavior is unchanged.
2013-06-05 12:42:12 -05:00
Aleksander Morgado
e682e6d6d0 modem-manager: don't request allowed modes when talking to ModemManager1 modems
Just let them get connected with whatever network type they currently have.
2013-06-05 12:17:09 -05:00
Dan Winship
f3db2ae95c platform: add some ifdefs to support kernel 3.6 2013-06-04 12:01:38 -03:00