Commit Graph

30304 Commits

Author SHA1 Message Date
Bryan Jacobs
8ae9cf4698 Revert "libnm: buffer reads in nm_vpn_service_plugin_read_vpn_details()"
This partially reverts commit 4a9fcb0fc3, which replaced one-byte
reads with buffered ones in the VPN service plugin.

Unfortunately the buffering means that commands coming after the magic
"DONE" string were being pulled into the buffer. Secrets agents expect
a "QUIT" to come after the "DONE", and since with buffering "QUIT" was
in the buffer, this led to a twenty-second delay on every VPN
connection using a secrets manager.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1164

Fixes: 4a9fcb0fc3 ('libnm: buffer reads in nm_vpn_service_plugin_read_vpn_details()')
2022-03-28 09:39:13 +02:00
Lubomir Rintel
bdcc85de76 release: bump version to 1.37.3 (development) 2022-03-24 21:36:26 +01:00
Lubomir Rintel
79e8f9f258 NEWS: update 2022-03-24 21:33:39 +01:00
Lubomir Rintel
e17f8526dd merge: branch 'lr/dbus-api'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1154
2022-03-22 14:49:19 +01:00
Lubomir Rintel
2df493c00d introspection: fix punctuation and capitalization
Sentences start with a capital letter and end with a period, even if
they are really really short.
2022-03-22 14:48:45 +01:00
Lubomir Rintel
d1e73f0ece introspection: unbreak a couple of docstrings
A couple of argument documentation strings were long enough to be broken
up to span over multiple lines. gdbus-codegen, on the other hand, was
of differing opinion and promptly punished the offense by garbling the
resulting docbook.

Merge the string into single lines.
2022-03-22 14:48:45 +01:00
Lubomir Rintel
87d16e7020 introspection: unbreak o.fd.NM.Device.WifiP2p StartFind() docstring
This one attempts to document an option dictionary in a manner that has
been deemed criminal by the high court of gdbus-codegen.

Beat it back into shape.
2022-03-22 14:48:45 +01:00
Lubomir Rintel
fe9ef5e151 introspection: unbreak o.fd.NM.Settings AddConnection2() docstring
There has been a lot wrong with this one. Aside from the messy
capitalization, it broke the argument documentation into multiple lines,
baffling gdbus-codegen, which, in turn, generated garbage documentation.

Overhaul it.
2022-03-22 14:48:45 +01:00
Lubomir Rintel
b5715b82b6 introspection: unbreak o.fd.NM.Settings.Connection Update2() docstring
There has been a lot wrong with this one. Aside from the messy
capitalization, it broke the argument documentation into multiple lines,
baffling gdbus-codegen, which, in turn, generated garbage documentation.

Overhaul it.
2022-03-22 14:48:43 +01:00
Lubomir Rintel
1358831d03 introspection: use @since
gdbus-codegen provides a way to specify a version number on various
elements. Use it to instead of a plain text paragraph.
2022-03-22 14:47:33 +01:00
Christian Eggers
f6ec6ef364 core: create GMainLoop after daemonizing
The GMainLoop instance (and the default GMainContext singleton) is not
required for trivial operations like --print-config, --version or
--help). If running as SysV daemon, the event file descriptor is
unnecessarily dup'ed from the parent to the child process.

Signed-off-by: Christian Eggers <ceggers@arri.de>

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1160
2022-03-22 13:43:41 +01:00
Yuri Chornoivan
866a28e585 po: update Ukrainian (uk) translation
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1159
2022-03-21 18:13:22 +01:00
Thomas Haller
bd2fc2bf8a gitlab-ci,po,doc: merge branch 'th/build-misc'
buil://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1152
2022-03-21 17:23:02 +01:00
Thomas Haller
20f43d968f po: unify "Language" header field in po files
`msgfmt -vc` warns:

  po/be@latin.po:2: warning: header field 'Language' still has the initial default value

Check all files and update the Language manually.

