summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* core: log a identifying token for dbus objects when a property changesth/LOGThomas Haller2013-11-221-3/+2
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* core: refactoring logging in NMDevice to prefix each line with identifierThomas Haller2013-11-222-44/+61
| | | | | | | | | | | Add new macro LOG and LOg, to prefix the log line with a pointer value as identifier. The use of having these macros is that every line gets the same identical prefix with the same format. nm-device.c defines additional macros, to make their usage more concise. Signed-off-by: Thomas Haller <thaller@redhat.com>
* core: ignore RA-provided default routes (rh #1029213)Dan Williams2013-11-201-5/+11
| | | | | | | | | The router has no idea what the local configuration or user preferences are, so sending routes with a prefix length of 0 is at best misinformed and at worst breaks things. The kernel also ignores plen=0 routes in its in-kernel RA processing code in net/ipv6/ndisc.c. https://bugzilla.redhat.com/show_bug.cgi?id=1029213
* core: do not generate a connection for loopback interface (rh #1032594)Jiří Klimeš2013-11-201-9/+10
| | | | | | | Else loopback is managed, and could be easily disconnected, which causes various issues with applications. So do not manage it for now, to be on the safer side. https://bugzilla.redhat.com/show_bug.cgi?id=1032594
* dispatcher: fix crash while logging from signal handlerThomas Haller2013-11-191-20/+10
| | | | | | | | | | | | | | | | | | Bug rh#1017884 describes a crash, where dbus_init() failed, which causes a g_warning(). While writing the warning, a SIGTERM hit, and the signal_handler() tries to call again g_message(). The logging functions of glib are not reentrant and call abort() when invoked recursivly. The solution, is to use g_unix_signal_add, which will dispatch the handler on the mainloop asynchronously. This bug is not that serious, because the dispatcher was about to terminate anyway. However, it gets registered as a crash by the system (ABRT). https://bugzilla.redhat.com/show_bug.cgi?id=1017884 Signed-off-by: Thomas Haller <thaller@redhat.com>
* libnm-glib: fix crash by taking additional ref in nm-remote-connection/result_cbThomas Haller2013-11-181-0/+2
| | | | | | | | | | | | result_cb invokes a function pointer provided by the user. Nothing prevents the user from destroying the NMRemoteConnection in the callback, which leads to a crash. Take an additional ref of NMRemoteConnection to keep it alive. This probably caused a crash for nm-applet: https://bugzilla.redhat.com/show_bug.cgi?id=1030403 Signed-off-by: Thomas Haller <thaller@redhat.com>
* device: remove invalid assertion in slave_state_changed()Jiří Klimeš2013-11-181-1/+0
| | | | | | | | | | | | | | | | When activating a team slave and 'teamd' binary is not installed, the priv->state of master device will be NM_DEVICE_STATE_FAILED, which is greater than NM_DEVICE_STATE_ACTIVATED. <info> Activation (nm-team) Stage 1 of 5 (Device Prepare) started... <warn> Activation (nm-team) to start teamd: not found <info> (nm-team): device state change: prepare -> failed (reason 'none') [40 120 0] ... <debug> master_state_cb(): (0x81d6968): master ActiveConnection [0x91d69d0] 'team0' failed <info> (eth1): device state change: config -> failed (reason 'dependency-failed') [50 120 50] ... <debug> slave_state_changed(): (nm-team): slave eth1 state change 50 (config) -> 120 (failed) --- ASSERTION ---
* build: fix for `make distcheck` without enable-gtk-docThomas Haller2013-11-182-1/+2
| | | | | | | | | | | | | | | | | | | Without this patch, the following fails with a rather obscure message about missing make target. ./autogen.sh && make && make distcheck ... *** No rule to make target `NetworkManager.8', needed by `distdir'. Stop. Swap the order of the subdirectories 'docs' and 'man' to build 'docs' earlier. This way, `make distcheck` fails in the directory 'docs' with a better error message: *** gtk-doc must be installed and enabled in order to make dist Also, add 'man/nmcli-examples.5' to the list of files, to determine whether to use the pre generated doc files. Signed-off-by: Thomas Haller <thaller@redhat.com>
* trivial: fix some prototypesDan Williams2013-11-181-2/+2
|
* cli: bash completion must not suggest IP options for adding slave typesThomas Haller2013-11-181-0/+3
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* trivial: ifcfg-rh: remove unused code/variablesThomas Haller2013-11-181-3/+0
|
* cli: add missing reason-to-string mappings for NMDeviceStateReasonJiří Klimeš2013-11-181-0/+7
|
* doc: fix description of nm_setting_set_secret_flags()Jiří Klimeš2013-11-181-1/+1
|
* team: correct the message telling the teamd binary is missingJiří Klimeš2013-11-181-1/+2
|
* cli: add 'config' option to bash completion when adding team-slave connectionThomas Haller2013-11-181-1/+1
| | | | | | | Like 'team', 'team-slave' also understands the property 'config'. Add it to bash completion for the 'connection add' command. Signed-off-by: Thomas Haller <thaller@redhat.com>
* settings: fix return value in nm_system_config_interface_load_connection()Jiří Klimeš2013-11-181-1/+1
| | | | when g_return_val_if_fail fails.
* libnm-glib: fix return value in nm_remote_settings_load_connections()Jiří Klimeš2013-11-181-2/+2
| | | | when g_return_val_if_fail() fails.
* cli: adjust bash completion for `nmcli connection load <file>...`Thomas Haller2013-11-151-0/+6
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: add "nmcli con load file..."Dan Winship2013-11-152-2/+57
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=709830
* libnm-glib: add nm_remote_settings_load_connections()Dan Winship2013-11-153-0/+77
| | | | https://bugzilla.gnome.org/show_bug.cgi?id=709830
* core: add o.fd.NM.Settings.LoadConnectionsDan Winship2013-11-156-7/+163
| | | | | | | Add a D-Bus method to reload connection files specified by filename, and implement it in the ifcfg-rh and keyfile backends. https://bugzilla.gnome.org/show_bug.cgi?id=709830
* devices: use disable_ipv6 as appropriateDan Winship2013-11-151-3/+30
| | | | | | | | | | | | | | | Set and clear disable_ipv6 on devices as needed to ensure that: 1) devices never get IPv6 link local addresses until they are actually activated 2) devices always lose their IPv6 link local addresses when they are deactivated 3) slaves never get IPv6 link local addresses at all https://bugzilla.gnome.org/show_bug.cgi?id=700414 https://bugzilla.redhat.com/show_bug.cgi?id=1004255
* devices: enable/disable kernel IPv6 autoconf at the appropriate timesDan Winship2013-11-151-22/+16
| | | | | | | | | | | | | Set accept_ra and use_tempaddr to "0" when managing a device (and restore them to their original values after unmanaging it) to ensure that calling nm_device_bring_up() on a managed device won't ever cause kernel IPv6 autoconf to happen. Remove some other redundant accept_ra setting. Fix up the deconfigure case of dispose() to clear the device's IP6 config as well as its IP4 config. https://bugzilla.gnome.org/show_bug.cgi?id=700414
* devices: clean up accept_ra/use_tempaddr handlingDan Winship2013-11-151-68/+45
| | | | | | | | | | | | | | | | | | | | | | | | | | update_accept_ra_path() and update_ip6_privacy_save() were freeing their path variables if they failed to read the existing values, but if this ever actually happened it would cause problems later since other code assumed that the variables were always set. Use "priv->ip6_accept_ra_save = -1", etc, instead to indicate that the value couldn't be read (and so shouldn't be restored later). Merge the accept_ra and use_tempaddr code save/restore code together, since they're always called together. Fix the accept_ra-restoring code to correctly handle an original value of "2". Call update_ip6_properties_paths() from nm_device_set_ip_iface() rather than act_stage3_ip6_config_start(), since set_ip_iface() is when the paths actually change. Also, split the default-value-saving code out into a separate function, since we only care about doing that at construct time; if the IP6 property paths change later (because iface != ip_iface), then we don't need to save and restore the values on the ip_iface, since the interface will go away when we're done with it. https://bugzilla.gnome.org/show_bug.cgi?id=700414
* devices: rename ip6_privacy_tempaddr_* vars to match sysctlDan Winship2013-11-151-19/+19
| | | | | | Rename ip6_privacy_tempaddr_path and ip6_privacy_tempaddr_save to ip6_use_tempaddr_*, to match the sysctls, for consistency with the accept_ra variables.
* devices: "deactivate" devices when going from UNMANAGED->UNAVAILABLEDan Winship2013-11-151-2/+4
| | | | | | | | We used to call nm_device_deactivate() when moving a device from UNMANAGED to UNAVAILABLE (unless we were assuming the existing connection), but this got lost when default-unmanaged was added. Fix it to do this again, so the device will be in a known-clean state when it is activated.
* core: remove redundant sysctl utilitiesDan Winship2013-11-156-142/+43
| | | | | | NMDevice was still using the old sysctl functions from NetworkManagerUtils rather than the new NMPlatform ones. Fix it, and remove the old functions.
* libnm-glib: fix a crash in NMObjectDan Winship2013-11-141-0/+3
| | | | | | | deferred_notify_cb() needs to take a ref on the object around emitting its deferred signals, since otherwise if a notify:: handler drops the last reference on an object, a following g_object_notify() call would crash.
* core: allow default wired connections to stay up when quittingDan Williams2013-11-143-4/+9
| | | | | | | | | Previously, the default wired connection was removed on quit when the device was cleaned up. This is inconsistent with other connections. Leave the default wired connection up when quitting to fix this inconsistency. This allows default wired connections to be assumed when NM starts.
* settings: simplify connection signal handlingDan Williams2013-11-141-55/+34
| | | | No need to store the ID since we can use g_signal_handlers_disconnect_by_func()
* device: bind the generated loopback connection to 'lo' interfaceJiří Klimeš2013-11-141-0/+6
| | | | | | | | | | It is useful to bind the loopack connection to the loopback interface, and it also allows activating it. $ nmcli con up lo Else "Error: no device found for connection 'lo'" is returned, because connection_compatible() in libnm-glib/nm-device-generic.c wants the connection to have an interface-name set.
* cli: allow editing 'generic' connectionsJiří Klimeš2013-11-141-0/+8
|
* cli: fix crash on editing 'lo' connection (rh #1030395)Jiří Klimeš2013-11-141-1/+1
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=1030395
* platform: dump objects that fail to be added (rh #1029213)Dan Williams2013-11-131-0/+5
| | | | Attempt to figure out why the objects fail.
* core: fix re-activation of existing active connectionDan Winship2013-11-131-6/+9
| | | | | | The change to allow an NMConnection to only be active on a single device accidentally broke the case of re-activating a connection on the same device. Fix that.
* settings: convert NMDefaultWiredConnection into a plain NMSettingsConnection ↵Dan Williams2013-11-136-348/+118
| | | | | | | | | | | | | | | | | | | | | | (rh #1029464) (bgo #712188) Changing the default wired connection has always deleted the connection (thus disconnecting the interface) and re-added it as a settings plugin connection. That was always sub-optimal, but until the 'unsaved' connection stuff landed this summer, we couldn't do anything about that. Clean that all up, adding the connection as an unsaved connection right from the start, which allows changes to the connection without having to delete and recreate it, thus preventing disconnection of any interface that is using the connection. A new signal is added to NMSettingsConnection that is only emitted when the connection is changed from D-Bus (thus indicating an explicit user- requested change) since the connection may be modified internally by NetworkManager. NM-triggered changes should not result in the connection no longer being a default-wired connection. https://bugzilla.gnome.org/show_bug.cgi?id=712188 https://bugzilla.redhat.com/show_bug.cgi?id=1029464
* coverity: fix various warnings detected with Coverity (fixup)Thomas Haller2013-11-133-3/+9
| | | | | | | I missed to implement the remarks from https://bugzilla.redhat.com/show_bug.cgi?id=1025894#c4 Signed-off-by: Thomas Haller <thaller@redhat.com>
* coverity: fix various warnings detected with CoverityThomas Haller2013-11-1340-124/+143
| | | | | | | | | | | | | These are (most likely) only warnings and not severe bugs. Some of these changes are mostly made to get a clean run of Coverity without any warnings. Error found by running Coverity scan https://bugzilla.redhat.com/show_bug.cgi?id=1025894 Co-Authored-By: Jiří Klimeš <jklimes@redhat.com> Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: fix reading IP config for *-slavesThomas Haller2013-11-131-2/+4
| | | | | | | | Error found by running Coverity https://bugzilla.redhat.com/show_bug.cgi?id=1025894 Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: fix potential crash in nmcli when using strcmpThomas Haller2013-11-131-3/+3
| | | | | | | | Error found by running Coverity https://bugzilla.redhat.com/show_bug.cgi?id=1025894 Signed-off-by: Thomas Haller <thaller@redhat.com>
* core: fix setting wifi qualityThomas Haller2013-11-131-1/+2
| | | | | | | | | | | wifi_utils_get_qual returns -1 on error. Keeping it in an unsigned variable is a bug. Error found by running Coverity https://bugzilla.redhat.com/show_bug.cgi?id=1025894 Signed-off-by: Thomas Haller <thaller@redhat.com>
* gsystem: update libgsystem to current upstream masterThomas Haller2013-11-131-0/+0
| | | | | | This brings a fix for Coverity scan warning Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: fix bash completion for curser not at EOL (2)Thomas Haller2013-11-131-1/+1
| | | | | | | Previous commit had an error in the following case: $ nmcli connection modify ' <TAB> id Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: fix bash completion for curser not at EOLThomas Haller2013-11-131-0/+7
| | | | | | | | | | | | | If the curser is not at the end of the line, we want to complete by ignoring everything right of the curser. However, the variable $cur is set to the spaces since the last word, so we have to get rid of them first Without this, the following did not complete: $ nmcli connection modify id <TAB> lo because $cur is set to ' '. Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: add bash-completion for 'nmcli general hostname'Thomas Haller2013-11-131-1/+10
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=1018510
* cli: add support for getting/setting hostname to nmcli (rh #1018510)Jiří Klimeš2013-11-132-6/+54
| | | | https://bugzilla.redhat.com/show_bug.cgi?id=1018510
* cli: tivial fixup whitespace in command description textThomas Haller2013-11-121-4/+4
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: improve handling of quoting in bash completionThomas Haller2013-11-121-0/+6
| | | | | | | | | | | | | _init_completion returns the '${words[@]}' array with all the quotes and escapes. We dont care about it so we drop (unescape) first. Before, the following failed: nmcli 'c' <TAB> nmcli connection modify id Wireless\ Connection\ 1 <TAB> Signed-off-by: Thomas Haller <thaller@redhat.com>
* core: require secondary connections to be VPNs (rh #997039)Dan Winship2013-11-121-25/+32
|
* keyfile: don't crash when in-memory-only connections don't have pathsJiří Klimeš2013-11-121-3/+6
| | | | | | | | If the connection has never been saved to disk, it won't have a path yet, but that doesn't mean we should crash. Next, when reloading connections, only try to do connection matching on connections that have paths, otherwise all in-memory-only connections would be removed at the end of read_connections().