summaryrefslogtreecommitdiff
Commit message (Collapse)AuthorAgeFilesLines
* wipbg/802-1x-fallbackBeniamino Galvani2019-07-113-0/+44
|
* ethernet: honor the 802-1x.optional flagBeniamino Galvani2019-07-111-14/+26
|
* ifcfg-rh: refactor reading 802.1X phase2 auth methodBeniamino Galvani2019-07-111-116/+79
| | | | | | | | | | | | | | | | | Refactor reading the phase2 authentication method for 802.1X: Previously the reader only considered the first item of the space-separated list; but since the 802.1x setting can hold distinct phase2-auth and phase2-autheap properties - both mapped to the same ifcfg-rh variable - we should parse the whole list. We only emit a warning when multiple methods of the same type are found to avoid breaking existing manually written ifcfg files. Moreover, the reader implemented different checks for each of the outer tunneled methods (PEAP, TTLS and FAST); drop those checks and accept whatever the 802.1X setting also consider as valid. Note that some combinations that are in principle valid, like PEAP + EAP-MD5, were dropped before.
* libnm-core: update 802-1x.phase2-auth* documentationBeniamino Galvani2019-07-112-4/+4
|
* all: add 802-1x.optional propertyBeniamino Galvani2019-07-117-0/+78
|
* libnm/crypto: accept TPM2-wrapped PEM keysDaniel Kobras2019-07-103-3/+76
| | | | | | | | | Some tools that NM can interact with (eg. openconnect) have added automated support to handle TPM2-wrapped PEM keys as drop-in replacements for ordinary key files. Make sure that NM doesn't reject these keys upfront. We cannot reliably assume NM to be able to unwrap and validate the key. Therefore, accept any key as long as the PEM header and trailer look ok.
* clients/metta-setting-desc: allow "system" and "dpdk" ovs interface typesLubomir Rintel2019-07-101-1/+1
| | | | These are valid, but were missing.
* core,libnm: merge branch 'th/various-settings-cleanup-5'Thomas Haller2019-07-1015-520/+823
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/199
| * libnm,cli,ifcfg-rh: add connection:wait-device-timeout propertyThomas Haller2019-07-1011-516/+781
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Initscripts already honor the DEVTIMEOUT variable (rh #1171917). Don't make this a property only supported by initscripts. Every useful property should also be supported by keyfile and it should be accessible via D-Bus. Also, I will soon drop NMSIfcfgConnection, so handling this would require extra code. It's easier when DEVTIMEOUT is a regular property of the connection profile. The property is not yet implemented. ifcfg-rh still uses the old implementation, and keyfile is not yet adjusted. Since both keyfile and ifcfg-rh will both be rewritten soon, this property will be implemented then.
| * core: use nm_c_list_elem_free_steal() in _delete_volatile_connection_all ()Thomas Haller2019-07-101-3/+1
| |
| * shared: add NM_CMP_DIRECT_STRCMP() macroThomas Haller2019-07-101-0/+3
| |
| * shared: optimize nm_utils_error_set() for string literalsThomas Haller2019-07-101-1/+7
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If there is only one argument, we can assume this is a plain string. That is especially the case, because g_set_error() is G_GNUC_PRINTF() and would warn if this would be a format string with missing parameters. This is for convenience. Previously, one was compelled to explicitly choose between nm_utils_error_set_literal() and nm_utils_error_set(). Now, it automatically chooses. Note that there are a few things that won't work, like nm_utils_error_set (error, code, "bogus %u escape"); But that's good. You get a compiler warning (as you used to) and it's clear in this case you really need nm_utils_error_set_literal().
| * shared: add nm_pdirect_hash()/nm_pdirect_equal()Thomas Haller2019-07-102-0/+31
|/ | | | | | | | | This follows a pointer to a pointer and compares them. In a sense it's like nm_pstr_*(), which follow a pointer to a string. However, these functions use direct pointer comparison. The purpose is when you hash a key that has as first field a pointer value (and then compare them by pointer equality).
* gitlab-ci: enable test build on Debian 10 (buster)Thomas Haller2019-07-101-0/+5
|
* po: fix a typo in the French translationLuclu72019-07-101-2/+2
| | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/200
* core: fix mangling static IPv6 routes in nm_ip6_config_merge_setting()Thomas Haller2019-07-091-1/+1
| | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1727193 Fixes: 433d2f8659e3 ('core: merge IPv4 and IPv6 version of _nm_ip_config_merge_route_attributes()')
* man: update nm-openswitch exampleFrancesco Giudici2019-07-091-2/+2
| | | | | | | | | | | | | | Seems that a quite common openswitch basic configuration consist of a one bridge, one port and one interface, all with the same interface name. When performing such configuration in NetworkManager you need to specify the slave-type for the ovs-interface, otherwise the master interface specified there may match the bridge interface, resulting in an error. So, let's specify the slave-type for the ovs-interface, so that the example will work also when the same interface name is specified for both the ovs-bridge and the ovs-port. https://bugzilla.redhat.com/show_bug.cgi?id=1638038
* platform/tests: relax check for accepting platform signalsThomas Haller2019-07-091-1/+1
| | | | | | | | | | | | | | nmtst: initialize nmtst_get_rand() with NMTST_SEED_RAND=0 /link/bogus: OK /link/loopback: OK /link/internal: OK /link/external: OK /link/software/bridge: OK /link/software/bond: OK /link/software/team: NMPlatformSignalAssert: ../src/platform/tests/test-link.c:331, test_slave(): failure to accept signal [0,2] times: 'link-changed-changed' ifindex 15 (3 times received) --- stderr --- /builds/NetworkManager/NetworkManager/tools/run-nm-test.sh: line 264: 106682 Trace/breakpoint trap --quiet --error-exitcode= --leak-check=full --gen-suppressions=all --num-callers=100 --log-file= The test failed. Also check the valgrind log at '/builds/NetworkManager/NetworkManager/build/src/platform/tests/test-link-linux.valgrind-log'
* libnm/crypto: use memmem() instead of naive O(n*m) search in find_tag()Thomas Haller2019-07-081-12/+14
|
* settings: fix a reversed conditional in have_connection_for_device()Lubomir Rintel2019-07-081-1/+1
| | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1727411 Fixes: be0018382d4d ('settings: in have_connection_for_device() first skip over irrelevant connection types')
* build: add missing dependency for shared/systemd/src/sharedBeniamino Galvani2019-07-081-9/+10
| | | | | | | | | | | | In file included from ./shared/systemd/sd-adapt-shared/nm-sd-adapt-shared.h:21, from shared/systemd/src/shared/dns-domain.c:3: ./shared/nm-default.h:106:10: fatal error: config-extra.h: No such file or directory #include "config-extra.h" ^~~~~~~~~~~~~~~~ compilation terminated. make[1]: *** [Makefile:12933: shared/systemd/src/shared/libnm_systemd_shared_la-dns-domain.lo] Error 1 Fixes: 7d3098ff90ec ('systemd: add dns-domain utils to systemd static library')
* core: merge branch 'bg/slaves-autoconnect-managed'Beniamino Galvani2019-07-082-8/+18
|\ | | | | | | https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/197/commits
| * manager: propagate the for-user-request flag for slaves autoconnectionBeniamino Galvani2019-07-081-5/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | If the master is activated by user, propagate the for-user-request to slaves activations when autoconnecting slaves, so that they can manage slaves device as needed. Reproducer: ip l add eth1 type veth peer name eth2 ip l set eth1 up ip l set eth2 up sleep 2 echo " * Initial state" echo " - eth1: $(nmcli -g general.state device show eth1)" nmcli con add type ethernet ifname eth1 con-name slave-test+ master br-test slave-type bridge nmcli con add type bridge ifname br-test con-name br-test+ connection.autoconnect-slaves yes ip4 172.25.1.1/24 nmcli con up br-test+ echo " * After user activation" echo " - br-test: $(nmcli -g general.state device show br-test)" echo " - eth1: $(nmcli -g general.state device show eth1)" should give: * Initial state - eth1: 10 (unmanaged) * After user activation - br-test: 100 (connected) - eth1: 100 (connected)
| * device: properly honor flags when checking connection availabilityBeniamino Galvani2019-07-081-3/+10
|/ | | | | | | | The previous code returned that the device was available when it had only unmanaged-flags that can be overridden by user, without actually considering the @flags argument. Fixes: 920346a5b98c ('device: add and use overrule-unmanaged flag for nm_device_check_connection_available()')
* dhcp: merge branch 'fg/dhcp_options2env-rh1663253'Francesco Giudici2019-07-0510-213/+850
|\ | | | | | | | | | | https://bugzilla.redhat.com/show_bug.cgi?id=1663253 https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/161
| * dispatcher: add MS Azure endpoint env var expected by cloud-initfg/dhcp_options2env-rh1663253Francesco Giudici2019-07-051-0/+35
| | | | | | | | | | | | | | | | | | | | | | | | | | | | Some linux distros (e.g., RHEL, CentOS and Fedora) ship a dispatcher script with their dhclient package in order to run user dhclient hook scripts also when connections are run by NetworkManager. The scripts convert the var names in the environment to the ones expected in the dhclient hook scripts. This feature is currently use by cloud-init to retrieve the MS Azure server endpoint address, which is sent in the private dhcp option 245. We just redefined the default dhclient var names for the private options from "unknown_xyz" to "private_xyz". In order to let current cloud-init version to be able to retrieve the Azure server endpoint address, add the legacy var name "unknown_245" to the dispatcher script environment.
| * dispatcher/trivial: fix typo in commentFrancesco Giudici2019-07-051-1/+1
| |
| * dhcp/dhclient: expose the private_xyz labels for dhcp private optionsFrancesco Giudici2019-07-051-3/+47
| | | | | | | | alias the default "unknown_xyz" labels when found.
| * dhcp/internal: move dhcp options management to shared dhcp codebaseFrancesco Giudici2019-07-055-290/+597
| |
| * dhcp/internal: expose on D-Bus all the private dhcp optionsFrancesco Giudici2019-07-051-0/+85
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | when dhclient is used as the dhcp client in NetworkManager we expose on D-Bus all the variables that are passed to our script file. In particular, we use the variable names there as labels (stripping the heading "new") taking whatever dhclient passes us. There are few exception to this. Dhclient allows to redefine option variable names and we use this functionality for a few dhcp options: dhcp option code 121 --> "rfc3442_classless_static_routes" dhcp option code 249 --> "ms_classless_static_routes" dhcp option code 252 --> "wpad" Note that for private dhcp options (224-254) default dhclient labels are in the form "unknown_$OPTNUM".
| * dhcp: access internal systemd structure to retrieve dhcp private optionsFrancesco Giudici2019-07-054-0/+91
| |
| * dhcp/internal: expose on D-Bus some more dhcp optionsFrancesco Giudici2019-07-051-2/+46
| | | | | | | | | | | | | | | | | | | | | | | | | | When using the internal dhcp client we skip exporting on D-Bus many of the dhcp options received from the dhcp server. We instead export almost all of them when using the dhclient dhcp client, using the variable names passed by dhclient itself. Map more DHCP options to dhclient variable names in order to allow the internal client to retrieve them easily, namely: the server identifier, the broadcast address, the renewal time, the rebinding time and the timezone. Note that not all the DHCP options can be exported at this time because systemd-networkd code drops many it won't process, so we have no way to retrieve them without changing core systemd-networkd code.
| * dhcp/internal: expose on D-Bus the lease time dhcp optionFrancesco Giudici2019-07-051-3/+4
| | | | | | | | | | | | It was already exposed implicity as the expiration time: add also the explicit option using same format of dhclient dhcp plugin. In the meanwhile, drop the SD_DHCP_OPTION_CLIENT_IDENTIFIER as not used.
| * dhcp/internal: decrease logging level when retrieving dhcp optionsFrancesco Giudici2019-07-051-32/+62
|/ | | | | | Use DEBUG logging level for the parsing result of lease file. Moreover, use consistent labels for the dhcp options: same labels of what is exposed on D-Bus.
* dhcp: merge branch 'bg/nettools'Beniamino Galvani2019-07-0527-55/+1656
|\ | | | | | | | | | | Introduce the nettools DHCPv4 backend. https://gitlab.freedesktop.org/NetworkManager/NetworkManager/merge_requests/171
| * n-dhcp4: client/probe: fix memory leakBeniamino Galvani2019-07-051-0/+1
| | | | | | | | | | | | | | | | | | The probe takes a reference to the current lease and so it must release it upon destruction. Signed-off-by: Beniamino Galvani <bgalvani@redhat.com> https://github.com/nettools/n-dhcp4/pull/1
| * n-dhcp4: client/connection: fix memory leakBeniamino Galvani2019-07-051-0/+1
| | | | | | | | | | | | | | | | Free the request when the connection gets destroyed. Signed-off-by: Beniamino Galvani <bgalvani@redhat.com> https://github.com/nettools/n-dhcp4/pull/1
| * dhcp: pass broadcast address to clientsBeniamino Galvani2019-07-057-17/+73
| | | | | | | | | | Read the broadcast address from platform and pass it to clients. Currently only the nettool backends uses it.
| * core: drop nm_platform_link_get_address_as_bytes()Beniamino Galvani2019-07-054-17/+26
| | | | | | | | | | | | Drop nm_platform_link_get_address_as_bytes() and introduce nmp_link_address_get_as_bytes() so that it becomes possible to obtain also the broadcast address without an additional lookup of the link.
| * dhcp: nettools: improve error messagesBeniamino Galvani2019-07-051-5/+5
| | | | | | | | | | | | | | Add the reason to error messages to make debugging easier. Note that n_dhcp4_client_new() also returns positive internal error values, so we can't use nm_utils_error_set_errno().
| * dhcp: nettools: decrease initial delayBeniamino Galvani2019-07-051-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | I think that artificially slowing down DHCP is not going to make users happier, so let's decrease it to the minimum allowed value (1 ms). Note that also dhclient and the internal client have it disabled. From the dhclient.conf man page: *initial-delay* parameter sets the maximum time client can wait after start before commencing first transmission. According to RFC2131 Section 4.4.1, client should wait a random time between startup and the actual first transā€ mission. Previous versions of ISC DHCP client used to wait random time up to 5 seconds, but that was unwanted due to impact on startup time. As such, new versions have the default initial delay set to 0. To restore old behavior, please set initial-delay to 5.
| * dhcp: nettools: support the FQDN optionBeniamino Galvani2019-07-051-8/+45
| | | | | | | | | | Add option 81 (FQDN) when the ipv4.dhcp-fqdn property is set. We don't support changing the FQDN flags yet.
| * shared: add nm_sd_dns_name_to_wire_format()Beniamino Galvani2019-07-052-0/+14
| | | | | | | | | | | | Add nm_sd_dns_name_to_wire_format() based on systemd utilities to convert a name into its wire format according to RFC 1035 section 3.1. It will be used to build the content of the DHCP FQDN option.
| * systemd: add dns-domain utils to systemd static libraryBeniamino Galvani2019-07-055-6/+7
| | | | | | | | | | | | | | dns-domain.c contains useful functions for manipulating DNS names. Add it to the systemd static library we build in shared/, similarly to what we already do for other utility files that were originally in src/systemd/src/basic/.
| * dhcp: nettools: relicense as LGPLBeniamino Galvani2019-07-051-4/+5
| | | | | | | | Acked-by: Tom Gundersen <teg@jklm.no>
| * n-dhcp4: avoid {net,linux}/if.h clashes on old distrosTom Gundersen2019-07-054-7/+8
| | | | | | | | | | | | | | In particular, avoid including linux/netdevice.h from headers. This is not a problem on newer distros, but required for CentOS 7.6. Signed-off-by: Tom Gundersen <teg@jklm.no>
| * shared/n-dhcp4: avoid c_min() macro to work with old GCCTom Gundersen2019-07-052-4/+13
| | | | | | | | | | This is required for the CI to pass, as CentOS has a too old version of GCC. Ideally this patch should be dropped.
| * dhcp: add nettools dhcp4 clientTom Gundersen2019-07-0510-6/+1429
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | This is inspired by the existing systemd integration, with a few differences: * This parses the WPAD option, which systemd requested, but did not use. * We hook into the DAD handling, only making use of the configured address once DAD has completed successfully, and declining the lease if it fails. There are still many areas of possible improvement. In particular, we need to ensure the parsing of all options are compliant, as n-dhcp4 treats all options as opaque, unlike sd-dhcp4. We probably also need to look at how to handle failures and retries (in particular if we decline a lease). We need to query the current MTU at client startu, as well as the hardware broadcast address. Both these are provided by the kernel over netlink, so it should simply be a matter of hooking that up with NM's netlink layer. Contribution under LGPL2.0+, in addition to stated licenses.
| * dhcp: support notifying the client of the result of DADTom Gundersen2019-07-053-2/+50
|/ | | | | | | | | | The DHCP client is not meant to use the assigned address before DAD has completed successfully, if enabled. And if DAD fails, the server should be notified with a DECLINE, in order to potentially blacklist the address. Currently, none of the clients support this, but add the required callbacks, and allow clients to opt in if they want.
* systemd: merge branch systemd into masterBeniamino Galvani2019-07-0544-463/+986
|\