summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* device: ppp: chain up to parent for non-auto IP methodsbg/ppp-rh1515829Beniamino Galvani2017-11-271-0/+12
| | | | | The PPP device only handles automatic configuration, everything else should be handled by NMDevice.
* device: ppp: start stage3 only after we receive IP configurationBeniamino Galvani2017-11-271-22/+29
| | | | | | | | | | | | | | | | The pppd plugin first sends a phase change signal to RUNNING and then sends IPv4 and IPv6 configurations. NM knows the actual interface name (and thus populates the ifindex) only after an IP configuration is received from the plugin. If we start configuring IPv4 and IPv6 as soon as the PPP status is RUNNING, it is possible to hit an assertion because activate_stage3_ip_config_start() tries to capture the current IPv6 configuration when the device ifindex is not known yet. Instead, let's start configuring IP only after the ifindex is known. https://bugzilla.redhat.com/show_bug.cgi?id=1515829
* device: ppp: rename fieldsBeniamino Galvani2017-11-271-16/+16
| | | | Remove the 'pending' prefix.
* ppp: cache the ifindex in the managerBeniamino Galvani2017-11-271-14/+13
| | | | | | | All the calls to impl_ppp_manager_set_ipX_config() refer to the same interface and so we can cache the ifindex, as we already do for the interface name. This also allows us to rename the interface in a signal handler without side effects on the next calls.
* ifcfg-rh: close file descriptor only when necessaryBeniamino Galvani2017-11-271-1/+2
| | | | | | | | If the file was read-only, we already closed it. This fixes the following valgrind warnings: Warning: invalid file descriptor -1 in syscall close()
* device: update device mtu from ip interface when requiredFrancesco Giudici2017-11-241-0/+3
| | | | | | | | If the tracked device is a control device only (has no network interface) like in the case of a cdc-wdm device, get the mtu from the ip interface (the exposed wwan network interface in this case). https://bugzilla.redhat.com/show_bug.cgi?id=1460217
* device: merge branch 'th/shared-mode-failure-bgo790726'Thomas Haller2017-11-242-29/+44
|\ | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=790726
| * device: only set ip_forward sysctl if necessaryThomas Haller2017-11-241-2/+6
| | | | | | | | | | | | | | | | | | | | /proc/sys might be read-only but we want to set it for enabling shared mode. Check first if the sysctl already has the expected value, and if so, do nothing. https://bugzilla.gnome.org/show_bug.cgi?id=790726
| * device: return and log failure reason for start_sharing()Thomas Haller2017-11-241-27/+35
| | | | | | | | | | | | | | Also downgrade a few intermediate error logging messages for failures that happen while start_sharing(). A debug message is enough in this case, because we propagate now the error to the caller, which logs a warning anyway.
| * platform: preserve errno in nm_platform_sysctl_get_int_checked()Thomas Haller2017-11-241-0/+3
|/ | | | | | It's not clear whether free() changes errno. Be sure about it. https://bugzilla.gnome.org/show_bug.cgi?id=790726
* core: merge branch 'th/call-id-cleanup'Thomas Haller2017-11-2410-112/+106
|\
| * core: use CList to track NMActRequestGetSecretsCallId in NMActRequestth/call-id-cleanupThomas Haller2017-11-241-25/+24
| | | | | | | | | | Gives O(1) insert and remove. Also saves the overhead of the GSlice allocation for the GSList node.
| * core/trivial: unify names of internal NMActRequestGetSecretsCallId as "call_id"Thomas Haller2017-11-241-35/+35
| |
| * core: drop internal typedef Result for NMSecretAgentCallIdThomas Haller2017-11-241-17/+15
| | | | | | | | Using an internal alias for the type is just confusing. Drop it.
| * core: drop internal typedef GetSecretsInfo for NMSecretAgentCallIdThomas Haller2017-11-241-10/+8
| | | | | | | | Using an internal alias for the type is just confusing. Drop it.
| * core: refactor NMActRequestGetSecretsCallId typedef not to be a pointer to ↵Thomas Haller2017-11-247-22/+22
| | | | | | | | | | | | | | struct Typedefs to structs are fine, but a typedef for a pointer seems confusing to me. Let's avoid it.
| * core: refactor NMSecretAgentCallId typedef not to be a pointer to structThomas Haller2017-11-243-25/+24
|/ | | | | Typedefs to structs are fine, but a typedef for a pointer seems confusing to me. Let's avoid it.
* libnm: be more accepting parsing boolean values in ↵Thomas Haller2017-11-241-6/+3
| | | | | | | | | | | nm_utils_parse_variant_attributes() We should use the same str2bool parser everywhere: _nm_utils_ascii_str_to_bool(). Incidentally, this function allows more forms of expressing a boolean value. $ nmcli connection modify "$CON" ipv4.routes '1.2.3.4/32 1.2.3.1 onlink=1' Error: failed to modify ipv4.routes: invalid option 'onlink=1': invalid boolean value '1' for attribute 'onlink'.
* ifcfg-rh: merge branch 'bg/ifcfg-rh-bridge-mac-rh1516659'Beniamino Galvani2017-11-248-149/+208
|\ | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1516659
| * ifcfg-rh: check integer value for other bridge optionsThomas Haller2017-11-231-72/+55
| |
| * ifcfg-rh: check integer value when reading handle_bridge_option()Thomas Haller2017-11-231-41/+59
| | | | | | | | | | | | We cannot just call g_object_set() with an integer that is out of bound. Otherwise, glib will warn. We can use nm_g_object_set_property*() to return an error without asserting.
| * shared: add nm_g_object_set_property_*() helperThomas Haller2017-11-232-0/+36
| |
| * libnm: move bridge min/max defines to header fileThomas Haller2017-11-232-26/+26
| |
| * ifcfg-rh: fix range and size when parsing integer values in readerThomas Haller2017-11-231-2/+3
| |
| * ifcfg-rh/trivial: rename get_uint() to get_uint32()Thomas Haller2017-11-231-10/+10
| |
| * ifcfg-rh: avoid string copies in make_bridge_setting()Thomas Haller2017-11-231-14/+14
| | | | | | | | Also, don't g_strstrip(value) for BRIDGE_MACADDR.
| * ifcfg-rh: use distinct variables for bridge and wired mac addressBeniamino Galvani2017-11-234-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Currently both bridge.mac-address and ethernet.cloned-mac-address get written to the same MACADDR ifcfg-rh variable; the ethernet property wins if both are present. When one property is set and the connection is saved (and thus reread) both properties are populated with the same value. This is wrong because, even if the properties have the same meaning, the setting plugin should not read something different from what was written. Also consider that after the following steps: $ nmcli con mod c ethernet.cloned-mac-address 00:11:22:33:44:55 $ nmcli con mod c ethernet.cloned-mac-address "" the connection will still have the new mac address set in the bridge.mac-address property, which is certainly unexpected. In general, mapping multiple properties to the same variable is harmful and must be avoided. Therefore, let's use a different variable for bridge.mac-address. This changes behavior, but not so much: - connections that have MACADDR set will behave as before; the only difference will be that the MAC will be present in the wired setting instead of the bridge one; - initscripts compatibility is not relevant because MACADDR for bridges was a NM extension; - if someone creates a new connection and sets bridge.mac-address NM will set the BRIDGE_MACADDR property instead of MACADDR. But this shouldn't be a big concern as bridge.mac-address is documented as deprecated and should not be used for new connections. https://bugzilla.redhat.com/show_bug.cgi?id=1516659
| * ifcfg-rh: read wired properties for bridge connectionsBeniamino Galvani2017-11-232-2/+18
| | | | | | | | | | A bridge connection can have ethernet settings, read them from the ifcfg file.
| * libnm-core: document bridge.mac-address as deprecatedBeniamino Galvani2017-11-232-1/+3
|/ | | | The description already says that. Also add the deprecation tag.
* all: merge branch 'th/vpn-secrets-bgo790655'Thomas Haller2017-11-2323-406/+544
|\ | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=790655
| * shared/compat: add compat for nm_setting_vpn_get_data_keys() and ↵Thomas Haller2017-11-233-1/+91
| | | | | | | | nm_setting_vpn_get_secret_keys()
| * shared: add nm-utils/nm-compat.hThomas Haller2017-11-233-0/+54
| |
| * libnm: cleanup NMSettingVpn's foreach functionsThomas Haller2017-11-231-19/+41
| | | | | | | | | | | | | | | | | | | | | | | | Previously, g_hash_table_get_keys() would already allocate a GList list, which then gets copied to another GSList. Don't do that. Just allocate one array to keep all the elements. Also, as we now use nm_setting_vpn_get_secret_keys() and nm_setting_vpn_get_data_keys(), note that the keys are sorted and hence the order is stable.
| * libnm: add nm_setting_vpn_get_data_keys() and ↵Thomas Haller2017-11-233-0/+87
| | | | | | | | | | | | | | | | | | | | nm_setting_vpn_get_secret_keys() API It's rather limiting that the only API to access *all* keys is nm_setting_vpn_foreach_data_item() and nm_setting_vpn_foreach_secret(). API like nm_setting_vpn_get_num_secrets() is not useful, at least as long as you cannot access the item by index.
| * clients: some cleanup of requesting VPN secretsThomas Haller2017-11-236-169/+178
| |
| * core/vpn: mark secret hints as constThomas Haller2017-11-235-18/+22
| |
| * libnm: use cleanup attribute in nm_vpn_service_plugin_read_vpn_details()Thomas Haller2017-11-231-16/+5
| |
| * libnm: use nm_free_secret()Thomas Haller2017-11-232-21/+2
| |
| * libnm: use stack allocated temporary string for property nameThomas Haller2017-11-232-35/+32
| |
| * platform: don't return zero from nmp_object_id_hash()Thomas Haller2017-11-231-1/+1
| | | | | | | | | | | | | | There is no principle problem with returning zero has hash value. But just don't do it. Our hash functions should not return zero. Instead, return nm_hash_static(). This is why the function exists.
| * platform: move nmp_object_equal() to header for inlineThomas Haller2017-11-232-7/+7
| |
| * shared: add nm_construct_name_a() macroThomas Haller2017-11-231-0/+22
| |
| * libnm: reuse implementation for NMVpnPluginOld's util functionsThomas Haller2017-11-221-120/+3
|/ | | | They are identical, and both public API. Merge.
* contrib: use less in NM-log to pre-process inputThomas Haller2017-11-211-2/+2
| | | | | | | GNU less supports filters. That makes it nice to use instead of cat. Also, less is well suited for output to a pipe. With this, `NM-log nm-log.txt.gz` works as you would expect
* libnm: merge branch 'th/bond-stable-strdict-order'Thomas Haller2017-11-216-73/+154
|\
| * libnm: cache lookup index for nm_setting_bond_get_option()Thomas Haller2017-11-211-15/+27
| |
| * libnm: stable order in _nm_utils_strdict_to_dbus()Thomas Haller2017-11-211-5/+33
| |
| * ifcfg-rh: avoid duplicate lookup of bond-option in write_bond_setting()Thomas Haller2017-11-211-10/+3
| | | | | | | | | | Now that nm_setting_bond_get_option() has a stable order (alphabetically), we no longer need to sort it.
| * libnm: sort entries in nm_setting_bond_get_option()Thomas Haller2017-11-211-11/+19
| | | | | | | | | | | | Since the order was arbitrary before, we can also sort it. Also rework it, to avoid the creating a temporary GList of keys.
| * libnm/trivial: reorder code in libnm-core/nm-setting-bond.cThomas Haller2017-11-211-45/+61
| |