Commit graph

26172 commits

Author SHA1 Message Date
Thomas Haller
53bb23b403
build: for signing use key from git's user.signingkey 2020-06-29 09:08:04 +02:00
Thomas Haller
0748bd989d
release: cleanup temporary release-branch and avoid prompt for ftpadmin install 2020-06-28 19:16:20 +02:00
Thomas Haller
99f834842a
release: fix "rc" release build and add option to suppress check for local branches 2020-06-28 19:02:07 +02:00
Thomas Haller
7f93fd8e7b
release: fix RC_VERSION for release script
The release candidate -rc1 has version "1.y.90", -rc2 has "1.y.91", and so
on. Fix the script.
2020-06-28 18:35:03 +02:00
Thomas Haller
8e9e6fd024
release: fix release script for "rc" 2020-06-28 18:06:17 +02:00
Beniamino Galvani
071104124b device: clean up exported IP6 config when flushing addresses
After flushing addresses and routes, it's also necessary to update the
exported IP6 configuration.

https://bugzilla.redhat.com/show_bug.cgi?id=1848888
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/551

Fixes: e302f5ff77 ('device: flush IP configuration of slaves during activation')
2020-06-28 16:57:38 +02:00
Antonio Cardace
cfe349b971
NEWS: update 2020-06-26 16:59:23 +02:00
Antonio Cardace
ccbae2422e
nmcs-gcp: merge branch 'ac/gcp_cloud_support'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/546
https://bugzilla.redhat.com/show_bug.cgi?id=1821787
2020-06-26 16:54:16 +02:00
Antonio Cardace
a2b699f40f
nmcs-gcp: add support for Google Cloud Platform load balancers
This add a provider implementation for GCP that when detected fetches
the ip addresses of configured internal load balancers.

Once this information is fetched from the metadata server it instructs
NetworkManager to add local routes for each found forwarded-ip.

https://bugzilla.redhat.com/show_bug.cgi?id=1821787
2020-06-26 16:47:56 +02:00
Antonio Cardace
75a84677ca
nmcs-main: support adding additional routes
This allows a provider to only add additional routes to the applied profile

https://bugzilla.redhat.com/show_bug.cgi?id=1821787
2020-06-26 16:47:56 +02:00
Antonio Cardace
053bce438b
nmcs-http: add param to GET API to set custom HTTP headers
https://bugzilla.redhat.com/show_bug.cgi?id=1821787
2020-06-26 16:47:56 +02:00
Antonio Cardace
1095cef9a1
main: remove unused argument 2020-06-26 16:47:56 +02:00
Antonio Cardace
d46da9072a
nmcs: fix indentation 2020-06-26 16:47:56 +02:00
Antonio Cardace
aa5959a595
nm-shared-utils: add util to parse out lines from a string
https://bugzilla.redhat.com/show_bug.cgi?id=1821787
2020-06-26 16:47:56 +02:00
Antonio Cardace
3bd30f6064
nmcs: add error message when a HTTP request times out
https://bugzilla.redhat.com/show_bug.cgi?id=1821787
2020-06-26 16:47:55 +02:00
Antonio Cardace
e09bd2339a
nmcs-http: remove the timeout once expired
libcurl's documentation for CURLMOPT_TIMERFUNCTION requires the
application to install a non-repeating timer.

https://curl.haxx.se/libcurl/c/CURLMOPT_TIMERFUNCTION.html

So let's remove the GSource once expired.

Fixes: 69f048bf0c ('cloud-setup: add tool for automatic IP configuration in cloud')
2020-06-26 16:47:55 +02:00
Antonio Cardace
427fbc85f0
nmcs-http: fix multiple HTTP request bug
Since just a single pointer is used to store the socket's GSource
if more than 1 consecutive request was done through the same
HTTP provider the 2nd request would clear the GSource associated to
the second request causing the 1st HTTP request to never complete
and end up in a expired timeout.

Use a hashtable instead so we can correctly track all requests.

https://bugzilla.redhat.com/show_bug.cgi?id=1821787

Fixes: 69f048bf0c ('cloud-setup: add tool for automatic IP configuration in cloud')
2020-06-26 16:47:52 +02:00
Thomas Haller
d18d75f89c
core,libnm: merge branch 'th/kernel-cmdline-match'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/550
2020-06-26 13:32:31 +02:00
Thomas Haller
824ad6275d
libnm/match: extend syntax for match patterns with '|', '&', '!' and '\\'
For simple matches like match.interface-name, match.driver, and
match.path, arguably what we had was fine. There each element
(like "eth*") is a wildcard for a single name (like "eth1").