The documentation ([1]) says that either "ll", "ll_CC" or "ll_CC@variant"
is valid. Update accordingly.

[1] https://www.gnu.org/software/gettext/manual/html_node/Header-Entry.html
2022-03-21 17:19:49 +01:00
Thomas Haller
e8b309e4ef po: update "Project-Id-Version" for po files
`msgfmt -vc` warns:

  po/as.po:9: warning: header field 'Project-Id-Version' still has the initial default value

Update them all:

  $ git grep -l Project-Id-Version | xargs sed 's/^"Project-Id-Version: \(.*\)\\n"$/"Project-Id-Version: NetworkManager\\n"/' -i

The documentation ([1]) says:

  Project-Id-Version
    This is the name and version of the package. Fill it in if it has not already
    been filled in by xgettext.

but don't add the "version". We have these files in git on the devel branch,
so whenever we branch a new release, the version would change. Just say
"NetworkManager".

[1] https://www.gnu.org/software/gettext/manual/html_node/Header-Entry.html
2022-03-21 17:19:47 +01:00
Thomas Haller
1c76c11b42 doc: rename "README" to "README.md"
By having a ".md" extension, gitlab renders a nice page instead of
showing as plain text.

Currently our README is pretty bad. Partly, because it doesn't get
shown nicely.

Rename. The file effectively was already markdown. The old file is
gone.

For this we also need to change the automake flavor to "foreign"
(See [1]).

[1] https://autotools.info/automake/options.html#automake.options.flavors
2022-03-21 17:19:47 +01:00
Thomas Haller
85ceffceb9 contrib/rpm: don't package TODO file
Our TODO file is not well maintained. Don't package it.
2022-03-21 17:19:47 +01:00
Thomas Haller
e721907472 gitlab-ci: rework extends: for "check-{patch,tree}" jobs
The "check-{patch,tree}" jobs use the same container as the default
test on Fedora ("pages_build", which also builds our documentation).

Previously, we thus extended "t_fedora:35". But that way we also
got things that we didn't want (.nm_artifacts and .build@template).

Solve this differently, by letting the jobs directly define what they
need. It's not much more, than extending "t_fedora:35" and workaround
to drop stuff we don't want.
2022-03-21 17:19:47 +01:00
Thomas Haller
569b9d864f gitlab-ci: archive log of test
Our test is long and verbose. The output gets truncated after
a few megabytes, but sometimes it's interesting to see what
happens afterwards. Redirect also to a file and archive it.
2022-03-21 17:19:47 +01:00
Thomas Haller
bbd053bf83 gitlab-ci: print environment variables not part of run-test.sh script
The output of our test scripts is captured by gitlab. It does however
sanitize things that look like secrets. So it was reasonably save
to call `env` from within the test script.

Next, we will redirect (`tee`) the output of the test script to a
file and archive it. When we do that, the output does not get sanitized
and can be downloaded from the artifacts page.

Stop running `env` as part of the test script. Do it instead as a
separate step. After all, it is useful to see the environment variables
of the test. But sanitized.
2022-03-21 17:19:47 +01:00
Thomas Haller
d719bab9f7 gitlab-ci: rename "build.sh" script to "run-test.sh"
It's true, that our gitlab-ci test mostly consists of building NetworkManager.
Hence the name of the script was not entirely wrong. But it's not only building.

I think "run-test.sh" is a much better name. Rename.
2022-03-21 17:19:46 +01:00
Thomas Haller
0614017ac6 dnsmasq/shared: drop "--dhcp-lease-max=50" option
It's not clear why this option is set or why it's necessary. It was
set ever since.

Note that we automatically determines the DHCP range
nm_dnsmasq_utils_get_range(), and with /24 subnets (or larger)
the range spans up to 244 addresses.

