Commit graph

25996 commits

Author SHA1 Message Date
Thomas Haller
ec332e3a25
cli: show differnt text for state of externally connected devices 2020-06-10 19:45:47 +02:00
Thomas Haller
a3528b1fe8
cli: show external connection in different color 2020-06-10 19:45:46 +02:00
Thomas Haller
16cff1149a
core: fix taking over external connection after restart
When we restart the daemon, it would find the previously present external
connection and assume it. We need to keep it as external.
2020-06-10 19:45:46 +02:00
Thomas Haller
8d6dbd1746
core: add "external" flag for active connections of external devices 2020-06-10 19:45:46 +02:00
Thomas Haller
96c9703b50
core: add "external" flag for connections of external devices
When a device is not marked as unmanaged, but also not actively managed
by NetworkManager, then NetworkManager will generate an in-memory
profile to represent the active state, if the device is up and
configured (with an IP address).

Such profiles are commonly named like "eth0", and they are utterly
confusing to users, because they look as if NetworkManager actually
manages the device, when it really just shows that somebody else configures
the device.

We should express this better in the UI, hence add flags to indicate
that.

In practice, such profiles are UNSAVED, NM_GENERATED, and VOLATILE. But
add an explicit flag to represent that.

https://bugzilla.redhat.com/show_bug.cgi?id=1816202
2020-06-10 19:45:46 +02:00
Beniamino Galvani
0d1df36e58 ovs: merge branch 'bg/ovs-patch-peer-rh1845216'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/534
https://bugzilla.redhat.com/show_bug.cgi?id=1845216
2020-06-10 17:48:51 +02:00
Beniamino Galvani
ffeac35f04 ovs: ignore failures of patch interfaces
When there are two patch ports connected, each of them must reference
the other; however they can't be created in a single transaction
because they are part of different bridges (so, different
connections). Therefore, the first patch that gets activated will
always fail with "No usable peer $x exists in 'system' datapath" until
the second patch exists.

In theory we could also match the error message, however this doesn't
seem very robust as the message may slightly change in the future.
2020-06-10 09:58:25 +02:00
Beniamino Galvani
beb1dba8c1 libnm-core: interpret ovs-patch.peer as an interface name
The 'peer' property of ovs-patch is inserted into the 'options' column
of the ovsdb 'Interface' table. The ovs-vswitchd.conf.db man page says
about it:

  options : peer: optional string
    The name of the Interface for the other side of the patch. The
    named Interface’s own peer option must specify this Interface’s
    name. That is, the two patch interfaces must have reversed name
    and peer values.

Therefore, it is wrong to validate the peer property as an IP address
and document it as such.

Fixes: d4a7fe4679 ('libnm-core: add ovs-patch setting')
2020-06-10 09:28:39 +02:00
Beniamino Galvani
040033a006 wifi: merge branch 'blocktrron/NetworkManager-tm-fix'
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/500
2020-06-09 16:07:23 +02:00
David Bauer
5490011782 nm-supplicant-interface: parse 802.11 IEs after security
Psrse the 802.11 IEs after parsing the security information.

Previously the OWE transition mode flag was potentially removed
in case the security properties changed.

Signed-off-by: David Bauer <mail@david-bauer.net>
2020-06-09 16:07:04 +02:00
David Bauer
45ab623c12 nm-supplicant-interface: fix removal of OWE flag from non-transition mode BSSIDs
Commit 37e7fa38c2 ("nm-supplicant-interface: enable OWE security
when transition mode is available") adds the OWE security flag in
case a valid OWE transtition mode IE is present on the beacon.

It also removes the OWE security flag in case the Iinformation elements
of a beacon are updated and a OWE transition mode IE can't be found.

When a pure OWE AP updates it's Information Elements (e.g. BSS Load
Element), the OWE security flag is falsely removed.

Introduce a new NM_802_11_AP_SEC_KEY_MGMT_OWE_TM security flag and use
it exclusively for OWE transition mode. Don't use the
M_802_11_AP_SEC_KEY_MGMT_OWE security flag on transition-mode APs.

Signed-off-by: David Bauer <mail@david-bauer.net>
2020-06-09 16:07:04 +02:00
Beniamino Galvani
d1e8eb791c tc: merge branch 'bg/tc'
Support more qdiscs.

