Commit Graph

22377 Commits

Author SHA1 Message Date
Beniamino Galvani
a68b1827ec clients: fix string list setter
Fixes: 5d3736ac65

https://bugzilla.redhat.com/show_bug.cgi?id=1671200
2019-01-31 08:55:19 +01:00
Benjamin Berg
5ae4245be2 manager: Fix GVariant format strings for AddAndActivate2 return value
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: fbb038af5e

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/73
2019-01-29 13:30:14 +01:00
Rafael Fontenelle
4cc54941cc po: update Brazilian Portuguese (pt_BR) translation
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/71
2019-01-29 12:44:03 +01:00
Thomas Haller
7d5da12e8e wifi-p2p: don't assert for pending action 'waiting-for-supplicant' in 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: 00e64d1332
2019-01-28 16:43:57 +01:00
Thomas Haller
a4f2435d51 NEWS: merge branch 'benzea/news-updates'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/70
2019-01-28 16:42:07 +01:00
Benjamin Berg
3142681bef NEWS: Add an entry for Wi-Fi P2P 2019-01-28 16:16:34 +01:00
Benjamin Berg
6fba839f78 NEWS: Add an entry for NMKeepAlive and DBus client binding 2019-01-28 16:16:30 +01:00
Beniamino Galvani
63b90f0dd1 libnm-core: fix team link-watcher struct layout
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: f44c793f6c

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/110
2019-01-28 08:18:09 +01:00
Thomas Haller
ce3f7bf812 wifi-p2p: merge branch 'benzea/p2p-wifi'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/24
2019-01-27 23:46:28 +01:00
Benjamin Berg
d8bc41bb58 libnm: Expose the P2PPeer WfdIEs property 2019-01-27 23:45:12 +01:00
Benjamin Berg
6b74d006e6 libnm: Add routines to start/stop a P2P find operation 2019-01-27 23:45:12 +01:00
Benjamin Berg
dd0c59c468 core/devices: Add DBus methods to start/stop a P2P find
By default the find will run for 30s. This can be increased or decreased
in the range of 1-600s by setting "Timeout" in the options parameter.
2019-01-27 23:45:12 +01:00
Benjamin Berg
6420a2c1fd libnm: Add NMDeviceP2PWifi 2019-01-27 23:45:12 +01:00
Benjamin Berg
adb8338408 libnm: Add class to handle P2P peers
This adds the introspection data and P2P peer handling to libnm. To be
usable the P2P device handling is also needed.
2019-01-27 23:45:12 +01:00
Benjamin Berg
959886892a core/devices: Automatically create P2P device for wifi devices
If a wifi device supports P2P mode, then create a further P2P device for
it automatically.
2019-01-27 23:45:12 +01:00
Benjamin Berg
00e64d1332 core/devices: Add P2P Wifi device and peer tracking
This only adds the new device type and simple peer list handling.
2019-01-27 23:45:12 +01:00
Benjamin Berg
42e60e327f core: Add basic P2P Wi-Fi Settings
The support is rather basic and only allows connecting to a specific
peer. However, this is actually already enough for many usecases.
2019-01-27 23:45:11 +01:00
Lubomir Rintel
c7d6e55ed7 ppp-manager: fix a typo in a debugging statement
Discovered by GCC 9:

  src/ppp/nm-ppp-manager.c: In function ‘_ppp_manager_start’:
  ./src/nm-logging.h:59:9: error: ‘%s’ directive argument is null [-Werror=format-overflow=]

Fixes: 35d9169c3c
2019-01-27 17:24:59 +01:00
Thomas Haller
b707da27d8 gitlab-ci: add test with Fedora:latest image 2019-01-27 15:36:03 +01:00
Beniamino Galvani
76c1b94fe0 clients: update settings doc header file 2019-01-25 11:24:08 +01:00
Beniamino Galvani
4ecd4f8cf9 libnm-core: fix gtk-doc comment
Fixes: d81e10942f
2019-01-25 11:21:58 +01:00
Rafael Fontenelle
d81e10942f all: fix misspellings
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/64
2019-01-24 17:19:44 +01:00
Lubomir Rintel
3f46542821 Merge branch 'master' into 'master'
Update Ukrainian translation

