summaryrefslogtreecommitdiff
path: root/clients
Commit message (Collapse)AuthorAgeFilesLines
* libnm-core: document bridge.mac-address as deprecatedBeniamino Galvani2017-11-231-1/+1
| | | | The description already says that. Also add the deprecation tag.
* clients: some cleanup of requesting VPN secretsThomas Haller2017-11-236-169/+178
|
* cli: fix connection type completionBeniamino Galvani2017-11-201-0/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't show completion for all setting types but only for base ones. Before: $ nmcli connection add type <TAB> 802-11-olpc-mesh ethernet ppp 802-11-wireless generic pppoe 802-11-wireless-security gsm proxy 802-1x infiniband serial 802-3-ethernet ip-tunnel team adsl ipv4 team-port bluetooth ipv6 tun bond macsec user bridge macvlan vlan bridge-port olpc-mesh vpn cdma ovs-bridge vxlan connection ovs-interface wifi dcb ovs-patch wifi-sec dummy ovs-port wimax After: $ nmcli connection add type <TAB> 802-11-olpc-mesh cdma macsec team 802-11-wireless dummy macvlan tun 802-3-ethernet ethernet olpc-mesh vlan adsl generic ovs-bridge vpn bluetooth gsm ovs-interface vxlan bond infiniband ovs-port wifi bridge ip-tunnel pppoe wimax
* all: use nm_direct_hash() instead of g_direct_hash()Thomas Haller2017-11-162-2/+2
| | | | | | We also do this for libnm, where it causes visible changes in behavior. But if somebody would rely on the hashing implementation for hash tables, it would be seriously flawed.
* all: include "nm-utils/nm-hash-utils.h" by defaultThomas Haller2017-11-167-12/+0
| | | | | | | | | Next we will use siphash24() instead of the glib version g_direct_hash() or g_str_hash(). Hence, the "nm-utils/nm-hash-utils.h" header becomes very fundamental and will be needed basically everywhere. Instead of requiring the users to include them, let it be included via "nm-default.h" header.
* clients: avoid crash in _complete_fcn_connection_master()Thomas Haller2017-11-151-1/+1
| | | | | Found by coverity, but not a practical issue, because we wouldn't actually call the function with text NULL.
* all: use nm_close() instead of close()Thomas Haller2017-11-143-8/+8
|
* device: add a new state-reason for DAD failuresBeniamino Galvani2017-11-091-1/+3
|
* cli: add team-port propertiesFrancesco Giudici2017-11-091-0/+47
|
* libnm-core: add explicit team properties to NMSettingTeamPortFrancesco Giudici2017-11-091-0/+5
|
* cli: add team propertiesFrancesco Giudici2017-11-091-0/+179
|
* libnm-core: add explicit team properties to NMSettingTeamFrancesco Giudici2017-11-091-0/+14
|
* doc: fix type on documentation for NMSettingOvsPort:bond-updelayThomas Haller2017-11-061-1/+1
| | | | | | Fixes: 8a1ae40a80efcd6632ea7ba4845b85aec5afe19b https://bugzilla.gnome.org/show_bug.cgi?id=789880
* cli: enable secret-agent only after activationBeniamino Galvani2017-11-021-4/+10
| | | | | | | | | | | | | | | | | | | | Change the activation procedure for connections that require secrets in the following way: - nmcli creates a secret-agent and leaves it disabled so that incoming requests are queued - nmcli calls ActivateConnection() - when the method returns success, the secret-agent gets enabled and all queued requests are processed When the user activates a connection which is already auto-activating, NM will deactivate the current active-connection and will call CancelGetSecrets() for it before the new ActivateConnection() returns. In this way, when the secret-agent is enabled by nmcli, we have the guarantee that there aren't any queued requests for the deactivating connections. https://bugzilla.redhat.com/show_bug.cgi?id=1438476
* clients: implement CancelGetSecrets() secret-agent APIBeniamino Galvani2017-11-021-1/+6
|
* all: move setting 802-1x.auth-retries to connection.auth-retriesThomas Haller2017-11-022-4/+4
| | | | | | | | | | | The number of authentication retires is useful also for passwords aside 802-1x settings. For example, src/devices/wifi/nm-device-wifi.c also has a retry counter and uses a hard-coded value of 3. Move the setting, so that it can be used in general. Although it is still not implemented for other settings. This is an API and ABI break.
* libnm,cli,ifcfg-rh: add NMSetting8021x:auth-retries propertyThomas Haller2017-10-312-0/+4
|
* docs: clearify documentation of connection.autoconnect-retriesThomas Haller2017-10-311-1/+1
|
* docs: fix typo in NMSettingBridge:group-forward-mask docThomas Haller2017-10-301-1/+1
| | | | | | Fixes: 17ec3aef2fa4d31ef80f54923f89e6719f1ce83b https://bugzilla.gnome.org/show_bug.cgi?id=789662
* all: add OVSDB connection failure device state reasonLubomir Rintel2017-10-301-0/+3
|
* clients: add support for ovs-bridge settingLubomir Rintel2017-10-302-0/+39
|
* clients: add support for ovs-port settingLubomir Rintel2017-10-302-0/+51
|
* clients: add support for ovs-interface settingLubomir Rintel2017-10-302-0/+24
|
* clients: add support for ovs-patch settingLubomir Rintel2017-10-302-0/+12
|
* libnm-core: add ovs-bridge settingLubomir Rintel2017-10-301-0/+5
|
* libnm-core: add ovs-port settingLubomir Rintel2017-10-301-0/+7
|
* libnm-core: add ovs-interface settingLubomir Rintel2017-10-301-0/+2
|
* libnm-core: add ovs-patch settingLubomir Rintel2017-10-301-0/+2
|
* cli/trivial: drop default branch from some casesLubomir Rintel2017-10-301-5/+9
| | | | | This way not handling a known enum value will be caught by a compiler warning.
* ip-tunnel: fix a typoLubomir Rintel2017-10-301-1/+1
|
* cli: ignore PAGER when escalating privilegesLubomir Rintel2017-10-301-1/+3
| | | | | | | | nmcli typically doesn't run setuid, nor uses file capabilities or is labelled for a SELinux domain trainsition upon execution. But in case anyone has any reason to do that, we should follow good security practices and not exec whatever is set in the environment.
* libnm: avoid unnecessary copies accessing NMIPRoute's attributesThomas Haller2017-10-301-9/+16
| | | | | | | | | | We want to support large number of routes. Reduce the number of copies, by adding internal accessor functions. Also, work around a complaint from coverity: 46. NetworkManager-1.9.2/libnm-core/nm-utils.c:1987: dereference: Dereferencing a null pointer "names".
* cli: fix leak in _output_selection_parse()Thomas Haller2017-10-301-0/+1
| | | | | | Reported by coverity. Fixes: fdd40b6a6821eaced26a08ca6d2ad731ad506071
* nmcli: fix wrongly adding a generic setting when constructing connectionThomas Haller2017-10-261-2/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | nmc_read_connection_properties() iterates over the input arguments, and completes the connection. Initially, the type is not yet known, in that case, we should not wrongly assume that this is a generic connection. Later, when the type is specified, con_settings() will return the correct settings. Previously, this would wrongly add a [generic] section: $ nmcli connection add type ethernet ifname eth1 con-name ethie autoconnect no ipv4.method auto ethernet.cloned-mac-address random With the fix, it still works to specify the type later: $ nmcli connection add ifname eth1 con-name ethie autoconnect no ipv4.method auto type ethernet but it doesn't work, to specify the type after type-specific options: $ nmcli connection add ifname eth1 con-name ethie autoconnect no ipv4.method auto ethernet.cloned-mac-address random type ethernet Error: invalid or not allowed setting 'ethernet': 'ethernet' not among [connection, ipv4, ipv6, proxy]. The patch doesn't change the latter limitation. Fixes: c5324ed285aff7d6d58212e4b030a0fc556eb43b
* core,clients: use our own string hashing function nm_str_hash()Thomas Haller2017-10-187-10/+22
| | | | | | | | | | | | | | | | | | | | Replace the usage of g_str_hash() with our own nm_str_hash(). GLib's g_str_hash() uses djb2 hashing function, just like we do at the moment. The only difference is, that we use a diffrent seed value. Note, that we initialize the hash seed with random data (by calling getrandom() or reading /dev/urandom). That is a change compared to before. This change of the hashing function and accessing the random pool might be undesired for libnm/libnm-core. Hence, the change is not done there as it possibly changes behavior for public API. Maybe we should do that later though. At this point, there isn't much of a change. This patch becomes interesting, if we decide to use a different hashing algorithm.
* tui: fix memory leakbg/tui-activation-rh1500651Beniamino Galvani2017-10-161-0/+2
|
* tui: improve tracking of activation stateBeniamino Galvani2017-10-161-21/+53
| | | | | | | | | | nmtui determines the activation result by tracking the active connection state but that is not enough, as the active connection may disappear or because we need to consider also the device state in some particular cases. Use the same logic implemented in nmcli that is now provided by the nmc_activation_get_effective_state() helper.
* clients: move get_effective_activation_state() to nm-clients-utils.cBeniamino Galvani2017-10-163-69/+79
|
* build: move nm-client-utils.c to libnmc-base.aBeniamino Galvani2017-10-165-294/+231
| | | | | | | | | In a later commit we'll add a new generic client function used by nmcli and nmtui. nm-client-utils.c seems the right place for it, so move the file to the base library that is used by both clients. While at it, also put in that file some functions that will be needed by nmtui.
* cli: split evaluation of activation stateBeniamino Galvani2017-10-161-41/+59
| | | | | | The code used to determine the activation state is useful for other clients as well, let's split it into a dedicated function that can be shared.
* tui: add group-forward-mask property to bridge pageBeniamino Galvani2017-10-131-0/+6
| | | | | | | The validation on allowed bits is done when the user saves the connection. https://bugzilla.redhat.com/show_bug.cgi?id=1358615
* libnm-core: specify enum values in NMSettingIP6Config:addr-gen-mode docBeniamino Galvani2017-10-131-1/+1
| | | | | | | | | | | | | | | So that the man page will display: The permitted values are: NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_EUI64 (0) or NM_SETTING_IP6_CONFIG_ADDR_GEN_MODE_STABLE_PRIVACY (1). instead of The permitted values are: "eui64" or "stable-privacy". since the latter is not useful at all for a int32 property. Unfortunately the enum names are quite long and don't look very well in a table, but that's another problem.
* tui: fix crash creating Wi-Fi connectionThomas Haller2017-10-112-1/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | When adding a new Wi-Fi connection, nmtui crashes. Usually, a verified Wi-Fi connection always has key_mgnt set. However, the client doesn't have the luxury to assume that all connections verify. Especially, while creating a new connection. #0 0x00007ffff4fe5baa in __strcmp_sse2_unaligned () at ../sysdeps/x86_64/multiarch/strcmp-sse2-unaligned.S:31 #1 0x000055555556654c in get_security_type (binding=0x5555557d1cf0) at clients/tui/nm-editor-bindings.c:591 #2 0x000055555556593b in wireless_security_changed (object=0x0, pspec=0x0, user_data=0x5555557d1cf0) at clients/tui/nm-editor-bindings.c:628 #3 0x000055555556536d in nm_editor_bind_wireless_security_method (connection=0x5555558028e0, s_wsec=0x555555892eb0 [NMSettingWirelessSecurity], target=0x555555935e10, target_property=0x55555559311b "active-id", flags=(G_BINDING_BIDIRECTIONAL | G_BINDING_SYNC_CREATE)) at clients/tui/nm-editor-bindings.c:796 #4 0x000055555557a3aa in nmt_page_wifi_constructed (object=0x5555559349e0 [NmtPageWifi]) at clients/tui/nmt-page-wifi.c:338 #5 0x00007ffff5e6b670 in g_object_new_internal (class=class@entry=0x5555557c14c0, params=params@entry=0x7fffffffc440, n_params=n_params@entry=2) at gobject.c:1823 #6 0x00007ffff5e6d24d in g_object_new_valist (object_type=object_type@entry=93824994775616, first_property_name=first_property_name@entry=0x5555555920c6 "connection", var_args=var_args@entry=0x7fffffffc590) at gobject.c:2042 #7 0x00007ffff5e6d691 in g_object_new (object_type=93824994775616, first_property_name=0x5555555920c6 "connection") at gobject.c:1626 #8 0x000055555557985a in nmt_page_wifi_new (conn=0x5555558028e0, deventry=0x5555557d15e0 [NmtDeviceEntry]) at clients/tui/nmt-page-wifi.c:45 #9 0x000055555556f7e2 in nmt_editor_constructed (object=0x555555922af0 [NmtEditor]) at clients/tui/nmt-editor.c:374 #10 0x00007ffff5e6b670 in g_object_new_internal (class=class@entry=0x555555932750, params=params@entry=0x7fffffffcac0, n_params=n_params@entry=4) at gobject.c:1823 #11 0x00007ffff5e6d24d in g_object_new_valist (object_type=object_type@entry=93824996288016, first_property_name=first_property_name@entry=0x5555555920c6 "connection", var_args=var_args@entry=0x7fffffffcc10) at gobject.c:2042 #12 0x00007ffff5e6d691 in g_object_new (object_type=93824996288016, first_property_name=0x5555555920c6 "connection") at gobject.c:1626 #13 0x000055555556f261 in nmt_editor_new (connection=0x555555802880) at clients/tui/nmt-editor.c:109 #14 0x0000555555562b35 in nmt_edit_connection (connection=0x555555802880) at clients/tui/nmtui-edit.c:448 #15 0x0000555555563a29 in create_connection (widget=0x55555588b150 [NmtNewtListbox], list=0x555555922a00) at clients/tui/nmtui-edit.c:185 #16 0x0000555555563a5d in create_connection_and_quit (widget=0x55555588b150 [NmtNewtListbox], list=0x555555922a00) at clients/tui/nmtui-edit.c:192 #20 0x00007ffff5e81b0f in <emit signal ??? on instance 0x55555588b150 [NmtNewtListbox]> (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3447 #17 0x00007ffff5e6630d in g_closure_invoke (closure=0x555555929260, return_value=0x0, n_param_values=1, param_values=0x7fffffffcfe0, invocation_hint=0x7fffffffcf60) at gclosure.c:804 #18 0x00007ffff5e7898e in signal_emit_unlocked_R (node=node@entry=0x55555582ac70, detail=detail@entry=0, instance=instance@entry=0x55555588b150, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffcfe0) at gsignal.c:3635 #19 0x00007ffff5e811a5 in g_signal_emit_valist (instance=0x55555588b150, signal_id=<optimized out>, detail=0, var_args=var_args@entry=0x7fffffffd1b0) at gsignal.c:3391 #21 0x000055555558e43f in nmt_newt_widget_activated (widget=0x55555588b150 [NmtNewtListbox]) at clients/tui/newt/nmt-newt-widget.c:329 #22 0x0000555555584fc8 in nmt_newt_form_iterate (form=0x555555922a00 [NmtAddConnection]) at clients/tui/newt/nmt-newt-form.c:309 #23 0x0000555555585d62 in nmt_newt_form_keypress_callback (fd=1435623072, condition=G_IO_IN, user_data=0x0) at clients/tui/newt/nmt-newt-form.c:335 #24 0x00007ffff598a247 in g_main_dispatch (context=0x5555557c3af0) at gmain.c:3234 #25 0x00007ffff598a247 in g_main_context_dispatch (context=context@entry=0x5555557c3af0) at gmain.c:3899 #26 0x00007ffff598a5e8 in g_main_context_iterate (context=0x5555557c3af0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3972 #27 0x00007ffff598a902 in g_main_loop_run (loop=0x55555591b190) at gmain.c:4168 #28 0x00005555555609b5 in main (argc=1, argv=0x7fffffffd5e8) at clients/tui/nmtui.c:298 Fixes: 6a4af482f02c4342c69cd38dd46c078aeaf60d0d
* core: use ipv4.route-table setting for other IPv4 routesThomas Haller2017-10-091-2/+2
| | | | Including device-routes, default-route, DHCPv4, IPv4LL.
* all: rework configuring route table support by adding "route-table" settingThomas Haller2017-10-092-13/+26
| | | | | | | | | | | | | | | | | | | | | | | | | We added "ipv4.route-table-sync" and "ipv6.route-table-sync" to not change behavior for users that configured policy routing outside of NetworkManager, for example, via a dispatcher script. Users had to explicitly opt-in for NetworkManager to fully manage all routing tables. These settings were awkward. Replace them with new settings "ipv4.route-table" and "ipv6.route-table". Note that this commit breaks API/ABI on the unstable development branch by removing recently added API. As before, a connection will have no route-table set by default. This has the meaning that policy-routing is not enabled and only the main table will be fully synced. Once the user sets a table, we recognize that and NetworkManager manages all routing tables. The new route-table setting has other important uses: analog to "ipv4.route-metric", it is the default that applies to all routes. Currently it only works for static routes, not DHCP, SLAAC, default-route, etc. That will be implemented later. For static routes, each route still can explicitly set a table, and overwrite the per-connection setting in "ipv4.route-table" and "ipv6.route-table".
* shared: pass addr_family as first argument to nm_utils_parse_inaddr*()Thomas Haller2017-10-062-32/+32
| | | | | | | The addr_family should be the first argument. It mirrors inet_pton() and is just nicer. Also, rename the argument from "family" to "addr_family".
* core: cleanup autoconnect retry handling (fix settings-docs.c)Thomas Haller2017-10-041-1/+1
| | | | Fixes: cfb14ce17e77916d8998d444a05cdea726723240
* libnm,cli: add IP setting "route-table-sync"Thomas Haller2017-09-262-0/+18
|
* cli: show additional route attributes in IP4_CONFIG outputThomas Haller2017-09-261-42/+57
|
* cli: refactor printing IP6 device infoThomas Haller2017-09-262-67/+124
|