With such a DHCP range it doesn't seem to make sense to limit the
number of leases to 50. It also doesn't seem to make sense to limit it
at all. Drop this.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/941

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1156
2022-03-21 17:14:17 +01:00
Thomas Haller
aaf2155023 libnm/docs: fix documentation for "proxy.pac-script" 2022-03-21 15:21:37 +01:00
Thomas Haller
6b191d6ea7 dhcp: simplify nm_dhcp_client_set_effective_client_id()
The "take" parameter of _set_effective_client_id() was always "FALSE". Drop it.
Also, drop _set_effective_client_id() and just call nm_dhcp_client_set_effective_client_id()
directly.
2022-03-21 13:09:28 +01:00
Thomas Haller
874403b588 dhcp: use nm_g_bytes_equal0() in _set_effective_client_id() 2022-03-21 13:04:52 +01:00
Beniamino Galvani
9ac143d2d5 dhcp: fix memory leak
Fixes: 58287cbcc0 ('core: rework IP configuration in NetworkManager using layer 3 configuration')
2022-03-20 17:30:39 +01:00
Thomas Haller
b3192d2d46 device: allow reapply for changed "connection.autoconnect-slaves" property
We list the properties that can be reapplied, and reject the reapply
operation for any other changes. The idea is that usually reapply
of a property requires an explicit implementation (or may not make
sense).

"connection.autoconnect-slaves" is something that takes effect when
activating the master device. It does not matter when the device
is already active, thus there is no need to reject the reapply
operation.

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

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1150
2022-03-18 15:36:43 +01:00
Thomas Haller
14b9a9bd9d connectivity: fix constructing hosts list for CURLOPT_RESOLVE
Curl's CURLOPT_RESOLVE expects one list entry per host. That
documentation ([1]) also makes that clear that the form is
"[+]HOST:PORT:ADDRESS[,ADDRESS]".

The way we constructed the list, only the last entry was honored:

  <trace> [1647551393.5362] connectivity: (eth0,IPv4,25) adding 'fedoraproject.org:80:18.159.254.57' to curl resolve list
  <trace> [1647551393.5363] connectivity: (eth0,IPv4,25) adding 'fedoraproject.org:80:152.19.134.142' to curl resolve list
  <trace> [1647551393.5363] connectivity: (eth0,IPv4,25) adding 'fedoraproject.org:80:18.192.40.85' to curl resolve list
  ...
  <trace> [1647551393.5366] connectivity: (eth0,IPv4,25) adding 'fedoraproject.org:80:85.236.55.6' to curl resolve list
  <trace> [1647551393.5366] connectivity: (eth0,IPv4,25) adding 'fedoraproject.org:80:38.145.60.20' to curl resolve list
  ...
  <trace> [1647551393.5415] connectivity: (eth0,IPv4,25) libcurl: == Info: Added fedoraproject.org:80:18.159.254.57 to DNS cache\012
  <trace> [1647551393.5416] connectivity: (eth0,IPv4,25) libcurl: == Info: RESOLVE fedoraproject.org:80 is - old addresses discarded!\012
  <trace> [1647551393.5416] connectivity: (eth0,IPv4,25) libcurl: == Info: Added fedoraproject.org:80:152.19.134.142 to DNS cache\012
  <trace> [1647551393.5417] connectivity: (eth0,IPv4,25) libcurl: == Info: RESOLVE fedoraproject.org:80 is - old addresses discarded!\012
  ...
  <trace> [1647551393.5422] connectivity: (eth0,IPv4,25) libcurl: == Info: RESOLVE fedoraproject.org:80 is - old addresses discarded!\012
  <trace> [1647551393.5423] connectivity: (eth0,IPv4,25) libcurl: == Info: Added fedoraproject.org:80:38.145.60.20 to DNS cache\012
  <trace> [1647551393.5424] connectivity: (eth0,IPv4,25) libcurl: == Info: Hostname fedoraproject.org was found in DNS cache\012
  <trace> [1647551393.5424] connectivity: (eth0,IPv4,25) libcurl: == Info:   Trying 38.145.60.20:80...\012