See merge request NetworkManager/NetworkManager!66
2019-01-24 16:12:57 +00:00
Yuri Chornoivan
d79ae0f149 Update Ukrainian translation 2019-01-24 15:25:43 +02:00
Dennis Brakhane
687be0d017 po/de: fix typo
https://github.com/NetworkManager/NetworkManager/pull/289
2019-01-24 08:32:48 +01:00
Thomas Haller
862721d269 release: bump version to 1.15.2 (development) 2019-01-22 20:56:31 +01:00
Thomas Haller
81da34eb1e all: merge branch 'th/various-for-wireguard-1'
https://github.com/NetworkManager/NetworkManager/pull/282
2019-01-22 16:31:59 +01:00
Thomas Haller
69ce5def41 libnm: minor cleanup releasing setting from NMConnection
There are two callers that are concerned with disconnecting/releasing a
setting:

 - _setting_release_hfr() (formerly _setting_release())

 - _nm_connection_add_setting() for the @s_old setting

Compared to one caller that connects/adds a setting (_nm_connection_add_setting()).

Refactor the two callers to use the same helper function
(_setting_release()) so that the implementation of how to release a
setting is at one place.

This patch was originally done when adding another signal to NMSetting.
That did not happen (yet), but the refactoring still makes sense.
2019-01-22 16:30:23 +01:00
Thomas Haller
021564c069 libnm: fix unregistering signal handler of NMConnection from NMSetting
Seems we didn't actually unregister the signal handlers. Ups.

Fixes: dfba4ce1e1
2019-01-22 16:30:23 +01:00
Thomas Haller
08a0f682e1 libnm: always call clear_secrets() function for all properties
And merge it with the version that uses no flags.

Previously, clear_secrets(_with_flags()) was only implemented
by NMSettingVpn. All other settings would only consider GObject-based
properties.

As we will add secrets that have no GObject property, call the virtual
function always, so that the setting can hook into this (for WireGuard
peers).
2019-01-22 16:30:23 +01:00
Thomas Haller
2210d4514e libnm: merge _nm_setting_clear_secrets() and *_with_flags() 2019-01-22 16:30:23 +01:00
Thomas Haller
d2388250d6 libnm: fix secret-name parameter in NMSettingClearSecretsWithFlagsFn for VPN
The secret name should be the one that we can pass to nm_setting_get_secret_flags().
It's wrong to call the function repeatedly with secret-name "secrets".

Probably nobody cared anyway about the name. nm_connection_clear_secrets_with_func()
is used to clear secrets based on the flags, not the secret-name.

Fixes: 2b2404bbef
2019-01-22 16:30:23 +01:00
Thomas Haller
3a915a0205 libnm: support nm_setting_duplicate() for non-GObject base properties
Add a hook so that we can overwrite the property info.

Yes, this is an API/ABI change for NMSettingClass, which is in a
header file. But this is not API that we want to support. Users must
not use this. Alternatively, I could hook the callback into
NMSettInfoSetting, but either works.
2019-01-22 16:30:23 +01:00
Thomas Haller
f5a86dee43 libnm/trivial: rename local variable 2019-01-22 16:30:23 +01:00
Thomas Haller
6f8c7b580d platform: add @replace_peers argument to nm_platform_link_wireguard_change()
The caller may not wish to replace existing peers, but only update/add
the peers explicitly passed to nm_platform_link_wireguard_change().

I think that is in particular interesting, because for the most part
NetworkManager will configure the same set of peers over and over again
(whenever we resolve the DNS name of an IP endpoint of the WireGuard
peer).

At that point, it seems disruptive to drop all peers and re-add them
again. Setting @replace_peers to %FALSE allows to only update/add.
2019-01-22 16:30:23 +01:00
Thomas Haller
78ce4307c0 platform: add and use nm_sock_addr_union_to_string()
We still don't use getnameinfo(). This is used for logging,
where we want to see a string representation that is as close
as possible to the actual bytes (to spot differences). It should
not be obfuscated by a libc function out of our control.

Also fix the notation for the IPv6 scope ID to use the common '%'
character.
2019-01-22 16:30:23 +01:00
Thomas Haller
32749cea99 platform: support missing endpoint in _wireguard_create_change_nlmsgs() 2019-01-22 16:30:23 +01:00
Thomas Haller
977b033d12 platform: improve API of sockaddr handling
Add cmp/hash functions that correctly honor the well known fields, instead
of doing memcmp/memcpy of the entire sockaddr structure.

