summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* fixup! core: convert pending actions from a counter to a GArraydcbw/startup-link-wait-rh1030583-rh1034921Thomas Haller2013-12-121-1/+1
|
* fixup! core: convert pending actions from a counter to a GArrayThomas Haller2013-12-121-4/+3
|
* core: ensure 'activation' pending action encompasses full activation processDan Williams2013-12-102-15/+8
| | | | | | | | | | | | | | | | | | The NMActiveConnection class tracks the full activation request, and internal activation requests go through the same process as external ones, including some authentication. Sometimes that means activation is scheduled, control returns to the mainloop, and then the activation proceeds from an idle handler. Unfortunately, that means that adding a pending "activation" action from nm-device.c doesn't always work, since there is a short window between when the activation is started in nm-manager.c (in nm_manager_activate_connection()) and when the device actually changes state. Inside that window, the pending actions may drop to zero, and startup will be declared complete before the device actually starts activating. Instead, ensure that the pending action is added when the internal activation is actually started (eg, when NMActiveConnection receives the NMDevice object).
* core: delay startup complete until carrier is found or timeout (rh #1034921) ↵Dan Williams2013-12-101-0/+37
| | | | | | | | | | | | | | | | | | | | | | (rh #1030583) Carrier state is only valid if the network interface is IFF_UP, because drivers are not required to do carrier detection if the device is not up. Thus, if NM is the first process to set the interface IFF_UP, there may be a short delay while the driver performs carrier detection. NetworkManager must suppress "startup complete" during this delay to ensure that the carrier state is known before making startup property decisions. Previously, when NetworkManager set the interface IFF_UP, the interface would not have a carrier for a few seconds until the driver's carrier detection was done. Since the interface had no carrier, NetworkManager could not begin connection activation on the interface, and the interface would not suppress the "startup complete" transition. Thus, NetworkManager would declare that startup was complete prematurely and anything depending on startup network connectivity would fail as no interfaces were active. https://bugzilla.redhat.com/show_bug.cgi?id=1034921 https://bugzilla.redhat.com/show_bug.cgi?id=1030583
* core: convert pending actions from a counter to a GArrayDan Williams2013-12-101-28/+97
| | | | | | | | | | | | This lets us do two things: 1) ensure that pending actions are unique and not doubly added/removed 2) we can (eventually) print out the pending action list for debugging However, since we cannot have two pending actions with the same name at the same time, we need to change the queued device state actions to include the state name. But that makes debugging even more descriptive so it's a bonus.
* keyfile: fix reader and writer for writing routesThomas Haller2013-12-094-152/+167
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Keyfile plugin writer had a bug, when writing IP6 routes with gateway "::". Instead of writing "net/plen,,metric" it wrote "net/plen,metric". - fix this bug and add test cases. Also, add a workaround to reader, to accept such wrongly written IP6 routes as valid. - change the writer for IP4 addresses, IP4 routes and IP6 routes to omit the gateway and the metric, if it is 0.0.0.0/::/0, respectively. Also change the reader, to accept such empty gateway as valid. It only omits the gateway, if the metric is not 0, this means it would write: route1=1.2.3.4/24,0.0.0.0,1 instead of route1=1.2.3.4/24,,1 Both representations are now supported by the reader, but older plugin versions could only read the former (thus, we keep writing that version). With a metric of zero, it would instead write: route1=1.2.3.4/24 - some refactoring and code cleanup. Fix a memory leak. https://bugzilla.gnome.org/show_bug.cgi?id=719851 Signed-off-by: Thomas Haller <thaller@redhat.com>
* keyfile: add test cases for reading route and addressesThomas Haller2013-12-092-4/+54
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* keyfile: be more strict when reading integer valuesThomas Haller2013-12-091-2/+3
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* rdisc: emit config_change signal for update of address lifetimeThomas Haller2013-12-091-2/+5
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* core: refactor ip6_addr_to_string in nm-dns-dnsmasqThomas Haller2013-12-091-38/+13
| | | | | | | | | | | | | | ip6_addr_to_string did assume, that inet_ntop might write a scope id to the result. But it does not (and cannot, because struct in6_addr does not have any interface identifer). Simplify and rework the function. Also fix a memory leak. https://bugzilla.gnome.org/show_bug.cgi?id=711684 Signed-off-by: Thomas Haller <thaller@redhat.com>
* all: refactor to make use of nm_utils_inet[46]_ntop functionsThomas Haller2013-12-097-216/+76
| | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=711684 Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-util: add nm_utils_inet[46]_ntop functionsThomas Haller2013-12-093-0/+67
| | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=711684 Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: add active connections to 'nmcli device status'Jiří Klimeš2013-12-091-8/+41
|
* libnm-util: bugfix wrong diff result in nm_connection_diffThomas Haller2013-12-091-7/+9
| | | | | | | | Commit 6abc7b78f68e2e815bf8a8cec2a3235e35bb07e4 introduced a bug in nm_connection_diff() by not reading the property value with g_object_get_property(). Signed-off-by: Thomas Haller <thaller@redhat.com>
* core: fuzzier matching of connections on startup (rh #1029859)Dan Williams2013-12-0525-95/+306
|\ | | | | | | | | | | | | | | | | | | | | Because it's not trivial to generate a connection that exactly matches one which was applied by NetworkManager before a restart, we need to make matching somewhat fuzzier. Mark any setting property that can be read from the system or kernel as INFERRABLE, and match only on those properties when trying to find the persistent connection (if any) which is already active on that device. https://bugzilla.redhat.com/show_bug.cgi?id=1029859
| * libnm-util: call virtual compare_property in nm_connection_diffThomas Haller2013-12-051-10/+7
| | | | | | | | | | | | | | | | nm_connection_diff must also use the virtual functions like nm_connection_compare. This way, settings can overwrite the default comparison of individual properties. Signed-off-by: Thomas Haller <thaller@redhat.com>
| * core: ignore gateway host route during connection generationDan Williams2013-12-052-0/+32
| | | | | | | | | | | | | | | | | | | | | | | | When a gateway is not in the prefix of any of the interface's IP addresses, NetworkManager adds a static host route to the gateway through the interface to ensure the gateway can be reached. That route will not be part of the persistent connection (since it was added automatically) but would normally be picked up by connection generation. This would cause the generated connection not to match with the persistent connection, because the persistent connection does not have the host route. Ignore the gateway host route when capturing the interface's existing IP configuration.
| * core: fuzzier matching of generated connections to persistent onesDan Williams2013-12-055-23/+123
| | | | | | | | | | | | | | | | | | | | | | | | | | | | When generating a connection, if the device has no non-link-local IPv6 address, then it's unclear whether (a) the connection was link-local originally, or (b) the connection was 'auto' but IPv6 failed or timed out. In this case, if there is a persistent connection that is 'auto' but the generated connection is 'link-local', the persistent connection should be used. Add a more-testable framework for doing the connection matching to handle this.
| * core: optimize generated connection matching a bitDan Williams2013-12-051-9/+13
| | | | | | | | | | Do a quick check to see if the connetion is compatible with the device before we start doing a relatively heavy connection comparison.
| * libnm-util: add INFERRABLE flag and remove CANDIDATEDan Williams2013-12-0519-62/+140
|/ | | | | | INFERRABLE means the opposite of CANDIDATE; a property which NetworkManager can read ("infer") from the system or the kernel when generating connections. CANDIDATE isn't a great name and thus dies.
* platform: fix uninitialized variable bcaddr in build_rtnl_addr()Jiří Klimeš2013-12-051-1/+1
| | | | | | | | | | platform/nm-linux-platform.c: In function 'build_rtnl_addr': platform/nm-linux-platform.c:116:15: error: 'bcaddr' may be used uninitialized in this function [-Werror=maybe-uninitialized] nl_addr_put (*object); ^ platform/nm-linux-platform.c:2264:32: note: 'bcaddr' was declared here auto_nl_addr struct nl_addr *bcaddr; ^
* core: suppress logging warning when trying to create existing directoryThomas Haller2013-12-041-2/+4
| | | | | | | Suppress logging the following line: <warn> Error creating directory "/var/run/NetworkManager": 17 (File exists) Signed-off-by: Thomas Haller <thaller@redhat.com>
* manager: handle NULL ifname in nm_manager_can_device_auto_connect gracefullyJiří Klimeš2013-12-041-0/+3
|
* manager: do not create software devices when device was manually disconnectedJiří Klimeš2013-12-041-2/+9
| | | | | | | | We can only create virtual interfaces when the connection has autoconnect property *and* the device was not manually disconnected before. Without this commit NetworkManager would auto-activate all virtual connections when a change was done (e.g. new virtual connection was addded).
* device: do not remove software devices on initial disconnected (rh #1035814)Jiří Klimeš2013-12-041-0/+2
| | | | | | | | | | | | | When a device is initialized to be managed, it will transition through states unmanaged -> unavailable -> disconnected. We don't want to remove software devices during this initial transition to disconnected, because it prevents auto-activation. Test case: $ nmcli con add type vlan ifname myvlan dev eth0 id 123 NM should immediately create myvlan interface and automatically activate it. https://bugzilla.redhat.com/show_bug.cgi?id=1035814
* agent-manager: if an agent returns UserCanceled, stopDan Winship2013-12-032-3/+13
| | | | | If an agent returns a UserCanceled error in response to a secrets request, don't ask any other remaining secret agents for secrets.
* settings: prefer secret agents in the same process as the requestDan Winship2013-12-035-11/+40
| | | | | | When an activation request requires secrets, if there is a secret agent in the process that made the request, then prefer that to all other secret agents.
* settings: port NMAgentManager, etc, to use NMAuthSubjectDan Winship2013-12-0318-108/+89
| | | | | | | | | | Rather than explicitly passing around a UID and a flag saying whether or not it's relevant. (This also fixes a bug where the wrong UID was being recorded in nm-settings-connection.c::auth_start(), which caused problems such as agent-owned secrets not getting saved because of a perceived UID mismatch.)
* core: make NMSessionMonitor non-refcountedDan Winship2013-12-037-44/+25
| | | | and ensure that main() frees the singleton before exiting
* platform: fix possible out-of-bounds access with RA route maskingDan Williams2013-12-031-3/+7
| | | | | If the prefix length was 128, that could cause an access beyond the end of the array. Found by Thomas Haller.
* platform: set IPv4 broadcast address too (rh #1032819)Dan Williams2013-12-031-0/+32
| | | | | | | When moving over the platform, setting of the IPv4 broadcast address got lost. Bring it back. https://bugzilla.redhat.com/show_bug.cgi?id=1032819
* trivial: remove duplicate codeDan Williams2013-12-021-1/+0
|
* core: connection matching and libnm-util cleanups (bgo #715196)Dan Williams2013-12-0231-265/+291
|\ | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=715196
| * core: generated slave connections should not have IP settingsDan Williams2013-12-021-20/+24
| | | | | | | | | | | | | | Slaves have no IP configuration and should not have any IP settings. This fixes connection comparison between generated slave connections and persistent slave connections, as persistent slave connections won't have any IP configuration.
| * core: updating a Generic setting should set the interface nameDan Williams2013-12-021-0/+8
| | | | | | | | | | Generic connections need an interface name, and that can only be stored in the Connection setting.
| * Revert "device: bind the generated loopback connection to 'lo' interface"Dan Williams2013-12-021-6/+0
| | | | | | | | | | | | | | | | | | This reverts commit 9a019f1fb5b7d99a7d4ec7af89212402ea81793a. Generic connections should be bound to their interface names in a more generic way instead of in nm-device.c. The Generic device itself should set the attributes it needs when generating the connection, like other device types do. This will be done in a following commit.
| * keyfile: ensure slave connections have the right settingsDan Williams2013-12-021-4/+31
| | | | | | | | | | | | | | | | | | If the connection describes a bridge/bond/team/etc slave, where the slave setting (like NMSettingBridgePort or NMSettingTeamPort) has all default values, the setting does not get written out because the plugin does not write default values. But then when reading the connection back in, we need to add that all-default slave type setting since it's required for a valid connection.
| * ifcfg-rh: write zero-value bridge and bridge port optionsDan Williams2013-12-021-5/+5
| | | | | | | | | | | | | | | | | | Zero values are actually valid values for various bridge options and should be written out. Otherwise, when reading the property back in, it gets assigned the default value which is often not zero, causing the wrong value to be set in the connection. Only properties with default values should not be written out.
| * libnm-util: remove usage of NM_SETTING_PARAM_SERIALIZEDan Williams2013-12-0227-230/+223
|/ | | | | The only property that is not serializes is each settings' 'name' property, so the flag serves no purpose.
* core: print peer_address in NMPlatform address_to_stringThomas Haller2013-12-021-2/+20
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* platform/core: add back support for PtP/peer addresses (rh #1018317)Dan Winship2013-12-0216-153/+118
| | | | | | | | | | | | | In the migration to NMPlatform, support for ptp/peer addresses was accidentally dropped. This broke OpenVPN configurations using 'p2p' topology, which send a different peer address than the local address for tunX, plus the server may also push routes that use the peer address as the next hop. NetworkManager was unable to add these routes, because the kernel had no idea how to talk to the peer, because the peer's address was not assigned to any interface or reachable over any routes. Partly based on a patch from Dan Williams.
* cli: fix nmcli help for connection object (rh #1036545)Jiří Klimeš2013-12-021-1/+1
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=1036545
* manager: fix connection auto-activation in timestamp-based order (rh #1029854)Jiří Klimeš2013-11-292-3/+11
| | | | | | | This commit fixes a regression from a1f16cd4d9fff66d7feeee0846e554c9c3a5f998 (nm-policy.c change). https://bugzilla.redhat.com/show_bug.cgi?id=1029854
* examples: update examples for new device typesJiří Klimeš2013-11-293-2/+16
|
* trivial: update a commentJiří Klimeš2013-11-291-4/+3
|
* nmcli: fix connecting VLANs without an explicit interface-name (rh #1034908)Jiří Klimeš2013-11-281-5/+26
| | | | | | | | | nm_connection_get_virtual_iface_name() doesn't work when determining virtual connections, because for VLANs it can return NULL. See also commit e1e4740648d3ee522c8a80d1af6282afce94f53d. https://bugzilla.redhat.com/show_bug.cgi?id=1034908
* tools: enhance description for the nm-settings manual pageJiří Klimeš2013-11-281-13/+28
|
* tools: add team, team-port and dcb settings into generate-settings-spec.cJiří Klimeš2013-11-281-6/+12
|
* Revert "libnm-util: refactor NMSetting construction, assert of setting name"Jiří Klimeš2013-11-281-3/+27
| | | | | | | This reverts commit f43586fc179b3e7ca82be110390c04336b5da37b. This broke stuff as "name" was set on various places after construction. So we revert the commit for now, and will rework it.
* dhcp: dhcpcd uses a fixed path for PID filesDan Williams2013-11-272-1/+5
| | | | | It always uses RUNDIR and the change to NMRUNDIR was in error. This could cause NetworkManager not to be able to kill old dhcpcd processes.