https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/525
2020-06-08 15:32:10 +02:00
Beniamino Galvani
934777120b tc: add support for tbf qdisc
Add support for Token Bucket Filter queueing discipline.
2020-06-08 15:31:42 +02:00
Beniamino Galvani
b22b4f9101 tc: add support for sfq qdisc
Add support for Stochastic Fairness Queueing queueing discipline.
2020-06-08 15:31:42 +02:00
Beniamino Galvani
f695dd8de3 libnm-core: support variant attributes of type int32 and uint64 2020-06-08 15:31:41 +02:00
Beniamino Galvani
0ca1c7d182 libnm-core: fix parsing of mirred dev attribute
The attribute has a value.
2020-06-08 15:31:41 +02:00
Beniamino Galvani
283f7d0b30 move tc parsing out of nm-device.c
The logic to create platform qdiscs from a setting does not belong to
NMDevice. Move it to NetworkManagerUtils.h.
2020-06-08 15:31:41 +02:00
Beniamino Galvani
d303c65ddf libnm-core: remove unused str_type from tc attribute specifiers 2020-06-08 15:31:41 +02:00
Beniamino Galvani
f768bd8091 shared: add FIXME about interpretation of variant-attribute bytestrings 2020-06-08 15:31:41 +02:00
Thomas Haller
d507563a80
tests: suppress valgrind warning about unsupported syscall for "test-config" 2020-06-07 15:26:07 +02:00
Thomas Haller
49886cedd9
gitlab-ci: avoid signing release build in gitlab-ci
The environment has no GPG key configured, so trying to sign fails.
2020-06-07 15:26:03 +02:00
Thomas Haller
46da6e2905
systemd: fix wrong assertion in sd_lldp_get_neighbors() 2020-06-05 18:20:28 +02:00
Thomas Haller
ab2395c966
device/lldp: drop our own rate limiting for maximum number of LLDP neighbours
Systemd's LLDP client also internally tracks all neighbours, and it thus
already needs a maximum already. For systemd, that is currently 128.
We don't need to implement our own rate limiting on top of that,
because if we wouldn't trust the LLDP client to get this right,
it would be DoS-able already.

Also decrease the number of maximum neighbours from 4k to 128.
Note that already previously we wouldn't ever get more than 128
entries.
2020-06-05 17:05:24 +02:00
Thomas Haller
7d9ba20893
device/lldp: minor cleanups in "nm-lldp-listener.c" 2020-06-05 16:47:09 +02:00
Thomas Haller
7ecc1cfaaf
platform: assert struct alignment of NMPlatformIPRoute/NMPlatformIPAddress type 2020-06-05 15:14:30 +02:00
Thomas Haller
21c96342e9
keyfile: merge branch 'th/keyfile-public-api' (part 1)
https://gitlab.freedesktop.org/NetworkManager/NetworkManager/-/merge_requests/517
2020-06-05 09:18:00 +02:00
Thomas Haller
e2f83d4e92
keyfile: add NMKeyfileHandlerFlags
nm_keyfile_read() and nm_keyfile_write() will be public API.
As such, it must be flexible and extendible for future needs.
There is already the handler callback that fully solves this
(e.g. a future handler event could request whether a certain
behavior is enabled or not).

As additional possibility for future extension, add a flags
argument. Currently no flags are implemented.
2020-06-05 09:17:21 +02:00
Thomas Haller
00b3a3505a
keyfile: add nm_keyfile_handler_data_warn_get() and construct message lazy
Add an accessor for the warning event.

Also, as we now have an accessor, we can construct the warning
message only if it actually needed.
2020-06-05 09:17:20 +02:00
Thomas Haller
4230a1d4fb
keyfile: add accessors for NMKeyfileHandlerData
For introspection/bindings it is cumbersome to access the
fields of the NMKeyfileHandlerData struct. Instead add accessor
functions.

Also, we wouldn't want to expose the struct in public API directly,
because it makes it harder to extend it without breaking ABI.
2020-06-05 09:17:20 +02:00
Thomas Haller
7d47a8fdbf
keyfile: add handler context for all parser callbacks
From inside a callback 4 properties are potentially interesting
to all callbacks: the currenty group, key, setting and property-name.

Refactor the code to track these properties in NMKeyfileHandlerData
and distinguish between the property name and the keyfile key.
2020-06-05 09:17:19 +02:00
Thomas Haller
5c67b72bb7
keyfile: use cleanup attribute for GBytes and GByteArray 2020-06-05 09:17:19 +02:00
Thomas Haller
021726e54e
keyfile: don't check for info->error before calling handle_warn()
When an error gets set, we should abort right away. We should
not come into a situation where we would try to emit another warning.