However, for match.kernel-command-line, the elements match individual
command line options, so we should have more flexibility of whether
a parameter is optional or mandatory. Extend the syntax for that.

- the elements can now be prefixed by either '|' or '&'. This makes
  optional or mandatory elements, respectively. The entire match
  evaluates to true if all mandatory elements match (if any) and
  at least one of the optional elements (if any).
  As before, if neither '|' nor '&' is specified, then the element
  is optional (that means, "foo" is the same as "|foo").

- the exclamation mark is still used to invert the match. If used
  alone (like "!foo") it is a shortcut for defining a mandatory match
  ("&!foo").

- the backslash can now be used to escape the special characters
  above. Basically, the special characters ('|', '&', '!') are
  stripped from the start of the element. If what is left afterwards
  is a backslash, it also gets stripped and the remainder is the
  pattern. For example, "\\&foo" has the pattern "&foo" where
  '&' is no longer treated specially. This special handling of
  the backslash is only done at the beginning of the element (after
  the optional special characters). The remaining string is part
  of the pattern, where backslashes might have their own meaning.

This change is mostly backward compatible, except for existing matches
that started with one of the special characters '|', '&', '!', and '\\'.
2020-06-26 13:29:01 +02:00
Thomas Haller
fa56e52a4f
core/tests: add unit test for nm_utils_kernel_cmdline_match_check() 2020-06-26 13:22:05 +02:00
Thomas Haller
e0f4817148
core: move matching of kernel command line to separate function 2020-06-26 13:22:04 +02:00
Thomas Haller
1641cc1d03
docs: fix escaping XML in "tools/generate-docs-nm-settings-docs-gir.py"
The gtk-doc text that the tool receives is not XML, it's a plain text.
When setting the plain text as XML attribute, we need to properly escape
it. The previous XML escape code was naive, and didn't cover for a
plain ampersand.
2020-06-26 13:22:04 +02:00
Thomas Haller
62747bb076
all: merge branch 'th/strbuf-uses'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/547
2020-06-26 09:36:18 +02:00
Thomas Haller
3b4a4bef7b
supplicant: use NMStrBuf in wifi_freqs_to_string()
And don't access global data without atomic operations.
2020-06-26 09:29:58 +02:00
Thomas Haller
652e0c843b
supplicant: use nm_streq() in "nm-supplicant-config.c" 2020-06-26 09:29:58 +02:00
Thomas Haller
5f202414d9
libnm: refactor wifi frequency handling in libnm
- mark global variables as const. This allows the linker to
  mark the variable as read only.

- for nm_utils_wifi_[25]ghz_freqs(), don't generate a list based
  on bg_table/a_table. Instead, keep static array of frequencies.
  Since we have unit tests that check the consistency, this has
  little maintenance effort.

- add unit tests
2020-06-26 09:29:57 +02:00
Thomas Haller
bd7d8b6f3d
libnm: don't use assert for validating arguments to nm_utils_wifi_find_next_channel() 2020-06-26 09:29:56 +02:00
Thomas Haller
3945471752
libnm: use nm_streq() in "libnm-core/nm-utils.c" 2020-06-26 09:29:56 +02:00
Thomas Haller
6adf4b9a56
libnm: use NMStrBuf in nm_utils_file_search_in_paths() 2020-06-26 09:29:55 +02:00
Thomas Haller
2edb3aa81a
libnm: use NMStrBuf in _nm_utils_uuid_generate_from_strings() 2020-06-26 09:29:55 +02:00
Thomas Haller
936e457cc0
libnm: use NMStrBuf in nm_ip_routing_rule_to_string() 2020-06-26 09:29:54 +02:00
Thomas Haller
3be4f38a15
keyfile: cleanup uses of GString in keyfile code
- in _keyfile_key_decode(), don't use GString. We know the maximum
  string length before, so we can just allocated one buffer.

- in qdisc and tfilter writers, reuse the same GString instance.
  No need to allocate a new temporary string buffer for each iteration.

- at other places, replace GString by NMStrBuf. This avoids the heap
  allocated GString instance. Also, most operations can be inlined.
  This results in larger code side, but avoids function calls to glib.
