summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* core: allow multiple devices with the same interface namedcbw/devices-for-allDan Williams2015-12-045-122/+191
| | | | | | | | | | | | | | | | | | | | | | | | | But, of course, only one realized device can have the same interface name at a time. This commit effectively reverts most of: 1b37cd03409fa3c0fb26fb6e8093b54b2b7c5d8d core: allow ActiveConnections to be created without a device But it's not easy to do a separate revert of that code due to interdependencies with nm-manager.c. Creating devices when they are defined by a connection also makes makes it possible to require the NMDevice to be present when activating it, which means we can remove a bunch of code from NMManager that had to handle software devices not existing yet at the time of the activation request. But it also means we must be more careful when finding master interfaces during slave activation, since we cannot simply match by interface name alone. Instead we must find the master which matches both the interface name and can control slaves of the type which is being activated.
* libnm/libnm-glib: add NMClient.get_all_devices() method and AllDevices propertyDan Williams2015-12-0411-41/+387
| | | | | Mirror new NetworkManager API to return both real devices and device placeholders.
* test: some refactoring of test-networkmanager-service.pyThomas Haller2015-12-041-46/+43
|
* api/manager: add GetAllDevices() method and AllDevices propertyDan Williams2015-12-044-13/+104
| | | | Returns both realized and un-realized devices.
* core: ensure platform links are compatible with the NMDeviceDan Williams2015-12-0419-29/+125
| | | | | | | | Ensure the platform link with the same interface name as the NMDevice is actually compatible with it before using the link for initialization of device properties. If not, remove the NMDevice and create a new one since there are kernel resources with a different type.
* core: create devices first and realize them laterDan Williams2015-12-0413-277/+354
| | | | | | | | | | | | | | | | | | | | Unrealized devices aren't backed by kernel resources and so won't know all of their attributes. That means three things: 1) they must update their attributes when they become realized 2) they must clear those attributes when unrealized 3) they must be looser in checking compatible connections until they are realized This requires that the setup() function be split into two parts, start & finish, because finish must be run after add_device() Also, we can simplify whether to pay attention to 'recheck-assume', which is now dependent on priv->is_nm_owned, because the only case where NM should *not* listen for the 'recheck-assume' signal is when the device is a software device created by NM itself. That logic was previously spread across the callers of add_device() but is now consolidated into nm-manager.c::device_realized() and nm-device.c::nm_device_create_and_realize().
* ip-tunnel: don't update_properties() during ↵Thomas Haller2015-12-041-4/+0
| | | | | | | | | update_connection()/check_connection_compatible() The device properties are obtained via netlink, thus we get proper platform notifications whenever they change. So the device properties always reflect the platform state and there is no need to refresh it during update_connection()/check_connection_compatible().
* ip-tunnel: let update_properties_from_ifindex() clear properties on failureThomas Haller2015-12-041-4/+5
|
* ip-tunnel: refactor update_properties in NMDeviceIPTunnelThomas Haller2015-12-041-26/+40
| | | | | let update_properties_from_ifindex() also support clearing the properties to make it usable from unrealize().
* core: add class function for device unrealizationDan Williams2015-12-047-9/+217
| | | | | When a device is unrealized, its class-specific properties must also be cleared since the device is no longer valid.
* libnm-glib/libnm: add support for "real" NMDevice propertyDan Williams2015-12-046-0/+89
|
* core: add "real" NMDevice propertyDan Williams2015-12-044-6/+74
| | | | | | | This property is TRUE for devices that exist either as a kernel device or are backed by some other resource (eg, ModemManager object, Bluez device, etc). It will eventually be FALSE for software devices that are not yet instantiated.
* device: let NM_DEVICE_MASTER be equal to nm_device_get_master()Thomas Haller2015-12-041-1/+1
| | | | | | | | | | | | | | | There is only one user of the NM_DEVICE_MASTER property (NMActiveConnection). device_master_changed() uses the property for change notifications, but returns early if !nm_device_get_master(). We might emit the "notify::master" signal too often, even when nothing changed (because currently we always emit it when priv->master changes). If we would fix that to only emit the signal when nm_device_get_master() actually changes, it would still be correct, because device_master_changed() doesn't care about notifications when the master is unset. Hence, the only user doesn't care about the difference. So change it because it's unexpected that the property and function are not completely equal.
* utils: construct paths array directly in ↵Thomas Haller2015-12-041-7/+8
| | | | | | | nm_utils_g_value_set_object_path_array() nm_utils_g_value_set_object_path_array() is used at several places, so that this optimazation makes some sense.
* utils: add @filter_func argument to nm_utils_g_value_set_object_path_array()Dan Williams2015-12-046-7/+27
|
* device: split new_device_added() out of component_added()Thomas Haller2015-12-044-32/+55
| | | | | | | | | | | Commit cd3df12c8f8ed6c868c12bc4e7fe6ba162dafc5b reused the virtual function component_added() to notify the vlan device about a possibly new parent. This reuse of the virtual function for another purpose is confusing. Clean that up by splitting the implementation and add a new virtual function nm_device_notify_new_device_added() which gets (only implemented by NMDeviceVlan).
* libnm-glib: queue added/removed signals and suppress uninitialized notificationsLubomir Rintel2015-12-041-50/+181
| | | | | | This is a straightforward copy of the changes done in libnm. It is done to cope with test failures due to redundant or misordered signals. See commit 52ae28f6e5bf68c575145f633f7c85c145aa20fe for a detailed explanation.
* device: fix disconnecting slave-device when master gets deletedThomas Haller2015-12-041-12/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When deleting a master-device either via `nmcli device delete` or `ip link delete`, the slave-device would hang. This seems to be broken for a very long time already. This is due to the following: #0 0x00005555555f548c in nm_device_slave_notify_release (self=0x555555dc1300, reason=NM_DEVICE_STATE_REASON_NONE) at devices/nm-device.c:2175 #1 0x00005555555d6de2 in nm_device_release_one_slave (self=0x555555de3dd0, slave=0x555555dc1300, configure=0, reason=NM_DEVICE_STATE_REASON_NONE) at devices/nm-device.c:1117 #2 0x00005555555f02b7 in device_link_changed (self=0x555555dc1300) at devices/nm-device.c:1460 Previously, nm_device_slave_notify_release() being called with reason "NONE" did not actually transition the device-state, thus keeping the device wrongly in activated state. There were two callers that passed configure=FALSE to nm_device_release_one_slave(), (and thus reason=NONE to nm_device_slave_notify_release()): - (1) device_link_changed(): nm_device_release_one_slave (priv->master, self, FALSE, /*wrong reason NONE*/); - (2) nm_device_removed(): nm_device_release_one_slave (priv->master, self, FALSE, NM_DEVICE_STATE_REASON_REMOVED); We should always change the device-state during nm_device_slave_notify_release() regardless of the reason. (2) was added by commit c83b40aca76fc0ed624a6c9e71dbd7b0abfa13f2, later refined by commit 5dd48f7527c67b399ac144f594e035216771d61c. In a way change the second fix to perform some of the configuration (but still not unenslaving the device).
* cli: remove duplicated checks for running NetworkmanagerJiří Klimeš2015-12-031-12/+0
| | | | It is already performed in do_connections().
* dhcp: lifetimes are unsigned integers, use %u printf specifier (rh #1268911)Jiří Klimeš2015-12-031-3/+3
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=1268911
* platform/tests: adding missing checks for loaded modulesBeniamino Galvani2015-12-021-3/+25
| | | | | | | | | Check if 'ipip' and 'ip6_tunnel' modules are loaded when trying to perform link tests that require them and skip the tests if the modules are not available. Fixes: 133724d95805142e29c6d34a7bc201368e7a9d05 Fixes: 1a3448b43bb122243b7f9730e2ed7d62ab0a4c1e
* merge: branch 'bg/device-creation-ip-tunnel-bgo758047'Beniamino Galvani2015-12-0142-385/+4119
|\ | | | | | | | | | | Add support for creating IP tunnel interfaces. https://bugzilla.gnome.org/show_bug.cgi?id=758047
| * libnm-glib: add support for IP tunnel devices as generic onesBeniamino Galvani2015-12-012-0/+3
| |
| * libnm: add NMDeviceIPTunnelBeniamino Galvani2015-12-017-0/+653
| |
| * device/ip-tunnel: add support for IP6TNL tunnelsBeniamino Galvani2015-12-013-5/+143
| |
| * device/ip-tunnel: add support for IPIP tunnelsBeniamino Galvani2015-12-011-1/+45
| |
| * device/ip-tunnel: add support for SIT tunnelsBeniamino Galvani2015-12-011-1/+45
| |
| * device: remove NMDeviceGreBeniamino Galvani2015-12-016-426/+1
| | | | | | | | | | As per previous commit, GRE tunnels are now represented as generic IP tunnel devices.
| * device: add NMDeviceIPTunnelBeniamino Galvani2015-12-0111-3/+903
| | | | | | | | | | | | | | | | | | | | | | | | The new object type represents tunnels over IPv4 and IPv6. We have a single setting type (NMSettingIPTunnel) for tunnels and it can't be shared among different device factories. So we define also a single device type for all tunnels. This new object will also represent GRE tunnels, which before were instantiated as NMDeviceGre and had a ".Device.Gre" D-Bus interface. This commit introduces a change in behavior.
| * platform/tests: test IP6TNL linksBeniamino Galvani2015-12-013-0/+77
| |
| * platform/tests: test IPIP linksBeniamino Galvani2015-12-013-0/+59
| |
| * platform/tests: test SIT linksBeniamino Galvani2015-12-013-0/+71
| |
| * platform/tests: test GRE links also using platform codeBeniamino Galvani2015-12-013-6/+48
| |
| * platform: add IP6TNL links supportBeniamino Galvani2015-12-016-0/+264
| |
| * platform: add IPIP links supportBeniamino Galvani2015-12-016-0/+218
| |
| * platform: add SIT links supportBeniamino Galvani2015-12-016-0/+248
| |
| * platform: add GRE links creation supportBeniamino Galvani2015-12-013-4/+114
| |
| * cli: add support for IP tunnel settingsBeniamino Galvani2015-12-013-2/+325
| |
| * libnm-core: add NMSettingIPTunnelBeniamino Galvani2015-12-0111-1/+889
| | | | | | | | | | | | | | Add a generic NMSettingTunnel which describes properties of tunnels over IPv4 and IPv6 (GRE, SIT, IPIP, IPIP6, IP6GRE, etc.). Since those tunnel types all have similar properties it makes sense to have a single setting type for them.
| * libnm-core: add nm_utils_enum_get_values()Beniamino Galvani2015-12-014-0/+77
|/ | | | | | Add function nm_utils_enum_get_values() which returns a string array containing the enum values. It can be used, for example, to build a list of allowed values for user.
* libnm: avoid loosing signalsLubomir Rintel2015-12-012-10/+79
| | | | | | | | | | | D-Bus has an upper limit on number of Match rules and it's rather easy to hit as the proxy likes to add one for each object. Let's remove the Match rule the proxy added and ensure a less granular rule is present instead. Ideally, we should be able to tell glib not to hook its rules. Related: https://bugzilla.gnome.org/show_bug.cgi?id=758749 https://bugzilla.gnome.org/show_bug.cgi?id=758751
* wifi: only try adding supplicant interface 5 times on errors (bgo #753971)Jiří Klimeš2015-11-301-1/+36
| | | | | | | | | | | | | | | | | | | | | When wpa_supplicant keeps returning an error, NetworkManager was trying over and over again. Which resulted in endless messages: <error> [1448462154.584916] [supplicant-manager/nm-supplicant-interface.c:879] interface_add_cb(): (AAA): error adding interface: wpa_supplicant couldn't grab this interface. NetworkManager[17073]: <info> (AAA): supplicant interface state: starting -> down Testcase: $ iw list | grep -A 3 "interface combinations" interface combinations are not supported HT Capability overrides: * MCS: ff ff ff ff ff ff ff ff ff ff * maximum A-MSDU length $ sudo iw wlan0 interface add AAA type managed ... $ sudo iw dev AAA del Fixes: 3a2e6de0d30217753c825ba1f20e589c1f647780 https://bugzilla.gnome.org/show_bug.cgi?id=753971
* Revert "systemd: fix potential memory leaks"Thomas Haller2015-11-281-3/+1
| | | | | | | | | @random_data is declared as _cleanup_free_. Freeing it is unnecessary and freeing without clearing the pointer leads do a double free. This reverts commit 3d1557eaad4d408218bee8996c3721eb2aa5e22c.
* man: add missing description of tun parameters in nmcli manual pageJiří Klimeš2015-11-281-0/+16
| | | | Fixes: 64c6b124d24c0cd06b2868b4ca6a71f8e78e6c00
* cli: allow TAB-completion for tun.mode in nmcli editorJiří Klimeš2015-11-281-1/+5
| | | | Fixes: 64c6b124d24c0cd06b2868b4ca6a71f8e78e6c00
* cli: allow TAB-completion of "Mode:" in 'nmcli -a con add type tun'Jiří Klimeš2015-11-281-14/+33
| | | | Fixes: 64c6b124d24c0cd06b2868b4ca6a71f8e78e6c00
* cli: ask user before requiring optional parameters for 'nmcli -a con add ↵Jiří Klimeš2015-11-281-0/+4
| | | | | | type tun' Fixes: 64c6b124d24c0cd06b2868b4ca6a71f8e78e6c00
* cli: fix an error in setting s390-options in nmcli editorJiří Klimeš2015-11-281-1/+12
| | | | | nmcli> set eth.s390-options portno= (process:4711): libnm-CRITICAL **: nm_setting_wired_add_s390_option: assertion 'value_len > 0 && value_len < 200' failed
* cli: fix an error in nmcli editor when setting vpn.data/vpn.secretsJiří Klimeš2015-11-281-2/+15
| | | | | | | nmcli> set vpn.data haha= (process:3951): libnm-CRITICAL **: nm_setting_vpn_add_data_item: assertion 'strlen (item) > 0' failed nmcli> set vpn.secrets haha= (process:3951): libnm-CRITICAL **: nm_setting_vpn_add_secret: assertion 'strlen (secret) > 0' failed
* cli: fix a crash in 'nmcli -a con clone'Jiří Klimeš2015-11-281-6/+16
| | | | | | when providing empty arguments. Fixes: 0c65b289601d46edb0a950e291ddd376e368ccfd