summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* fixup! device: split out cloned MAC decision from nm_device_hw_addr_set_cloned()bg/team-cloned-mac-rh1424641Thomas Haller2017-02-231-4/+4
| | | | Avoid cloning the string... we may already have a clone.
* fixup! device: split out cloned MAC decision from nm_device_hw_addr_set_cloned()Thomas Haller2017-02-231-10/+18
|
* fixup! device: split out cloned MAC decision from nm_device_hw_addr_set_cloned()Thomas Haller2017-02-231-2/+2
| | | | Make it clearer what's happening... (to me)
* fixup! device: split out cloned MAC decision from nm_device_hw_addr_set_cloned()Thomas Haller2017-02-231-3/+3
| | | | | So many arguments... it's a bit confusing which is which. Name the preserve argument "preserve".
* fixup! team: support the ethernet.cloned-mac-address propertyThomas Haller2017-02-231-1/+1
|
* fixup! team: support the ethernet.cloned-mac-address propertyThomas Haller2017-02-221-0/+2
|
* fixup! build: automatically determine Jansson support if not specifiedThomas Haller2017-02-222-5/+12
|
* fixup! team: support the ethernet.cloned-mac-address propertyThomas Haller2017-02-221-2/+2
| | | | | Give logging string a set-hw-addr prefix. I tend to grep for this token to find places related to... setting the hwaddr.
* fixup! team: support the ethernet.cloned-mac-address propertyThomas Haller2017-02-221-1/+1
| | | | | | | | technically, g_free() is really the same as free(), otherwise a lot would break. But let's keep them distrinct. Free stuff allocated by malloc() with free() / nm_auto_free.
* team: support the ethernet.cloned-mac-address propertyBeniamino Galvani2017-02-222-9/+60
| | | | | | | The only reliable way of setting a MAC address for the team is through the "hwaddr" property in the configuration passed to teamd. In order to rewrite the configuration we need Jansson support; since it is already a requirement for teamd, let the team plugin depend on it.
* device: split out cloned MAC decision from nm_device_hw_addr_set_cloned()Beniamino Galvani2017-02-222-16/+110
| | | | | | In this way, we can query the final cloned address (after special values as 'random', 'stable', etc. have been evaluated) from subclasses.
* build: automatically determine Jansson support if not specifiedBeniamino Galvani2017-02-221-3/+8
| | | | | | If configure is called without --enable-json-validation or --disable-json-validation, let's automatically choose a value depending on the availability of the library.
* libnm: fix gtk-doc comment for nm_setting_802_1x_get_phase2_ca_cert_password()Thomas Haller2017-02-221-1/+1
| | | | Fixes: 538e51047374616276e9ee3b41461915ba71227c
* build: ensure libnm-core directory exists for generated filesThomas Haller2017-02-221-0/+3
| | | | | | Since we generate "libnm-core/nm-core-enum-types.h" via GLIB_GENERAED, there is no obvious place to $(MKDIR_P). Add a dependency to the .dirstamp of the directory to instruct automake to create the directory.
* build: ensure build directories exist for gdbus-codegen targetsThomas Haller2017-02-221-0/+2
|
* build: don't depend on libnm-core directory for make targetThomas Haller2017-02-221-2/+2
|
* build: add slash to directory name for mkdirThomas Haller2017-02-221-3/+3
| | | | | Just for consistency with other locations that call $(MKDIR_P).
* device: avoid assertion in nm_device_get_supplicant_timeout() for Wi-Fi ↵Thomas Haller2017-02-211-5/+5
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | connection ... without 802-1x setting. NetworkManager[27913]: <trace> [1487689965.7156] device[0x555555bc0060] (wlp3s0): powersave is set to 3 NetworkManager[27913]: <info> [1487689965.7156] Config: added 'ssid' value 'xxx' NetworkManager[27913]: <info> [1487689965.7156] Config: added 'scan_ssid' value '1' NetworkManager[27913]: <info> [1487689965.7156] Config: added 'bssid' value 'xxx' NetworkManager[27913]: <info> [1487689965.7157] Config: added 'key_mgmt' value 'WPA-PSK' NetworkManager[27913]: <info> [1487689965.7157] Config: added 'psk' value '<hidden>' NetworkManager[27913]: <debug> [1487689965.7157] sup-iface[0x555555be0010,wlp3s0]: assoc[0x555555ebd800]: starting association... NetworkManager[27913]: nm_device_get_supplicant_timeout: assertion 's_8021x' failed (gdb) bt ... #3 0x00007ffff4c70419 in g_return_if_fail_warning (log_domain=log_domain@entry=0x55555577610e "NetworkManager", pretty_function=pretty_function@entry=0x5555557725e0 <__func__.44436> "nm_device_get_supplicant_timeout", expression=expression@entry=0x5555557725bb "s_8021x") at gmessages.c:2536 #4 0x000055555568af3a in nm_device_get_supplicant_timeout (self=0x555555bc0060 [NMDeviceWifi]) at src/devices/nm-device.c:12963 #5 0x00007fffe88d7f1e in act_stage2_config (device=<optimized out>, reason=0x7fffffffe000) at src/devices/wifi/nm-device-wifi.c:2651 #6 0x00005555556879f1 in activate_stage2_device_config (self=0x555555bc0060 [NMDeviceWifi]) at src/devices/nm-device.c:4320 #7 0x000055555566876b in activation_source_handle_cb (self=self@entry=0x555555bc0060 [NMDeviceWifi], family=family@entry=2) at src/devices/nm-device.c:4060 #8 0x000055555566882e in activation_source_handle_cb4 (user_data=user_data@entry=0x555555bc0060) at src/devices/nm-device.c:3997 #9 0x00007ffff4c658e7 in g_idle_dispatch (source=0x555555e228c0, callback=0x555555668820 <activation_source_handle_cb4>, user_data=0x555555bc0060) at gmain.c:5545 #10 0x00007ffff4c68e52 in g_main_dispatch (context=0x555555a214d0) at gmain.c:3203 #11 0x00007ffff4c68e52 in g_main_context_dispatch (context=context@entry=0x555555a214d0) at gmain.c:3856 #12 0x00007ffff4c691d0 in g_main_context_iterate (context=0x555555a214d0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3929 #13 0x00007ffff4c694f2 in g_main_loop_run (loop=0x555555a1a750) at gmain.c:4125 #14 0x00005555555821fe in main (argc=<optimized out>, argv=<optimized out>) at src/main.c:423 Fixes: 07570e245ac97054027acd928ed09ae2b83e62b0
* ifcfg: drop strlen() call from svEscape()Thomas Haller2017-02-211-6/+4
|
* ifcfg: some refactoring of reader using vGetValueStr()/vGetValue_cp()Thomas Haller2017-02-212-18/+11
|
* ifcfg: complete shvar API with svGetValue_cp() and svGetValueStr()Thomas Haller2017-02-212-8/+65
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Add svGetValue_cp() and svGetValueStr() for completeness. Currently, we mostly use svGetValueStr_cp(), which I think is wrong because for most cases we should instead not ignore empty values -- that is, svGetValue_cp() would be a better choice. Also, I think that the non *_cp() API should be preferred in many cases because it avoids cloning the value in many cases. The API is not necessarily less favorable either: gs_free char *value = NULL; value = svGetValue_cp (s, key); if (value) ... vs. gs_free char *value_to_free = NULL; const char *value; value = svGetValue (s, key, &value_to_free); if (value) ... Add the two missing variants, so that future code can use what fits best, not following undesired practices because seemingly there is no alternative.
* ifcfg/trivial: rename svGetValueString() to svGetValueStr_cp()Thomas Haller2017-02-215-393/+393
| | | | | | | | | | | | | | | | | | | | | | | | | We have - svGetValue() - returns the original string - avoids copying the string unless necessary - svGetValueStr_cp() (formerly svGetValueString()) - returns the original string, unless it is empty "" - always clones the string I think the behavior svGetValueStr*() of coercing "" to NULL is wrongly used in most places. We should better handle "" like any other value, not treat it as unset. That would require another function svGetValue_cp(), which is like svGetValue() but always copies the string. Rename svGetValueString() so that there is a place for names like - svGetValue_cp() - svGetValueStr() Also rename svSetValueString() to svSetValueStr().
* ifcfg: set error for failure reading unrecognized connection in ↵Thomas Haller2017-02-211-2/+4
| | | | connection_from_file_full()
* ifcfg: don't g_strstrip() value in read_dcb_bool_array()Thomas Haller2017-02-211-3/+0
| | | | | | | | | Ifcfg reader now properly handles escaping and quoting. We don't need to stip whitespace, if somebody explicitly configures prop=" value" it is a configuration error.
* ifcfg: return early on error using cleanup attributes in readerThomas Haller2017-02-211-192/+119
|
* ifcfg: add nm_auto_shvar_file_close cleanup macroThomas Haller2017-02-211-0/+12
|
* merge: branch 'bg/802-1x-auth-timeout-bgo723084'Beniamino Galvani2017-02-2112-36/+162
|\ | | | | | | | | | | | | Make the 802.1x authentication timeout configurable to allow a faster fallback to other connections. https://bugzilla.gnome.org/show_bug.cgi?id=723084
| * settings: log changes to NMSettingsConnection's autoconnect_retriesThomas Haller2017-02-211-2/+5
| |
| * device: honor the connection.autoconnect-retries for 802.1XBeniamino Galvani2017-02-212-25/+32
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | NMDeviceEthernet and NMDeviceMacsec implement their own retry policy for connection using 802.1X, and consider the credentials wrong when the authentication fails for 3 times. In such case, they also disable autoconnection for the device by setting the state reason NO_SECRETS. This means that it's not possible at the moment to choose how many times the authentication will be retried since they don't use the standard reconnection logic. Change NMDeviceEthernet and NMDeviceMacsec to use the number of retries from connection.autoconnect-retries instead of a hardcoded value to decide how many times the authentication must be restarted.
| * device: add support for 802-1x.auth-timeoutBeniamino Galvani2017-02-215-7/+46
| | | | | | | | | | | | Use the per-connection authentication timeout for 802.1X Ethernet, MACsec and Wi-Fi connections. In case the value is not defined, fall back to the global one.
| * ifcfg-rh: add support for 802-1x.auth-timeout propertyBeniamino Galvani2017-02-213-0/+18
| |
| * cli: add support for 802-1x.auth-timeout propertyBeniamino Galvani2017-02-211-1/+12
| |
| * libnm-core: add auth-timeout property to the 802.1x settingBeniamino Galvani2017-02-213-1/+49
|/ | | | | | | The property can be used to tune the authentication timeout. It's especially useful to speed up the failure in case the port doesn't support 802.1X and make NM try a different, non-authenticated connection.
* ifcfg: don't check for empty string after svGetValueString()Thomas Haller2017-02-211-41/+35
| | | | | svGetValueString() precisely filters out empty strings. No need to check for that afterwards.
* ifcfg: stack-allocate tag for DNS value lookupThomas Haller2017-02-211-12/+7
|
* ifcfg: return binary address from read_ip4_address()Thomas Haller2017-02-211-78/+79
| | | | This allows us to avoid cloning the string at several places.
* build: fix type on Makefile.amThomas Haller2017-02-211-1/+1
| | | | Fixes: 3cc00dd550fcbd83ec2f1af9eeb83bf5ec921d21
* ifcfg: also read DEFROUTE and GATEWAY from alias filesThomas Haller2017-02-205-16/+80
| | | | | | Also accept DEFROUTE and GATEWAY when they are defined in alias files -- provided, that they are not yet defined in the main ifcfg file.
* ifcfg: refactor creation of numered tag lables to use stack allocated bufferThomas Haller2017-02-201-81/+69
| | | | and use gs_free attribute and return-early on error.
* tui: generate names for bonds, teams and bridgesLubomir Rintel2017-02-201-1/+39
| | | | | | | | | | | | This makes it more likely that the user will end up with a master connection that has connection.interface-name property. This makes it possible for ifcfg plugin to specify the master in the for of device name (as opposed to UUID) for compatibility with the legacy network tooling. This is equivalent to what nmcli does. https://bugzilla.redhat.com/show_bug.cgi?id=1369091
* merge branch 'th/8021x-auth-flags-tls-disable-bgo765059'Thomas Haller2017-02-2013-113/+406
|\ | | | | | | https://bugzilla.gnome.org/show_bug.cgi?id=765059
| * ifcfg-rh: support 802-1x.phase1-auth-algBeniamino Galvani2017-02-204-0/+43
| |
| * cli: support 802-1x.phase1-auth-flagsBeniamino Galvani2017-02-201-50/+112
| |
| * libnm/wifi: rework NMSetting8021xAuthFlags to explicitly disable TLS versionThomas Haller2017-02-203-39/+25
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | The wpa_supplicant API supports to enable/disable each TLS version individually, or leave it at the default. Currently, the default means to enable a TLS version, thus, the only meaningful option for the momemnt means to explicitly disable it. In the future, supplicant may disable options by default, and the inverse option can become interesting to configure "tls_disable_tlsv1_0=0". When that happens, we can solve it by adding another flag NM_SETTING_802_1X_AUTH_FLAGS_TLS_1_0_ENABLE. Change the previous behavior of the NMSetting8021xAuthFlags. Previously, when not specifying TLS_DISABLE_DEFAULT, all options were unspecified. On the other hand, when specifying a single TLS disable flag, all versions were explicitly enabled or disabled. Instead, change the meaning of the disable flags. When present, it explicitly disables an option. But it does not explicitly enable it.
| * supplicant: allows disabling select TLS versions on phase 1 authenticationLeorize2017-02-202-1/+20
| | | | | | | | | | | | | | | | Some AAA servers have issues interoperating with select TLS versions, which wpa_supplicant negotiates by default. This commit allows disabling troubling versions of TLS so that connecting to broken authentication servers could be possible.
| * libnm-core/8021x: add phase1-auth-flags configuration itemsLeorize2017-02-203-0/+87
| |
| * utils: support unknown numeric values in nm_utils_enum_to_str() and ↵Thomas Haller2017-02-203-48/+133
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nm_utils_enum_from_str() - for nm_utils_enum_to_str(), whenever encounter a numeric value that has no expression as enum/flag, encode the value numerically. For enums, encode it as decimal. For flags, encode it as hexadecimal (with 0x prefix). Also check that an existing value_nick cannot be wrongly interpreted as a integer, and if they would, encode them instead as integers only. - Likewise, in nm_utils_enum_from_str() accept numerical values and for nm_utils_enum_get_values() return enum nicks that look like numeric values in their numeric form only. - In nm_utils_enum_from_str(), don't use g_strsplit(), but clone the string only once and manipulate it inplace. - Accept '\n' and '\r' as additional delimiters for flags. - For consistency, also return an err_token for enum types. If the caller doesn't care about that, he should simply not pass the out-argument.
| * libnm-core: add _nm_utils_enum_to_str_full()Beniamino Galvani2017-02-202-16/+27
| | | | | | | | | | | | | | Unfortunately nm_utils_enum_to_str() doesn't allow to specify the separator between enum values. Since the function is public API and can't be modified now, add a new internal function which accepts the separator as argument.
| * libnm-core: add missing transfer annotation for nm_utils_enum_to_str()Beniamino Galvani2017-02-201-1/+1
|/
* merge: branch 'bg/wwan-mtu-rh1388613'Beniamino Galvani2017-02-2011-2/+160
|\ | | | | | | | | | | Add a MTU property to GSM and CDMA connections. https://bugzilla.redhat.com/show_bug.cgi?id=1388613