summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* fixup! libnm-core: validate property types from D-Bus (rh #1182567)danw/validate-proptype-rh1182567Thomas Haller2015-01-151-1/+1
|
* libnm-core: validate property types from D-Bus (rh #1182567)Dan Winship2015-01-152-7/+225
| | | | | | In _nm_setting_new_from_dbus(), verify that the properties have the right types, and return an error if not. (In particular, don't crash if someone tries to assign GBytes-valued property a non-'ay' value.)
* libnm-core: simplify _nm_setting_new_from_dbus()Dan Winship2015-01-151-9/+1
| | | | | | | | | libnm-util's nm_setting_new_from_hash() needed to call g_type_class_ref(setting_type) to ensure that the class had been initialized by the time we fetched its properties. But in libnm-core's version, we create the setting object before fetching the list of properties, so we know the class will already have been initialized by that point.
* libnm-core: fix a leak in _nm_setting_new_from_dbus()Dan Winship2015-01-151-4/+6
|
* connectivity: merge branch 'danw/connectivity-bgo742823'Dan Winship2015-01-152-24/+57
|\ | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=742823
| * connectivity: avoid redundant connectivity checksDan Winship2015-01-151-9/+17
| | | | | | | | | | | | Don't start an automatic connectivity check right when NMManager tells us we're online; only do it if the manager doesn't request an explicit connectivity check immediately afterward.
| * connectivity: simplify redundant codeDan Winship2015-01-152-5/+5
| | | | | | | | | | | | Merge the two nm_connectivity_set_online() calls into one, after tweaking NMConnectivity to always update its internal state before alerting callers to the new state.
| * connectivity: fix manager state during connectivity check (bgo #742823)Dan Winship2015-01-151-9/+5
| | | | | | | | | | | | | | When a connection has finished activating, but we don't know yet that we have full connectivity, then find_best_device_state() should return CONNECTED_SITE, not CONNECTING. Fixes a bug where the manager state would repeatedly switch between those two states.
| * connectivity: improve debug loggingDan Winship2015-01-151-1/+30
|/ | | | | | | | | | nm-connectivity was logging both "started" and "finished" for periodic connectivity checks, but was only logging "finished" for manual ones, which made the logs look weird. Fix it to log both periodic and manual starts, and differentiate them. Also add some additional logging to indicate when set_online() is called, and when :state changes.
* ifcfg-rh: update test files not to use obsolete GATEWAY<n> variablesJiří Klimeš2015-01-156-7/+50
| | | | | But add a dedicated test reading GATEWAY1 to ensure we are still backwards compatible.
* man: add description of BOOTPROTO to nm-settings-ifcfg-rh manpageJiří Klimeš2015-01-151-1/+11
|
* ifcfg-rh: read custom IP address for shared connections (rh #1174632)Jiří Klimeš2015-01-154-3/+76
| | | | | | | | | | | | | | | | Custom IP ranges for shared connection were implemeted in bgo #6759732 (commit 32a001f526c182fa70ede92ffc360112eb7fe9c6). The first IP address is used and a range is calculated. However, the commit missed to update ifcfg-rh plugin to read the address. Test case: * use ifcfg-rh plugin for NetworkManager $ nmcli con add type eth con-name shared-ip ifname eth0 $ nmcli con mod shared-ip ipv4.addresses 9.8.7.6/24 ipv4.method shared $ nmcli con show shared-ip $ nmcli con show shared-ip <--- ip address 9.8.7.6 was missing https://bugzilla.redhat.com/show_bug.cgi?id=1174632
* bond: allow overriding the MTUlr/bond-mtu-rh1177582Lubomir Rintel2015-01-141-0/+21
| | | | | | | Set the MTU if 802-3-ethernet.mtu is present and non-zero. The ifcfg-rh writer sets it if there's a MTU key. https://bugzilla.redhat.com/show_bug.cgi?id=1177582
* settings: merge branch 'th/uuid-duplicate-rh1171751'Thomas Haller2015-01-1319-372/+633
|\ | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1171751
| * settings: update year in copyright text of plugin-info for keyfile and ifcfg-rhThomas Haller2015-01-132-2/+2
| |
| * ifcfg-rh: don't reload connection in connection_ifcfg_changed() if ↵Thomas Haller2015-01-131-3/+10
| | | | | | | | | | | | | | | | monitoring is not enabled This was not really an error, because NMIfcfgConnection would not watch the files if monitoring is not enabled. Still do it, because it feels more correct.
| * ifcfg-rh: refactor update_connection()Thomas Haller2015-01-133-227/+231
| | | | | | | | | | | | | | | | Make update_connection() analogous to keyfiles implementation. Effectively merge _internal_new_connection() and update_connection() -- previously connection_new_or_changed(). https://bugzilla.redhat.com/show_bug.cgi?id=1171751
| * ifcfg-rh: sort paths in read_connections()Thomas Haller2015-01-131-7/+63
| | | | | | | | | | | | | | | | Presort the files in read_connections() as we do it for keyfile. This alone has not much consequences. Do this patch first, to keep the next patches more self-contained.
| * ifcfg-rh/trivial: rename connection_new_or_changed() and variableThomas Haller2015-01-131-60/+66
| | | | | | | | | | | | The ifcfg-rh implementation should be similar to the one from keyfile. Rename the variables and function that have the same meaning. Do this trivial commit first, before starting refactoring.
| * ifcfg-rh: add logging macros _LOGX() to plugin.cThomas Haller2015-01-131-19/+37
| |
| * settings: avoid duplicate UUID in settingsThomas Haller2015-01-135-4/+53
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When adding a connection to NMSettings we did not check for duplicate connection UUIDs (which could for example happen if two different plugins report a conflicting UUID). Also, we would not check that an already added connection changes it's UUID. Both could lead to have duplicate connections (by UUID). Avoid that two ways: - when adding a connection to NMSettings, ensure that we don't add a conflicting UUID. Otherwise just bail out and do nothing. - when modifying a connection that is already added to NMSettings, enforce that the UUID cannot change. Otherwise fail with error. For ifcfg-rh plugin this situation still can happen during reload. In this case error out and refuse to update the connection. After all, the user configured invalid UUIDs. https://bugzilla.redhat.com/show_bug.cgi?id=1171751
| * keyfile: ignore GFileMonitor change flags in dir_changed()Thomas Haller2015-01-131-3/+6
| | | | | | | | | | | | When writing a file (for example with `sed -i`) a temporary file might be created and removed quickly. This causes spurious events in dir_changed().
| * keyfile: reuse duplicate check from update_connection() in add_connection()Thomas Haller2015-01-131-58/+100
| | | | | | | | | | | | | | | | | | Also during add_connection() we must take special care of not "adding" a connection with a conflicting UUID. In that case we want to fallback to "update". update_connection() already does all the checks, so call update_connection() from add_connection().
| * keyfile: cleanup loggingThomas Haller2015-01-132-11/+26
| | | | | | | | | | Log lines with a "keyfile:" prefix and show more information about the loaded connection. Especially printing the UUID is interesting.
| * keyfile: read_connections() must skip duplicate connectionsThomas Haller2015-01-131-10/+72
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If there are keyfiles with duplicate UUIDs, read_connections() would iterate over the files, loading them as they appear and overwriting duplicate connections that were just loaded. For example, have keyfiles 'A' and 'B' with the same UUID. On start, NM might first load 'A', then 'B'. 'B' would replace the content of 'A' which was just loaded. On reload, NM would first overwrite 'B' with 'A', and then again overwriting 'A' with 'B'. Fix that by accept the first found connection and don't overwrite it during the same read_connections() run. Also sort the files by file modification timestamp so that we get a reproducible and sensible behavior.
| * keyfile: merge update_connection() and new_connection()Thomas Haller2015-01-131-102/+90
| | | | | | | | | | | | | | | | | | | | | | | | | | | | new_connection() and update_connection() are very similar as both must anticipate collisions of UUIDs. When reloading a connection (update_connection(), previously), the loaded connection for a certain path might actually replace another existing connection. In this case, the old connection must be removed, and the existing one updated instead. If reloading a connection changes the UUID to a new value, the old connection must be removed likewise and a new connection added. Merge both functions into update_connection().
| * keyfile/trival: move codeThomas Haller2015-01-131-17/+17
| |
| * keyfile: simplify g_return() checks for _internal_write_connection()Thomas Haller2015-01-131-5/+2
| |
| * settings: log connection diffs in replace_settings only where appropriateThomas Haller2015-01-1310-4/+16
| | | | | | | | | | | | | | | | | | | | Only log connection diffs when we update a connection that we actually care about. Note that most plugin specific connections use nm_settings_connection_replace_settings() in their constructor to initialize themselves. These occurrences are not interesting and spam the logfile.
| * settings: no need to check nm_connection_compare() before ↵Thomas Haller2015-01-131-5/+3
| | | | | | | | | | | | nm_settings_connection_replace_settings() nm_settings_connection_replace_settings() does nothing, if there are no changes.
| * settings: fix wrong assertions for calling ↵Thomas Haller2015-01-133-4/+8
| | | | | | | | nm_settings_connection_replace_settings()
| * core: log object type in nm_utils_log_connection_diff()Thomas Haller2015-01-131-4/+4
| |
| * core: log ignored property notification with level TRACEThomas Haller2015-01-131-2/+2
|/ | | | | Avoids for example: notify(): ignoring notification for prop visible on type NMKeyfileConnection
* ifnet: fix a crash in ifnet settings plugin (bgo #737645)Jiří Klimeš2015-01-132-2/+6
| | | | | | | | | | | | | conn_name can be NULL now as the connections are tracked by UUID (see commit 689dadaffbe0ba6f078a0bf3b8d5106788c289eb) Sep 29 21:20:34 Jdeapad NetworkManager[1339]: <info> getting unmanaged specs... Sep 29 21:20:34 Jdeapad NetworkManager[1339]: <info> Checking unmanaged: (null) Sep 29 21:20:38 Jdeapad kernel: NetworkManager[1339]: segfault at 0 ip 00007f1bfffbedd0 sp 00007fff98daa628 error 4 in libglib-2.0.so.0.4002.0[7f1bfff86000+130000] https://bugzilla.gnome.org/show_bug.cgi?id=737645
* merge: accept numeric bonding modes (bgo #704666) (rh #1133544) (rh #1171009)Jiří Klimeš2015-01-139-14/+152
|\ | | | | | | | | | | | | | | | | Bonding mode can be provided either as descriptive name of a numeric value (on D-Bus and ifcfg-rh too). https://bugzilla.gnome.org/show_bug.cgi?id=704666 https://bugzilla.redhat.com/show_bug.cgi?id=1133544 https://bugzilla.redhat.com/show_bug.cgi?id=1171009
| * ifcfg-rh: add a testcase for numeric bonding mode values in BONDING_OPTSJiří Klimeš2015-01-134-1/+40
| |
| * bond: normalize bond mode to string notation (rh #1171009)Jiří Klimeš2015-01-132-3/+41
| | | | | | | | | | | | | | | | Use descriptive string value as preferred bond mode representation. Numeric modes still verify but with NM_SETTING_VERIFY_NORMALIZABLE, suggesting a normalization action. https://bugzilla.redhat.com/show_bug.cgi?id=1171009
| * libnm-core: accept numeric bond modes (bgo #704666) (rh #1133544)Jiří Klimeš2015-01-131-10/+5
| | | | | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=704666 https://bugzilla.redhat.com/show_bug.cgi?id=1133544
| * utils: add functions for converting string <-> numeric bonding modesJiří Klimeš2015-01-133-1/+67
|/
* platform: merge branch 'th/route-fixes-bgo741871-v2'Thomas Haller2015-01-126-7/+206
|\ | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=741871
| * platform: suppress change event when deleting IPv4 route with metric 0Thomas Haller2015-01-123-4/+13
| | | | | | | | | | | | | | refresh_object() raised a spurious change event for the route we are about to delete. Suppress that by adding an internal reason flag. Fixes: 41e6c4fac1890e4302e4bfd1aa21be362cce51f2
| * platform/tests: add test for deleting IPv4 route with metric 0Thomas Haller2015-01-121-0/+70
| |
| * platform/tests: use assert_ip4_route_exists() functionThomas Haller2015-01-121-5/+5
| |
| * platform/tests: add ip4_route_exists() test functionThomas Haller2015-01-122-0/+112
| |
| * platform/tests: fix errors in fake platform handling route metricsThomas Haller2015-01-121-0/+8
|/
* platform: fix draining of the event queue with old libnl (rh #1180773)Lubomir Rintel2015-01-121-0/+6
| | | | | | It fails doesn't propagate EAGAIN properly. Fixed in 3.2.22's 375a629. https://bugzilla.redhat.com/show_bug.cgi?id=1180773
* core: ensure manager state is updated on resume with connectivity checking ↵Dan Williams2015-01-121-3/+2
| | | | | | | | | | | | | | | | | | | | | enabled (rh #1162636) (bgo #742675) On resume configured interfaces are unmanaged to clear their pre-resume state and then re-managed. Eventually the interface should end up moving to the DISCONNECTED state, which should trigger an auto-activate check in the Policy. If connectivity checking was enabled, that auto-activate check would fail because the Manager's state was still NM_STATE_ASLEEP. This caused bridge slaves not to auto-activate on resume, which left bridges without connectivity. The manager never left NM_STATE_ASLEEP when connectivity checking was enabled due to nm_manager_update_state() returning early when kicking off a connectivity check. Instead, the manager's state should always be updated to accurately reflect the current state. https://bugzilla.redhat.com/show_bug.cgi?id=1162636 https://bugzilla.gnome.org/show_bug.cgi?id=742675
* settings: fix up bad mergeLubomir Rintel2015-01-122-8/+2
| | | | Fixes: 24a464a7da9d5c66a14e503d7f753f0e249e358b
* dispatcher: merge branch 'danw/policy-based-routing-rh1160013'Dan Winship2015-01-1225-141/+269
|\
| * ifcfg-rh: allow handling complex routing rules via dispatcher (rh #1160013)Dan Winship2015-01-129-17/+95
| | | | | | | | | | | | | | | | If a connection has an associated "rule-NAME" or "rule6-NAME" file, don't try to read in the routes, since NetworkManager won't be able to parse them correctly. Instead, log a warning that they will need to be applied via a dispatcher script, and provide a script that would do that in examples/dispatcher/.