Also, move the set function to nm_sock_addr_union_cpy() and
nm_sock_addr_union_cpy_untrusted(). This also gets it right
to ensure all bytes of the union are initialized (to zero).
2019-01-22 16:30:23 +01:00
Thomas Haller
744e11dc0d shared: add "struct in_addr" union member to NMIPAddr struct
NMIPAddr is a union of IPv4 and IPv6 addresses.

A lot of our internal API handles IPv4 as in_addr_t / guint32 / be32_t
types, as such the union field "addr4" is just a plain number. Possibly
the internal API should be all refactored to prefer "struct in_addr"
instead, but that is yet to be done.

Anyway, at a few places we will need also access to the IPv4 address in form of
a `struct in_addr`. Add an alias for that.

I am not too happy about the resulting naming. It would be nicer to have

    struct in_addr  addr4;
    struct in6_addr addr6;
    in_addr_t       s_addr4;

but for now, don't do such renaming.
2019-01-22 16:30:23 +01:00
Thomas Haller
035c4ad45d shared: suppress -Wstringop-truncation warning in nm_strndup_a()
The compiler is too smart for nm_strndup_a(). The code is correct,
suppress "-Wstringop-truncation" warning.
2019-01-22 16:30:23 +01:00
Lubomir Rintel
d7d2dafc1b libnm/manager: free the error correctly
Fixes: fbb038af5e
2019-01-21 17:21:35 +01:00
Lubomir Rintel
2ff54b8532 libnm-core/setting-ip-config: drop an unused variable
Upsets clang:

libnm-core/nm-setting-ip-config.c:2688:43: error: unused variable 'setting_class' [-Werror,-Wunused-variable]
        nm_auto_unref_gtypeclass NMSettingClass *setting_class = g_type_class_ref (NM_TYPE_SETTING_IP_CONFIG);

Fixes: a3d6976efc
2019-01-21 14:29:02 +01:00
Thomas Haller
c4eadb709c initrd/trivial: fix whitespace 2019-01-21 14:18:54 +01:00
Lubomir Rintel
125b9a5a5d initrd: make the default connection activatable on multiple devices
The ip=dhcp (without a device name given) and such should activate all
possible devices.

https://github.com/NetworkManager/NetworkManager/pull/284
2019-01-21 13:00:04 +01:00
Beniamino Galvani
58c4cd9cc9 supplicant: don't set PMF when the supplicant doesn't support it
When the supplicant does not support PMF we wrongly set
'ieee80211w=0', but since the option is not recognized the connection
fails. Don't set it when unsupported.

Fixes: a9ab50efb1
2019-01-17 09:40:29 +01:00
Thomas Haller
e7e0100062 shared: fix generic selection of integers in nm_strdup_int()
This fixes a test error, which aims to convert "unsigned long int" type,
but the generic type may not have been covered.

Don't select based on the gint32-like typedefs, but on the basic C
integer types.

Fixes: 8c2d58b237

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/issues/108
2019-01-16 15:45:43 +01:00
Thomas Haller
3409a9750c libnm: merge branch 'th/libnm-settings-properties'
https://github.com/NetworkManager/NetworkManager/pull/279
2019-01-15 10:55:09 +01:00
Thomas Haller
19141ef770 libnm-core: reorder code in settings
Order the code in our common way. No other changes.

- ensure to include the main header first (directly after
  "nm-default.h").

- reorder function definitions: get_property(), set_property(),
  *_init(), *_new(), finalize(), *_class_init().
2019-01-15 09:55:24 +01:00
Thomas Haller
a3d6976efc libnm-core: cleanup NMSetting's class initialization
Unify the coding style for class-init functions in libnm-core.

Also make use of obj_properties, NM_GOBJECT_PROPERTIES_DEFINE(), and
_notify().
2019-01-15 09:55:24 +01:00
Thomas Haller
450a471dfe libnm: fix notifying "mac-address-randomization" property change
Fixes: 7f63c875f9
2019-01-15 09:55:23 +01:00