Commit Graph

4279 Commits

Author SHA1 Message Date
Emilio Pozuelo Monfort
4be056f504 bluez: listen to Connected changes through NMBluezDevice 2013-09-25 21:01:03 +02:00
Emilio Pozuelo Monfort
180503eb1a bluez: listen to Connected changes in NMBluezDevice 2013-09-25 21:01:03 +02:00
Emilio Pozuelo Monfort
f422acc9d3 bluez: pass the NMBluezDevice down to the NMDeviceBt
So that the latter can use the former instead of listening
for changes over dbus.
2013-09-25 21:01:03 +02:00
Dan Williams
024f7e10b2 trivial: fix uninitialized bytes in ethtool driver name lookup
If the interface doesn't have an ethtool driver name, then '.driver'
will never be touched and (*drvinfo.driver) will access uninitialized
bytes.
2013-09-25 13:51:03 -05:00
Thomas Haller
c4e0326c21 core: fix resetting wrong field in nm_ip6_config_reset_addresses
Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-24 18:40:06 +02:00
Thomas Haller
661e47311d core: add const qualifier to functions in nm-ip[46]-config
Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-24 18:31:34 +02:00
Dan Winship
17607e74a2 infiniband: only check the last 8 bytes when doing hwaddr matches
IPoIB "hardware addresses" are only partly based on the hardware, and
partly based on the InfiniBand configuration. So when checking if a
configuration matches a device, we should only match the fixed part.
2013-09-24 11:54:35 -04:00
Dan Winship
5a39715f2d platform: fix InfiniBand partition handling
Fix infiniband_partition_add() to put the newly-created device into
the link_cache before returning. Fix link_is_software() to recognize
partition devices as software, so that link_get() is willing to return
them even before we get the udev info.
2013-09-24 11:54:34 -04:00
Dan Winship
b91d029021 core: short-circuit nm_device_spec_match_list()
If there are no specs, then the device can't match, so don't call the
virtual method (which might do work like building comparison strings
even when the list is empty).
2013-09-24 11:54:34 -04:00
Dan Winship
d20ac49dc9 platform: fix spelling of "announceable" 2013-09-24 11:54:34 -04:00
Jiří Klimeš
2b72214e52 platform: fix a crash when nm_platform_sysctl_get() returns NULL (rh #1010522)
nm_platform_sysctl_get() can return NULL on an error (when file specified by
'path' argument doesn't exist, can't be opened, etc.)

https://bugzilla.redhat.com/show_bug.cgi?id=1010522
2013-09-23 18:28:36 +02:00
Jiří Klimeš
28530239fa platform: fix a memory leak on an error 2013-09-23 18:28:36 +02:00
Jiří Klimeš
5471a6c678 ifcfg-rh: if IPv4 is disabled put DNS domains (DOMAIN) into IPv6 (rh #1004866)
The problem is that there is only a single variable in ifcfg file holding dns
domains - DOMAIN. Thus NetworkManager writes both IPv4 and IPv6 dns-search into
it. While reading there is no way to distinguish between IPv4 and IPv6 values,
so the DOMAIN value is read and only put into IPv4 dns-search.

But, when IPv4 is disabled or invalid, the domains got lost. So in such case
we put DOMAIN variable into IPv6 instead.

https://bugzilla.redhat.com/show_bug.cgi?id=1004866
2013-09-23 09:57:37 +02:00
Dan Williams
44ccf3454b supplicant: suppress more bus activation failure errors
These are expected errors if the supplicant can't be launched
for some reason.  We should only log entirely unexpected errors
like wrong method arguments or types, really odd failures, etc.

NetworkManager[1312]: <error> [1379601146.148818] [supplicant-manager/nm-supplicant-interface.c:853] interface_add_cb(): (wlan0): error adding interface: Did not receive a reply. Possible causes include: the remote application did not send a reply, the message bus security policy blocked the reply, the reply timeout expired, or the network connection was broken.
NetworkManager[1312]: <error> [1379601171.160742] [supplicant-manager/nm-supplicant-interface.c:853] interface_add_cb(): (wlan0): error adding interface: Activation of fi.w1.wpa_supplicant1 timed out
2013-09-19 11:16:47 -05:00
Jiří Klimeš
2e8746aab2 core: remove 'wep40' and 'wep104' from several places in NM
wep40 and wep104 are not valid values for 'pairwise' property and they are not
used for dynamic WEP as 'group' ciphers as well.

See https://bugzilla.redhat.com/show_bug.cgi?id=1005171 for some details.
2013-09-18 12:07:29 +02:00
Jiří Klimeš
76c34d48ed core,settings: do not call functions with connection==NULL (rh #1008151)
check 'req' and 'connection' variables. Apparently, they can be NULL
on some circumstances.

NetworkManager[2830]: <info> (p6p1): device state change: secondaries -> disconnected (reason 'connection-removed') [90 30 38]
NetworkManager[2830]: <info> (p6p1): deactivating device (reason 'connection-removed') [38]
kernel: [ 2623.609111] NetworkManager[2830]: segfault at 50 ip 00007f1a309bf6a1 sp 00007fffc59e67e0 error 6 in NetworkManager[7f1a30915000+104000]
NetworkManager[2830]: (nm-device.c:5043):nm_device_state_changed: runtime check failed: (in_state_changed == FALSE)
NetworkManager[2830]: <info> (p6p1): device state change: disconnected -> failed (reason 'secondary-connection-failed') [30 120 54]
NetworkManager[2830]: nm_act_request_get_connection: assertion `NM_IS_ACT_REQUEST (req)' failed
NetworkManager[2830]: nm_connection_get_id: assertion `connection != NULL' failed
NetworkManager[2830]: <warn> Activation (p6p1) failed for connection '(null)'
NetworkManager[2830]: nm_settings_connection_get_timestamp: assertion `connection != NULL' failed
abrt[2882]: Saved core dump of pid 2830 (/usr/sbin/NetworkManager) to /var/tmp/abrt/ccpp-2013-09-15-11:38:39-2830 (18952192 bytes)
systemd[1]: NetworkManager.service: main process exited, code=dumped, status=11/SEGV
systemd[1]: Unit NetworkManager.service entered failed state.

https://bugzilla.redhat.com/show_bug.cgi?id=1008151
2013-09-17 19:14:39 +02:00
Loïc Yhuel
19b7fe5ca2 core: fix bridge device creation
Since 2688ae4950, bridge device creation
fails with "(br0): cannot use existing bridge for 'Bridge'" warning.

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-17 11:11:27 +02:00
Dan Winship
1b6247fc27 sleep-monitor: add missing include 2013-09-13 09:05:07 -04:00
Bastien Nocera
bc4a8f51fb sleep-monitor: give better inhibition reason (bgo #704863)
https://bugzilla.gnome.org/show_bug.cgi?id=704863
2013-09-13 13:03:54 +02:00
Dan Williams
42b6c6eac0 core: fix call to nm_device_bring_up()
Typo in ebdf1796f1
2013-09-12 19:11:06 -05:00
Dan Winship
ebdf1796f1 core: implement :mtu and :cloned-mac-address for VLAN 2013-09-12 18:34:23 -04:00
Dan Winship
68bb65fbab core: fix nm_device_supports_vlans()
The platform knows which device types support VLANs, so just ask it,
rather than only doing VLANs on ethernet.
2013-09-12 18:34:23 -04:00
Dan Winship
e0f0f60ff5 core: remove nm_device_hwaddr_matches() / get_connection_hw_address()
These were only needed to support the possibility of VLANs having
arbitrary additional hardware settings.
2013-09-12 18:34:23 -04:00
Dan Winship
066b592241 all: standardize on NMSettingWired:mac-address for all VLANs
Currently, ethernet-based VLANs can specify the hardware address of
the parent device (and, in theory, the cloned hardware address and MTU
of the VLAN device) by using an NMSettingWired in addition to the
NMSettingVlan.

The theory was that non-ethernet-based VLANs, when we eventually
supported them, would likewise use the setting type corresponding to
their parent device. However, this turns out to be both complicated
(the settings plugins and connection editor would have a
hard-to-impossible time figuring out which setting type to use in some
cases) and incorrect (for most L2 settings [eg, BSSID, bond mode,
etc], the VLAN can't have its own values separate from the parent
device).

What we should have done was just have :mac-address,
:cloned-mac-address, and :mtu properties on NMSettingVlan. However, at
this point, for backward-compatibility, we will just stick with using
a combination of NMSettingVlan and NMSettingWired, but we will use
NMSettingWired regardless of the underlying hardware type.
2013-09-12 18:34:23 -04:00
Dan Winship
2688ae4950 core: move software device creation logic out of NMManager
Rather than having NMManager know how to parse various settings to
create each kind of software device, add a _new_for_connection()
constructor to each of them and let them call NMPlatform to create the
device correctly themselves.
2013-09-12 18:34:23 -04:00
Dan Winship
23d4973835 core: set VLAN ingress/egress maps at activation time
Rather than setting the VLAN maps when the device is created, set them
at activation time, which is more in line with how other device types
work.

Like the old code, this doesn't attempt to reset any existing
ingress/egress mappings on the device.
2013-09-12 18:34:23 -04:00
Dan Winship
fd85ec45b9 platform: fix VLAN ingress/egress map setting 2013-09-12 18:34:23 -04:00
Jiří Klimeš
49eda63e75 dhcp: add a testcase for distinguishing client identifier type
MAC-like string, but with an invalid char => plain ASCII string => quoted.
2013-09-09 09:14:38 +02:00
Dan Winship
a059309628 platform: recognize Open vSwitch interfaces as Generic devices (rh #1004356)
They look exactly like normal Ethernet interfaces, but they are managed
entirely by the Open vSwitch tools in software, so NM shouldn't (yet)
touch them.  Treat them instead as generic devices that only get touched
through direct user requests.
2013-09-06 19:39:11 -05:00
Dan Williams
b415b8a468 dhcp: add testcase for quoting problematic client identifiers 2013-09-06 11:20:08 -05:00
Jiří Klimeš
1ef19f377b dhcp: string vs. byte-array of dhcp-client-identifier (rh #999503)
Distinguish properly between ASCII strings and byte arrays for
dhcp-client-identifier. Else dhclient refuses to parse the configuration
file.
2013-09-06 11:20:00 -05:00
Jiří Klimeš
4255d72b21 build: fix distcheck - missing ifupdown test files in Makefile.am 2013-09-06 17:42:07 +02:00
Dan Williams
fa0112c0ca core: handle externally added IPv6 adresses and routes on IP change
Cache externally added IP details and represent them via the D-Bus
interface, and also merge them into the final device config to ensure
they aren't lost if DHCP renews or RA changes occur.
2013-09-05 14:24:06 -05:00
Dan Williams
d8c9828a4d core: add nm_ip6_config_subtract()
Removes anything in 'src' from 'dst'.
2013-09-05 14:24:06 -05:00
Scott Shambarger
04f6e09d50 ifcfg-rh: fix handling of legacy IPv4 route files without gateway.
Routes without gateway are legal and should be treated as a device route
(direct route).

https://bugzilla.gnome.org/show_bug.cgi?id=697525

The original patch was written by Scott Shambarger <scott-gnome@shambarger.net>.
This is a modified version of the patch.

Signed-off-by: Thomas Haller <thaller@redhat.com>
Reported-by: Scott Shambarger <scott-gnome@shambarger.net>
2013-09-05 21:13:15 +02:00
Thomas Haller
4e09b87d54 ifupdown: misc code cleanup for "add support for source stanza"
- make use of glib functions
- coding style

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-05 10:58:46 +02:00
Michael Wisheu
48ed1abca7 ifupdown: add support for source stanza
Since Debian 7 (Wheezy) / Ubuntu 11.04 (Natty Narwhal) ifupdown supports
the source stanza to source in other configuration files from
/etc/network/interfaces.

Add support to the ifupdown plugin to include configuration files via
source.

Patch did not apply cleanly and was slightly modified by Thomas Haller.

https://bugzilla.gnome.org/show_bug.cgi?id=707276

Signed-off-by: Thomas Haller <thaller@redhat.com>
Reviewed-by: Sebastian Harl <tokkee@debian.org>
2013-09-05 10:56:28 +02:00
Jiří Klimeš
650cbc6660 trivial: fix build by returning FALSE in gboolean nm_device_set_is_nm_owned()
g_return_val_if_fail (NM_IS_DEVICE (device), FALSE);
2013-09-05 09:14:57 +02:00
Thomas Haller
958ec36b96 core: delete virtual devices created by NM when they are deactivated.
Virtual/software devices that were created by NM should be deleted when
the device gets deactivated.

https://bugzilla.gnome.org/show_bug.cgi?id=695705
https://bugzilla.redhat.com/show_bug.cgi?id=953300

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-04 18:21:49 +02:00
Thomas Haller
c6458cab36 core: add flag is_nm_owned to NMDevice
Add a flag to indicate that the device is owned by NM.
This is interesting for software/virtual devices, that were created by
NM and should be deleted when the interface gets deactivated.

This flag is not implemented as a glib property.

Maybe this flag can be consolidated with the managed flag. For now it is
unclear how to do it, so add this flag. It should be easy later to
replace it again.

https://bugzilla.gnome.org/show_bug.cgi?id=695705
https://bugzilla.redhat.com/show_bug.cgi?id=953300

Signed-off-by: Thomas Haller <thaller@redhat.com>
2013-09-04 18:21:49 +02:00
Jiří Klimeš
ea78744555 settings: set deprecated 'security' for GetSettings() not to break old clients
Old clients might expect 802-11-wireless.security being set for secured Wi-Fi
connections. So to be on a safer side, we set the property in D-Bus GetSettings()
result.
2013-09-02 09:46:32 +02:00
Jiří Klimeš
284cce0405 test: remove deprecated 'security' property from tests
Adjust tests not to use deprecated 'security' property.
2013-09-02 09:46:31 +02:00
Jiří Klimeš
713755780f core: don't use deprecated 'security' property of wifi setting
That means replacing/removing
- nm_setting_wireless_get_security() function
- NM_SETTING_WIRELESS_SEC property
2013-09-02 09:46:31 +02:00
Jiří Klimeš
5157f9b0ae trivial: remove trailing TABs 2013-09-02 09:26:34 +02:00
Jiří Klimeš
5ce25c5eb4 ppp: fix getting username/password for Bluetooth connections (bgo #701507) 2013-09-02 09:09:38 +02:00
Dan Williams
1a42e764d4 core: fix handling of ActiveConnections on Policy dispose()
The manager has already disposed of the ActiveConnections by the time
the Policy is disposed, but the manager wasn't clearing the
active_connections list, so the Policy got a stale list of freed
objects.  Next, the manager wasn't always emitting ACTIVE_CONNECTION_REMOVED
when disposing of ActiveConnections, which the Policy listens to
for cleanup.  This lead to warnings on shutdown when the Policy
attempted to clean up for already disposed objects

Fix all this by ensuring the Manager signals when removing
ActiveConnections, which the Policy then uses to clean up
it's stuff, and ensuring the manager properly cleans up its
ActiveConnection list.
2013-08-30 18:00:18 -05:00
Pavel Šimerda
c6ba3ca51b core: use nm_platform_master_*_option() for bonds
Acked-by: Dan Winship <danw@gnome.org>
2013-08-31 00:47:11 +02:00
Pavel Šimerda
9e19c3dba5 core: use nm_platform_*_*_option() for bridges
And refactor to prepare for update_connection() implementation.

Acked-by: Dan Winship <danw@gnome.org>
2013-08-31 00:47:11 +02:00
Pavel Šimerda
e96b5d82bd platform: fix and simplify address lifetime compensation
Acked-by: Dan Williams <dcbw@redhat.com>
2013-08-31 00:47:11 +02:00
Pavel Šimerda
c5c8fbea12 trivial: remove unused 'existing' parameter from get_connections() 2013-08-31 00:47:11 +02:00