summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* libnm-core: drop unused includes from "nm-setting.c"th/various-for-wireguard-2Thomas Haller2019-02-041-9/+0
|
* libnm,core: make for-each-secret implementation virtual functions of NMSettingThomas Haller2019-02-045-54/+99
| | | | | | | | | | | We already need to special handle regular settings (with secrets as GObject properties) and VPN secrets. Next, we will also need to special handle WireGuard peers, which can have secrets too. Move the code to a virtual function, so that "nm-connection.c" and "nm-setting.c" does not have explicit per-setting knowledge.
* libnm,core: various cleanups of _nm_connection_for_each_secret()Thomas Haller2019-02-042-25/+33
| | | | | | | | - use cleanup attribute to free memory - return floating reference from _nm_connection_for_each_secret(). It's more idiomatic that a function that constructs a variant and returns it, returns a floating variant.
* libnm,core: move _nm_connection_for_each_secret() from core to libnm-coreThomas Haller2019-02-043-147/+164
| | | | | | | | | | | | | _nm_connection_for_each_secret() (formerly for_each_secret()) and _nm_connection_find_secret() (formerly find_secret()) operate on a GVariant of secrets. For that, they implement certain assumptions of how to handle secrets. For example, it must special-case VPN settings, because there is no generic abstraction to handle regular secret and VPN secrets the same. Such special casing should only be done in libnm-core, at one place. Move the code to libnm-core as internal API.
* settings: fix handling of VPN secrets in for_each_secret()Thomas Haller2019-02-041-5/+6
| | | | | | | | | | | | nm_setting_get_secret_flags() looks whether we have a suitable "-flags" data value, or whether we have a secret with that name. In fact, we know this is a valid secret-name. Even if there are no secret-flags and the secret (currently) does not exists. We shall not care about the return value. Note that nm_setting_get_secret_flags() also for non-secrets will set the flags to "NONE", which is just what we need.
* settings: fix for_each_secret() to check variant type of VPN secretsThomas Haller2019-02-041-0/+7
| | | | | We cannot just blindly assume that the variant is of the right type to iterate over it.
* settings: fix leaking variant in for_each_secret()Thomas Haller2019-02-041-0/+1
| | | | Fixes: df6706813a698e7a697739b0940bd8f528713aab
* libnm: rework _nm_setting_aggregate() to delegate to setting classThomas Haller2019-02-044-40/+50
| | | | | | | | Instead of special-casing the aggregate implementation for NMSettingVpn, delegate to a virtual function. This will also work with other settings, that have properties/secrets that are not GObject based properties.
* libnm: extend nm_setting_enumerate_values() to support non-GObject base ↵Thomas Haller2019-02-043-29/+53
| | | | | | | | properties While nm_setting_enumerate_values() should not be used anymore, still extend it to make it workable also for properties that are not based on GObject properties.
* libnm: emit "notify:name" signal when changing gendata property ↵Thomas Haller2019-02-041-3/+8
| | | | | | | | (NMSettingEthtool) We want to emit a change notification when gendata-based settings (like NMSettingEthtool) change. But instead of adding a separate signal, just emit a fake "notify:name" notification.
* libnm: add _nm_setting_emit_property_changed() functionThomas Haller2019-02-042-1/+32
| | | | Will be used next.
* build: merge branch 'bg/lto'Beniamino Galvani2019-02-0410-18/+50
|\ | | | | | | | | | | | | Fix LTO builds. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/76 https://bugzilla.gnome.org/show_bug.cgi?id=782525#c4
| * contrib/rpm: add option to enable LTO for RPM buildThomas Haller2019-02-041-0/+11
| |
| * all: avoid bogus compiler warning about uninitialized variableThomas Haller2019-02-045-6/+10
| | | | | | | | | | | | | | With LTO and optimizations, gcc issues several bogus "maybe-uninitialized" warnings. Work-around them by initializing the variables.
| * tests: use NM_CONST_MAX() macro where a constant expression is requiredThomas Haller2019-02-041-1/+1
| | | | | | | | | | Otherwise, "nm-utils/nm-test-utils.h" won't work after we include systemd headers.
| * shared: add NM_CONST_MAX() macroThomas Haller2019-02-041-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | There is: 1) glib's MAX() macro, which evaluates arguments multiple times, but yields a constant expression, if the arguments are constant. 2) NM's NM_MAX() macro, which evaluates arguments exactly once, but never yields a constant expression. 3) systemd's MAX() which is like NM_MAX(). Now, it's sensible to use char buf[MAX (A_CONSTANT, ANOTHER_CONSTANT)]; and this works with glib's variant (1). However, when we include systemd headers, 1) gets redefined to 3), and above no longer works. That is because we we don't allow VLA and systemd's macro gives not a constant expression. Add NM_CONST_MAX() macro which is like systemd's CONST_MAX(). It can only operate on constant arguments.
| * build: fix building with LTOBeniamino Galvani2019-02-043-4/+13
| | | | | | | | | | | | | | Building with link-time optimization requires some tricks explained in [1]. [1] https://gcc.gnu.org/bugzilla/show_bug.cgi?id=48200#c28
| * shared: convert macro argument to lowercaseBeniamino Galvani2019-02-041-8/+8
|/
* platform/tests: increase timeout for platform testsThomas Haller2019-02-041-1/+1
| | | | | Seems 180 seconds is still not enough for "/link/create-many-links/1000" tests on gitlab-CI.
* wifi-p2p: merge branch 'th/wifi-p2p-various' (pt1)Thomas Haller2019-02-0149-2185/+2061
|\ | | | | | | https://github.com/NetworkManager/NetworkManager/pull/290
| * clients/trivial: move code in nm-meta-setting-desc aroundThomas Haller2019-02-011-120/+120
| | | | | | | | Sort by name.
| * wifi-p2p: rename Wi-Fi P2PThomas Haller2019-02-0132-686/+690
| | | | | | | | | | After renaming the files, also rename all the content to follow the "Wi-Fi P2P" naming scheme.
| * wifi-p2p: rename files for consistent Wi-Fi P2P namingThomas Haller2019-02-0121-64/+64
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | We named the types inconsistently: - "p2p-wireless" ("libnm-core/nm-setting-p2p-wireless.h") - "p2p" ("libnm/nm-p2p-peer.h") - "p2p-wifi" ("src/devices/wifi/nm-device-p2p-wifi.h") It seems to me, "libnm/nm-p2p-peer.h" should be qualified with a "Wi-Fi" specific name. It's not just peer-to-peer, it's Wi-Fi P2P. Yes, there is an inconsistency now, because there is already "libnm/nm-access-point.h". It seems to me (from looking at the internet), that the name "Wi-Fi P2P" is more common than "P2P Wi-Fi" -- although both are used. There is also the name "Wi-Fi Direct". But it's not clear which name should be preferred here, so stick to "Wi-Fi P2P". In this first commit only rename the files. The following commit will rename the content.
| * core/device-p2p-wifi: drop unused codeThomas Haller2019-02-012-38/+0
| | | | | | | | If this is going to be implemented, revert the patch.
| * core/device-p2p-wifi/trival: move codeThomas Haller2019-02-011-76/+76
| | | | | | | | Have the class_init() function at the bottom.
| * core/p2p-wifi: various minor cleanupsThomas Haller2019-02-014-15/+13
| |
| * libnm/device-p2p-wifi: drop API that still needs considerationThomas Haller2019-02-013-82/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Having synchronous API is wrong, or at least questionable. Granted, libnm isn't currently very good about the exact order of things to happen. However synchronous API by design delays events while waiting for the response and hence messes up the ordering. Maybe synchronous API should not be added to libnm. Or at least, if we have synchronous API, we certainly need an asynchrnous variant as well (which is still missing). As synchronous API is not preferred, it should also be named nm_some_thing_sync(), accompanied by nm_some_thing() and nm_some_thing_finish(). The name for the synchronous method should be the odd one and we shouldn't have an nm_some_thing_async(). Yes, libnm is not consistend about that. I am going to drop this API for the moment.
| * libnm-core/setting-p2p-wifi: drop unused codeThomas Haller2019-02-012-13/+0
| | | | | | | | If this is going to be implemented, revert the patch.
| * libnm/device-p2p-wifi: drop unused codeThomas Haller2019-02-012-33/+0
| | | | | | | | If this is going to be implemented, revert the patch.
| * libnm: various cleanup of NMP2PPeer and NMDeviceP2PWifiThomas Haller2019-02-014-234/+224
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | - fix leaking hw_address in finalize(). - reorder code. - avoid double tabs in GObject property definitions. - hide struct definitions from header. - don't use signal slots in class structure. - use NM_GOBJECT_PROPERTIES_DEFINE_BASE(). - add missing NM_AVAILABLE_IN_1_16 annotations.
| * libnm/device-p2p-wifi: cleanup peers handlingThomas Haller2019-02-011-29/+13
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Don't reallocate peers-array nor set it to %NULL. Instead, just emit the signal for the peers and take them out one-by-one. I am slightly surprised, that the peers array does not need to hold a reference on the NMP2PPeer instances. But that seems intentional. I think, the libnm code here should be significantly reworked, but that is for another time. Also, delay clearing the pointers until finalize() method. For the most part, it shouldn't make a difference. Still avoid having the instance in a badly defined state during dispose() (which theoretically could be called multiple times).
| * libnm-core: fix and cleanup validation of WPS-method for Wi-Fi P2P settingThomas Haller2019-02-014-39/+56
| | | | | | | | | | | | | | The check for Wi-Fi P2P's wps-method was not correct. While at it, move the logic to validate WPS-method flags in an utility function.
| * libnm-core: minor cleanup of NMSettingP2PWirelessThomas Haller2019-02-011-3/+16
| |
| * all/trivial: whitespaceThomas Haller2019-02-012-3/+3
| |
| * cli/trivial: order code in "nm-meta-setting-desc.c" alphabeticallyThomas Haller2019-02-011-29/+29
| |
| * introspection/docs: add missing "Since" comments to Wi-Fi P2P D-Bus APIThomas Haller2019-02-012-0/+36
|/
* connectivity: merge branch 'th/connectivity-empty-response'Thomas Haller2019-01-312-38/+105
|\ | | | | | | https://github.com/NetworkManager/NetworkManager/pull/285
| * man: better explain "connectivity.response" in "NetworkManager.conf" manualThomas Haller2019-01-311-5/+8
| |
| * connectivity: don't cache HTTP response for comparing connectivity responseThomas Haller2019-01-311-22/+49
| | | | | | | | | | | | We don't need to remember (and compare) all the bytes that we received. We can just compare them right away, and remember how many good bytes we received.
| * connectivity: fix handling of no-response for captive portal detectionThomas Haller2019-01-312-21/+58
|/ | | | | | | | | | | | | Since we only compare that the HTTP response starts with the expected response, we need to handle the empty expected response specially (because, every response has "" as prefix). So now if connectivity.response is set to "" (empty) we accept: - HTTP status code 204. We ignore and accept any extra data that we might receive. - HTTP status code 200 and an empty (or no) body.
* clients: fix string list setterBeniamino Galvani2019-01-311-1/+1
| | | | | | Fixes: 5d3736ac65f05aadd5b794f3f2595451eab3d2f7 https://bugzilla.redhat.com/show_bug.cgi?id=1671200
* manager: Fix GVariant format strings for AddAndActivate2 return valueBenjamin Berg2019-01-291-2/+2
| | | | | | | | | | AddAndActivate2 returns an empty a{sv} dictionary for extensibility. The format strings to create the methods return value were slightly wrong, causing assertion failures. Fixes: fbb038af5e5d675c994de26da676edfd8e73ffbe https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/73
* po: update Brazilian Portuguese (pt_BR) translationRafael Fontenelle2019-01-291-962/+1014
| | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/71
* wifi-p2p: don't assert for pending action 'waiting-for-supplicant' in ↵Thomas Haller2019-01-281-2/+3
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | nm_device_p2p_wifi_set_mgmt_iface() <info> [1548688998.8282] device (wlan0): supplicant interface state: starting -> ready <debug> [1548688998.8282] device[0x55bd55f19f30] (p2p-dev-wlan0): P2P: Releasing WPA supplicant interfaces. <debug> [1548688998.8282] device[0x55bd55f19f30] (p2p-dev-wlan0): P2P: WPA supplicant management interface changed to /fi/w1/wpa> <warn> [1548688998.8282] device (p2p-dev-wlan0): remove_pending_action (0): 'waiting-for-supplicant' not pending file src/devices/nm-device.c: line 14134 (nm_device_remove_pending_action): should not be reached #0 0x00007f2c58dad1e5 n/a (libglib-2.0.so.0) #1 0x00007f2c58dae51d g_logv (libglib-2.0.so.0) #2 0x00007f2c58dae6f3 g_log (libglib-2.0.so.0) #3 0x000055bd55246104 nm_device_remove_pending_action (NetworkManager) #4 0x00007f2c487c4864 nm_device_p2p_wifi_set_mgmt_iface (libnm-device-plugin-wifi.so) #5 0x00007f2c58e94c73 n/a (libgobject-2.0.so.0) #6 0x000055bd55233112 constructor (NetworkManager) #7 0x00007f2c58e94e8b n/a (libgobject-2.0.so.0) #8 0x00007f2c58e96fde g_object_new_valist (libgobject-2.0.so.0) #9 0x00007f2c58e9733d g_object_new (libgobject-2.0.so.0) #10 0x00007f2c487c4a65 nm_device_p2p_wifi_new (libnm-device-plugin-wifi.so) #11 0x00007f2c487c6655 recheck_p2p_availability (libnm-device-plugin-wifi.so) #12 0x00007f2c487c9119 supplicant_iface_state_cb (libnm-device-plugin-wifi.so) #13 0x00007f2c58525ace ffi_call_unix64 (libffi.so.6) #14 0x00007f2c5852548f ffi_call (libffi.so.6) #15 0x00007f2c58e903a6 g_cclosure_marshal_generic_va (libgobject-2.0.so.0) #16 0x00007f2c58e8f636 n/a (libgobject-2.0.so.0) #17 0x00007f2c58eabb01 g_signal_emit_valist (libgobject-2.0.so.0) Fixes: 00e64d13320f5848a757765c8541e8160aa8e3e2
* NEWS: merge branch 'benzea/news-updates'Thomas Haller2019-01-281-0/+2
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/70
| * NEWS: Add an entry for Wi-Fi P2PBenjamin Berg2019-01-281-0/+1
| |
| * NEWS: Add an entry for NMKeepAlive and DBus client bindingBenjamin Berg2019-01-281-0/+1
|/
* libnm-core: fix team link-watcher struct layoutBeniamino Galvani2019-01-281-1/+1
| | | | | | | | | | As the comment above the union says, structs in the union must have the same layout of arp_ping. 'vlanid' is in the wrong place and breaks that. Fixes: f44c793f6cd89c3e84e83872478daf286821ed64 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/110
* wifi-p2p: merge branch 'benzea/p2p-wifi'Thomas Haller2019-01-2743-85/+4515
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/24
| * libnm: Expose the P2PPeer WfdIEs propertyBenjamin Berg2019-01-273-2/+52
| |