Don't check for a condition that should never happen and assert
against it.
2020-06-05 09:17:19 +02:00
Thomas Haller
8afb8ba819
keyfile: style cleanup calling handle_warn() 2020-06-05 09:17:18 +02:00
Thomas Haller
ab7d0c62f9
keyfile: rework error reporting from read/write handler
Setting the error on the callback does not work well from bindings.
Instead, let bindings call a (future) nm_keyfile_handler_data_fail_with_error()
function on the handler_data to indicate failure.
2020-06-05 09:17:18 +02:00
Thomas Haller
e3d7ba89e5
keyfile: rename handler variable in KeyfileReaderInfo and KeyfileWriterInfo 2020-06-05 09:17:18 +02:00
Thomas Haller
0bfdb26973
keyfile: add NMKeyfileHandlerData typedef for arguments of keyfile callbacks
As the keyfile handler callback will become public API, it needs to be
usable via bindings. A plain void pointer is not usable. Instead, add
a new type that can be used via introspection.
2020-06-05 09:17:18 +02:00
Thomas Haller
18c1fe6ed8
keyfile: merge NMKeyfile{Read,Write}Type as NMKeyfileHandlerType
This will become public API. The enum for read and write callback
serves very similar purposes. Merge them so that we have fewer
types in the public API.
2020-06-05 09:17:14 +02:00
Thomas Haller
ccac506a8a
build: print deleted references in release.sh script 2020-06-04 13:17:57 +02:00
Thomas Haller
61b9201898
build: print commands in color for release.sh script 2020-06-04 12:31:39 +02:00
Thomas Haller
207fd8dfb1
build: implement release mode "rc" in release.sh script
Still not implemented are the first release candidate (rc1)
and the major release.
2020-06-04 11:54:31 +02:00
Thomas Haller
bbb95c979e
build: optionally sign source tarball in build.sh script
This defaults to $DO_RELEASE. In that case, the script will also GPG sign
the source tarball.

The purpose is that when we do a release we want to ensure that the
published tarball is really the one that we generated. In that case,
the SHA sum would suffice, however that requires you to manually note
it down and compare the result. With the gpg signature, that
verification can be better automated.
2020-06-04 11:33:00 +02:00
Thomas Haller
0ac05a3faa
build: add "release.sh" script
Currently only "minor" and "devel" releases are implement. It's also not yet
tested with --no-dry-run, because that would actually create a release.

Test it when using it the next time.
2020-06-04 10:51:12 +02:00
Thomas Haller
c9b36b1370
libnm/crypto: suppress "-Wstrict-prototypes" warning in NSS library
On Debian sid, libnss3-dev (2:3.53-1) causes a compiler warning:

  In file included from ../libnm-core/nm-crypto-nss.c:13:
  /usr/include/nss/pk11pub.h:951:1: error: function declaration isn't a prototype [-Werror=strict-prototypes]
    951 | int SECMOD_GetSystemFIPSEnabled();
        | ^~~