2020-06-26 09:29:54 +02:00
Thomas Haller
f7715c6680
libnm: use NMStrBuf in "nm-setting-bridge.c" 2020-06-26 09:29:53 +02:00
Thomas Haller
45b346554a
shared: add nm_str_buf_reset() helper 2020-06-26 09:29:53 +02:00
Thomas Haller
d83908b6a1
shared: add nm_utils_escaped_tokens_escape_strbuf*() helpers 2020-06-26 09:29:53 +02:00
Thomas Haller
a5a5656582
shared: add nm_utils_escaped_tokens_escape_unnecessary() util 2020-06-26 09:29:53 +02:00
Thomas Haller
5222f1b5ff
shared: add nm_str_buf_append_required_delimiter() 2020-06-26 09:29:52 +02:00
Thomas Haller
85e27b1f9c
shared: add nm_str_buf_append_c_hex() helper 2020-06-26 09:29:52 +02:00
Thomas Haller
069be33fbd
shared: add nm_hexchar() helper 2020-06-26 09:29:52 +02:00
Thomas Haller
d53abfd989
shared: add nm_str_buf_append0() and nm_str_buf_append_len0() helper
These are basically nm_str_buf_append()/nm_str_buf_append_len() and
nm_str_buf_get_str() in one.
2020-06-26 09:29:52 +02:00
Thomas Haller
506f95ecaf
shared: add NM_UTILS_GET_NEXT_REALLOC_SIZE_32 and _40 macros 2020-06-26 09:29:51 +02:00
Thomas Haller
de4df9f529
shared: return non-const pointer from nm_str_buf_get_str()
It's more convenient in certain cases. The user is allowed
to modified the content of the returned buffer.
2020-06-26 09:29:51 +02:00
Thomas Haller
081650eb67
shared: avoid copying empty string in nm_str_buf_append_printf() 2020-06-25 22:46:27 +02:00
Beniamino Galvani
d0a2eb8f05 libnm: fix wrong assertion in nm_client_check_connectivity_finish()
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/476

Fixes: b44d883d92 ('libnm: implement nm_client_check_connectivity_async() by using GDBusConnection directly')
2020-06-25 14:11:36 +02:00
Beniamino Galvani
3124a05d83 libnm: omit nm_device_*_get_hw_address() from introspection output
When the get_hw_address() method is called on a device object through
GObject-introspection, the device-specific
(e.g. nm_device_ethernet_get_hw_address()) C function is called
instead of the more generic nm_device_get_hw_address().

Those device-specific functions were deprecated in commit 067a3d6c08
('nm-device: expose via D-Bus the 'hw-address' property') and so libnm
will print out deprecation warnings like:

 DeprecationWarning: NM.DeviceEthernet.get_hw_address is deprecated

Omit the device-specific function from the introspection output so
that the generic function will be called instead.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/544
2020-06-25 11:03:23 +02:00
Beniamino Galvani
4efd4e0a61 initrd: merge branch 'bg/initrd-ipv6'
https://bugzilla.redhat.com/show_bug.cgi?id=1848943
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/548
2020-06-24 10:38:58 +02:00
Beniamino Galvani
a39eb9ac14 initrd: set ipv6.method=auto when the autoconfiguration field is 'none'
The 7th field of:

 ip=<client-IP>:[<peer>]:<gateway-IP>:<netmask>:<client_hostname>:<interface>:{none|off|dhcp|on|any|dhcp6|auto6|ibft}:[:[<mtu>][:<macaddr>]]

specifies which kind of autoconfiguration to do. 'none' and 'off' mean
static addresses.

The old network module of dracut used to leave kernel IPv6
autoconfiguration enabled when IPv4 static addresses were
configured. With NM, this corresponds to enabling IPv6 auto method.

https://bugzilla.redhat.com/show_bug.cgi?id=1848943
2020-06-24 10:37:31 +02:00
Beniamino Galvani
f6d654b18f initrd: generate connections with IPv6 method 'auto' instead of 'ignore'
When the initrd generator creates a connection with IPv6 method
'ignore', the kernel will do IPv6 autoconfiguration on the
interface. However, it is preferable to let NetworkManager configure
the interface directly instead of relying on kernel. Therefore, change
the IPv6 method to 'auto'. Note that we still set ipv6.may-fail to
'yes' so that a failure during IPv6 autoconfiguration doesn't bring
down the interface.
2020-06-24 10:37:31 +02:00
Thomas Haller
827dfacf0f
shared,core: merge branch 'th/strsplit-quoted-kernel-cmdline'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/549
2020-06-24 08:40:17 +02:00
Thomas Haller
27041e9f05
core: use nm_utils_strsplit_quoted() for splitting the kernel command line
The kernel command line supports escaping and quoting (at least,
according to systemd's parser, which is our example to follow).

Use nm_utils_strsplit_quoted() which supports that.
2020-06-23 00:42:37 +02:00