There are two possible fixes. Either join all addresses in one
entry, or use the '+' modifier. Do the former.

Now we get:

  <trace> [1647551967.0378] connectivity: (eth0,IPv4,25) set curl resolve list to 'fedoraproject.org:80:38.145.60.21,152.19.134.142,152...
  ...
  <trace> [1647551967.0559] connectivity: (eth0,IPv4,25) libcurl: == Info: Added fedoraproject.org:80:38.145.60.21,152.19.134.142,152.1...
  <trace> [1647551967.0560] connectivity: (eth0,IPv4,25) libcurl: == Info: Hostname fedoraproject.org was found in DNS cache\012
  <trace> [1647551967.0561] connectivity: (eth0,IPv4,25) libcurl: == Info:   Trying 38.145.60.21:80...\012

[1] https://curl.se/libcurl/c/CURLOPT_RESOLVE.html

Reported-by: Bastien Nocera <hadess@hadess.net>

Fixes: 2cec94bacc ('connectivity: use systemd-resolved for resolving the check endpoint')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/issues/648#note_1301596

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1153
2022-03-18 15:02:42 +01:00
Beniamino Galvani
1916c55d3a merge: branch 'hadess/NetworkManager-wip/hadess/curl-logging'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1151
2022-03-18 11:18:26 +01:00
Bastien Nocera
4e6b18e595 connectivity: Add debug to curl queries
Add debug output when we use curl to make queries.

References: https://curl.se/libcurl/c/debug.html
2022-03-17 20:41:31 +00:00
Thomas Haller
18d0ab14bc device: drop unused variable and avoid compiler warning
../src/core/devices/nm-device-ethernet.c:1164:35: error: unused variable error [-Werror,-Wunused-variable]
              gs_free_error GError *error    = NULL;
                                    ^

Fixes: aa9b5e28eb ('ethernet: fix setting ip-ifindex for PPPoE connections')
2022-03-17 19:31:29 +01:00
Lubomir Rintel
b1d11333c0 merge: branch 'lr/supplicant-wep'
The "wep_disabled" capability has now been merged into wpa_supplicant:
https://patchwork.ozlabs.org/project/hostap/patch/20220307085446.706024-1-lkundrak@v3.sk/

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1138
2022-03-17 12:48:16 +01:00
Lubomir Rintel
feee84aac4 wifi: mark WEP connections incompatible if supplicant lacks capability
This allows us to reject activation of WEP profiles very early,
also providing a reasonable error code to the client:

  $ nmcli d wifi connect test
  Error: Failed to add/activate new connection: wpa_supplicant does not support WEP encryption
2022-03-17 12:44:53 +01:00
Lubomir Rintel
41d03a1b17 supplicant: check whether WEP is available
Since version 2.10, it's possible to build wpa_supplicant without WEP
support. In fact, it's disabled by default. Regrettably, there's no
indication in that version as to whether WEP is enabled or not.

A patch has been sent upstream that exposes the information on D-Bus:
https://patchwork.ozlabs.org/project/hostap/patch/20220307085446.706024-1-lkundrak@v3.sk/

This makes use of the above to indicate presence or absence of WEP
support.
2022-03-17 12:44:53 +01:00
Lubomir Rintel
91f076d235 supplicant: add a comment about extending NMSupplCapType
We've failed to amend logging in relevant places twice. Let's add a
hopefully helpful remark.
2022-03-17 12:44:53 +01:00
Lubomir Rintel
78c937cb23 supplicant: log WPA-EAP-SUITE-B-192 capability
Fixes: e874ccc917 ('wifi: add WPA-EAP-SUITE-B-192 support')
2022-03-17 12:44:53 +01:00
Thomas Haller
47519659ed glib-aux: reword code comments for nm_utils_buf_utf8safe_{,un}escape() 2022-03-17 12:28:56 +01:00
Thomas Haller
ca9c67565a connectivity: use GSource instead of source id for tracking timeout/idle source
I think we should move away from using the source-ids.