2020-06-03 23:08:33 +02:00
Thomas Haller
65b6fc7871
nettools: reimport nettools' n-dhcp4 and rework logging
git subtree pull --prefix shared/n-dhcp4/ git@github.com:nettools/n-dhcp4.git master --squash
2020-06-03 22:34:22 +02:00
Thomas Haller
cc3e23d2e5 Squashed 'shared/n-dhcp4/' changes from fb1d43449ba8..6876b73ec113
6876b73ec113 all: rework logging to append logging messages to the event queue
65ca0e4bea32 client: check length of client id for n_dhcp4_client_config_set_client_id()
6a9ca10b7ad6 client: close timer file descriptor explicitly when EPOLL_CTL_ADD fails
e5f3b27f5301 connection: don't fail dispatch in case of receive errors
68790d5ec950 connection: keep trying after a failure in send()
788b03891cd0 n-dhcp4: fix logging macro
6cd0fd5e8b3f probe: request previous address after expiration
ef11c7079ad7 connection: avoid double free of NDhcp4Outgoing
922a9a2326e7 n-dhcp4: fix initialization of the 'secs' DHCP header field
7fff54117436 outgoing: fix uninitialized variable in n_dhcp4_outgoing_append()
27547faaf258 probe: move back to INIT after lease expires
d07cb4e32884 incoming: accept options that are longer than requested
34d365e2267f client: handle invalid return codes gracefully during n_dhcp4_client_dispatch()
2e8c6017f85b n-dhcp4: use packet socket in rebinding state
9a7c82143c06 n-dhcp4: support init-reboot state
e615e3f5b063 n-dhcp4/socket: use SO_REUSEADDR on UDP socket
8dbfa1ad2549 merge branch 'bengal:log'
6e50189fba86 n-dhcp4: log outgoing packets
aea0315d3862 n-dhcp4: log incoming packets
1ca64a82393d n-dhcp4: add logging API
72c16a0028ac client-probe: fix state transitions on timer dispatch
c023ae2ad829 merge branch 'leasetime'
780f94c333ca lease: add n_dhcp4_client_lease_get_basetime()
a94378274cf4 incoming: don't handle 0xFFFFFFFF timestamps special in n_dhcp4_incoming_query_u32()
6bb277aefe0b probe: unconditionally pass ownership of message in n_dhcp4_client_probe_dispatch_io()
1cf87c90c6a1 probe: fix leaking message during client probe
55239cef2d63 lease: remove unreachable code in n_dhcp4_incoming_get_timeouts()
fa5ee7903061 lease: expose the server IP address
0cfce4a4fe07 all: merge branch 'th/build-centos76'
cae4868e5f7e all: avoid {net,linux}/if.h clashes on old distros
05859a3e4d32 all: avoid c_min() macro to work with old GCC
0be7033dd940 probe: arm timers in bound state
8735cdb0f95f ci: switch to c-util automation
a0bb7c69a11a client: fallback to CLOCK_MONOTONIC for timerfd
308cb242caf7 ci: disable valgrind run
468c93195ad3 build: update submodules
9d0f690f9ee8 ci: switch to github actions
9ba143a037bb probe: allocate memory of right size in n_dhcp4_client_probe_option_new()
2546aa2c809d util/link: suppress gcc warning
e4a01f5870a6 ci: drop broken armv7hl
2e2fbfa18f2c build: update submodules
6277dfd20eca Merge pull request #2 from NetworkManager/th/declaration-after-statement
1b660ae2d12a outgoing: avoid "-Werror=declaration-after-statement" warning with static_assert
f34a54cd9719 client/probe: fix memory leak
21e68f3bba80 client/connection: fix memory leak

git-subtree-dir: shared/n-dhcp4
git-subtree-split: 6876b73ec113328712a5cdc2ffb9497fd774c0e2
2020-06-03 22:21:50 +02:00
Thomas Haller
53f27cfd40
shared/n-acd: reimport
git subtree pull --prefix shared/n-acd git@github.com:nettools/n-acd.git master --squash
2020-06-03 22:14:39 +02:00
Thomas Haller
2a30e4b75b Squashed 'shared/n-acd/' changes from 54708168399f..0237ba54bef7
0237ba54bef7 ci: switch to c-util automation
0a8c47d55a65 ci: switch to github-actions
b10e6918ab42 build: update submodules
596b7e70acbe n-acd: fix valgrind warnings
70e2822584e0 build: update submodules
1446edb496d9 ci: drop broken armv7hl
6093f34b019b n-acd: fix leaking socket handle in n_acd_socket_new() when setsockopt() fails

git-subtree-dir: shared/n-acd
git-subtree-split: 0237ba54bef7d91232a9285c2ec93f3e5691a1b2
2020-06-03 22:11:43 +02:00
Thomas Haller
fc11843fdc
shared/c-siphash: reimport
git subtree pull --prefix shared/c-siphash git@github.com:c-util/c-siphash.git master --squash
2020-06-03 22:10:22 +02:00
Thomas Haller
adea439ed2 Squashed 'shared/c-siphash/' changes from 7c42c5925819..996b79578d94
996b79578d94 ci: switch to c-util automation
2d159c7da1d5 ci: switch to github-actions
191416c20ec1 ci: drop broken armv7hl
719b1b0138a2 build: update submodules

git-subtree-dir: shared/c-siphash
git-subtree-split: 996b79578d94a6569c42aae1bf806e63b8c6fa9a
2020-06-03 22:09:14 +02:00
Thomas Haller
f9641b6b47
shared/c-rbtree: reimport
git subtree pull --prefix shared/c-rbtree git@github.com:c-util/c-rbtree.git master --squash
2020-06-03 22:08:05 +02:00