summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* bond: add proper properties to NMSettingBond, deprecate "options" [WIP]dcbw/bondpropsDan Winship2013-11-149-474/+1339
| | | | | | | | | Make NMSettingBond have individual properties like other settings types. Deprecate the old "options"-based APIs, and at the same time, revert them back to only working for the properties that existed in 0.9.8, not the new 0.9.10 ones.
* 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().
* ethernet: don't crash if device doesn't have a MAC address (rh #1029053)Dan Williams2013-11-111-3/+11
| | | | | Like IBM s390 CTC devices, which aren't really ethernet but for historical reasons we treat them as such.
* ifcfg-rh: do not un-escape value in TEAM_CONFIG, TEAM_PORT_CONFIGJiří Klimeš2013-11-111-3/+3
| | | | | | | | | | | Doing so may cause NetworkManager to run into an very intensive loop in svUnescape() in shvar.c. This is 'top' output for very long (invalid team config) - 9309865 bytes long: PID USER PR NI VIRT RES SHR S %CPU %MEM TIME+ COMMAND 26855 root 20 0 305m 35m 6092 R 99.8 0.9 8:08.11 NetworkManager and still not finished.
* cli: improve bash completion to complete -h and --help aliasesThomas Haller2013-11-111-8/+15
| | | | Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: make command line parsing check for help option firstThomas Haller2013-11-113-17/+17
| | | | | | | | | | | | | Move the checks for nmc_arg_is_help to the beginning of the checks for command matches. Up to now, no command begins with 'h', so this has no behavioral change whatsoever. But imagine a command that begins with 'h' (for example `nmcli general hostname`), in that case `nmcli general h` should still show the help, as users might be accustomed to this abbreviation. Signed-off-by: Thomas Haller <thaller@redhat.com>
* cli: fix in matching command line argumentsThomas Haller2013-11-111-2/+2
| | | | | | | | | | | | | Ensure in matches() that a non-empty cmd is given, otherwise as currently nmcli general - matches to '-h' and is thus treated as nmcli general -h Signed-off-by: Thomas Haller <thaller@redhat.com>
* rdisc: cleanup handling of NMRDisc->lladdr fieldThomas Haller2013-11-092-3/+12
| | | | | | | Release the previous instance when setting the lladdr property and unref it in the desctructor. Signed-off-by: Thomas Haller <thaller@redhat.com>
* merge: better take-over of existing connections on NM startup (bgo #702488)Dan Williams2013-11-0841-836/+1585
|\ | | | | | | | | | | | | Read more state of connections that exist before NM starts, and take those connections over more effectively. https://bugzilla.gnome.org/show_bug.cgi?id=702488
| * core: don't deactivate assumed connections when quittingDan Williams2013-11-081-8/+10
| | | | | | | | | | | | | | If an assumed bridge/bond/team/whatever happened to be in the process of activating (perhaps it had no recognized slaves and was waiting for them to continue with IP configuration) when NM quits, don't deactivate the device and blow away the assumed configuration.
| * core: NMManager:state fixes for assumed connections, etcDan Winship2013-11-081-27/+54
| | | | | | | | | | | | | | | | | | | | | | | | | | Don't set NMManager:state to CONNECTING when assuming a connection, since it's not actually "connecting". If there are active connections, but none has the default route, then the global state should be CONNECTED_LOCAL, not CONNECTED_GLOBAL. Also tweak the semantics of CONNECTING/DISCONNECTING slightly; we only set state to CONNECTING when connecting a new connection if we are not already CONNECTED_GLOBAL, and we only set it to DISCONNECTING if we will be DISCONNECTED afterward.
| * core: don't up devices during IP configuration stagesDan Williams2013-11-081-16/+16
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Assumed connections shouldn't require touching the device, and the device should was already set IFF_UP during stage2 (which is skipped for assumed connections). Instead, what the code was really trying to do, was to ensure tha the IP interface the device was going to use was up. The only cases where the IP interface might *not* be up after stage2 is where the IP interface is different than the device's interface, like for Bluetooth, ADSL, WWAN, and PPPoE. Move the call to nm_platform_link_set_up() into nm_device_set_ip_iface() which all those device types will call. Thus, only the device types that really need to up their IP interface will do so, but other devices (including when activating assumed connections) that don't need to do this, won't do it.
| * core: don't generate connections for some devicesDan Williams2013-11-081-0/+14
| | | | | | | | | | | | | | | | | | | | | | If the device has no IP configuration, is not a slave, and is not a master, there's no point in generating a connection for it and assuming that connection. Fixes a problem where tun devices created by vpnc would be activated with an empty assumed connection before NetworkManager could assign the VPN IP config to it, and since IPv6 link-local timed out, the tun device would be deactivated and VPN would be useless.
| * core: use ignore/disabled IP methods for assumed connections without IP configDan Williams2013-11-082-7/+16
| | | | | | | | | | | | | | Follow the IP configuration the device currently has. For IPv6, this means not using LINK_LOCAL if the interface doesn't have a LINK_LOCAL address. Otherwise, NM assumes too much and may begin to activate an interface that has no IP configuration, then time out and deactivate that device.
| * core: remove non-NM-created bridge workaroundsPavel Šimerda2013-11-081-111/+2
| | | | | | | | | | Handle bridges like any other devices since soon we'll be able to take them over without changing their existing configuration.
| * core: slaves have configuration by definitionDan Williams2013-11-081-0/+4
| | | | | | | | | | The mere fact that a device is a slave means it has configuration that NetworkManager should try to read.
| * core: make assumed activations go through all the stagesDan Williams2013-11-085-115/+126
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Assumed slave connections need to be added to their master devices, which didn't used to happen because the devices activating assumed connections jumped directly to stage3, bypassing all the master/slave handling stuff. Instead, make all assumed connections go through all activation stages, but make sure that things which touch the device don't get done for assumed connections. This requires moving the master/slave code out of the override-able class methods because we need to call the master/slave code for assumed connections, but we don't want to call the override-able class activation methods.
| * core: find assumed connection mastersDan Williams2013-11-081-0/+22
| | | | | | | | | | | | | | If an assumed connection should have a master (bridge port, bond slave, etc) it needs to notify its master that it's a slave. Since slaves are ordered after their masters at start, the master should already have a generated connection which we can use as the master.
| * core: add nm_active_connection_[get|set]_assumed()Dan Williams2013-11-083-0/+23
| | | | | | | | | | | | Various code during the activation paths will want to know whether the connection is assumed or not, so that it doesn't do stuff that touches the device.
| * core: allow devices to activate their generated connectionsDan Williams2013-11-082-5/+1
| | | | | | | | | | | | | | If the device has a valid generated connection, it's already applied and the device is already "activated" outside NM, so let activation happen inside NM regardless of whether the device is available or not according to NM.
| * trivial: refine connection generation loggingDan Williams2013-11-082-10/+5
| |
| * platform: sort slaves after their master devicesThomas Haller2013-11-081-34/+88
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Slaves should get sorted after their masters so that when generating connections, the NMManager knows about the masters already. The convoluted logic here is to ensure that: 1) the kernel doesn't pass bad information that causes NM to crash or infinite loop 2) that with complicated parent/child relationships (like a VLAN interface with a parent that is also a slave), children always get sorted after *all* of their ancestors. The previous code was only sorting children after their immediate parent/master's ifindex, but not actually after the parent in the returned list.
| * ethernet: handle cloned/permanent MAC when updating connectionDan Williams2013-11-081-3/+22
| |
| * core: don't generate connections for devices NM just createdDan Williams2013-11-081-9/+11
| | | | | | | | | | No sense in doing that, since they were just created and can't possibly have any relevant configuration yet.
| * core: capture initial device DHCP IP configurationDan Williams2013-11-083-4/+117
| | | | | | | | At least gives us DNS servers and definite gateway.
| * core: add nm_ip4_config_address_exists() and nm_ip6_config_address_exists()Dan Williams2013-11-084-0/+35
| |
| * core: read gateway when capturing IP configsDan Williams2013-11-082-2/+40
| |
| * dhcp: make dhclient lease parsing code testableDan Williams2013-11-089-222/+463
| |