Having a "GSource*" pointer makes it clearer what this is, compared to a
guint source ID. Also, g_source_remove() always needs to first do a hash
lookup (with locking) to resolve the source ID to the GSource. This is
unnecessary.
2022-03-17 10:27:33 +01:00
Thomas Haller
63d68e7f42 connectivity: minor cleanup resolve_cb() to use nm_utils_addr_family_to_size()
And change code so that clang-format produces nicer alignment.
2022-03-17 10:10:41 +01:00
Thomas Haller
593d08db81 connectivity: skip unexpected addr family from resolved response
In practice, systemd-resolved will give us always AF_INET/AF_INET6. Still,
check for that.
2022-03-17 10:10:22 +01:00
Beniamino Galvani
118561e284 n-dhcp4: discard NAKs from other servers in SELECTING
I got a report of a scenario where multiple servers reply to a REQUEST
in SELECTING, and all servers send NAKs except the one which sent the
offer, which replies with a ACK. In that scenario, n-dhcp4 is not able
to obtain a lease because it restarts from INIT as soon as the first
NAK is received. For comparison, dhclient can get a lease because it
ignores all NAKs in SELECTING.

Arguably, the network is misconfigured there, but it would be great if
n-dhcp4 could still work in such scenario.

According to RFC 2131, ACK and NAK messages from server must contain a
server-id option. The RFC doesn't explicitly say that the client
should check the option, but I think it's a reasonable thing to do, at
least for NAKs.

This patch stores the server-id of the REQUEST in SELECTING, and
compares it with the server-id from NAKs, to discard other servers'
replies.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1144
2022-03-17 09:46:15 +01:00
Thomas Haller
4cc0f41e45 gitlab-ci: make "contrib/debian/REQUIRED_PACKAGES" verbose during container installation
To help debugging the script.
2022-03-16 21:40:54 +01:00
Sergiu Bivol
0c147283c9 po: add Romanian (ro) translation
Over 50% translated so far.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1147
2022-03-16 21:37:20 +01:00
Beniamino Galvani
c65ae9b1db core/tests: fix tests for nm_utils_shorten_hostname()
The test currently fails on systems where HOST_NAME_MAX != 64 (for
example, Alpine Linux). Update the test to not assume a predefined
maximum length.

Fixes: 9498702242 ('core: add nm_utils_shorten_hostname()')

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1149
2022-03-16 11:24:02 +01:00
Beniamino Galvani
3a8a1b0e26 pppoe: merge branch 'bg/pppoe-fix'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/1148
2022-03-16 11:13:55 +01:00
Beniamino Galvani
aa9b5e28eb ethernet: fix setting ip-ifindex for PPPoE connections
When a NMDevice is involved in a PPPoE activation, it means that the
connection has connection.interface-name=<ethernet-interface>. In such
case, the ppp ifindex should be set as ip-ifindex of the ethernet
device.

Fixes: 58287cbcc0 ('core: rework IP configuration in NetworkManager using layer 3 configuration')
2022-03-16 10:43:46 +01:00
Beniamino Galvani
7b2bea7ceb ethernet: don't do DHCPv4 on PPPoE
It's not going to work.

Fixes: 58287cbcc0 ('core: rework IP configuration in NetworkManager using layer 3 configuration')
2022-03-16 10:43:46 +01:00
Beniamino Galvani
041df05f3c ppp: allow autoconf6 when ipv6.method is 'auto'
PPP supports IPv6 autoconfiguration.

Fixes: 58287cbcc0 ('core: rework IP configuration in NetworkManager using layer 3 configuration')
2022-03-16 10:43:46 +01:00
Thomas Haller
2ffa6f7693 libnm/doc: clarify behavior for autoconnect in man nm-settings 2022-03-16 10:10:13 +01:00
Thomas Haller
c7052a7a7e gitlab-ci: bump tag to regenerate containers 2022-03-16 00:58:41 +01:00