Commit graph

15831 commits

Author SHA1 Message Date
Li Song
8a6f6cab22 sd-dhcp: remove unreachable route after rebinding return NAK
(cherry picked from commit cc3981b1272b9ce37e7d734a7b2f42e84acac535)
(cherry picked from commit 915c2f675a)
(cherry picked from commit cb77290a69)
(cherry picked from commit f211b140a5)
(cherry picked from commit 1cfefbb99f)
(cherry picked from commit f3f5441820)
(cherry picked from commit 7337cd21dd)
2018-10-29 21:18:43 +01:00
Yu Watanabe
d589df0639 sd-dhcp6: make dhcp6_option_parse_domainname() not store empty domain
This improves performance of fuzzer.
C.f. oss-fuzz#11019.

(cherry picked from commit 3c72b6ed4252e7ff5f7704bfe44557ec197b47fa)
(cherry picked from commit 50403cccee)
(cherry picked from commit f11f5abb1a)
(cherry picked from commit c836279fca)
(cherry picked from commit 4ca0e57c46)
(cherry picked from commit 32e71d5bc0)
(cherry picked from commit 331e81621e)
2018-10-29 21:18:43 +01:00
Yu Watanabe
77d882583d sd-dhcp-lease: fix memleaks
(cherry picked from commit e2975f854831d08a25b4f5eb329b6d04102e115f)
(cherry picked from commit 157094abd8)
(cherry picked from commit 3fd9d11619)
(cherry picked from commit 4439f07841)
(cherry picked from commit cbd0609cc4)
(cherry picked from commit 3a070225b5)
2018-10-29 21:18:43 +01:00
Evgeny Vereshchagin
86391f2741 dhcp6: fix an off-by-one error in dhcp6_option_parse_domainname
==14==ERROR: AddressSanitizer: heap-buffer-overflow on address 0x60200055fa9c at pc 0x0000005458f1 bp 0x7ffc78940d90 sp 0x7ffc78940d88
READ of size 1 at 0x60200055fa9c thread T0
    #0 0x5458f0 in dhcp6_option_parse_domainname /work/build/../../src/systemd/src/libsystemd-network/dhcp6-option.c:555:29
    #1 0x54706e in dhcp6_lease_set_domains /work/build/../../src/systemd/src/libsystemd-network/sd-dhcp6-lease.c:242:13
    #2 0x53fce0 in client_parse_message /work/build/../../src/systemd/src/libsystemd-network/sd-dhcp6-client.c:984:29
    #3 0x53f3bc in client_receive_advertise /work/build/../../src/systemd/src/libsystemd-network/sd-dhcp6-client.c:1083:13
    #4 0x53d57f in client_receive_message /work/build/../../src/systemd/src/libsystemd-network/sd-dhcp6-client.c:1182:21
    #5 0x7f0f7159deee in source_dispatch /work/build/../../src/systemd/src/libsystemd/sd-event/sd-event.c:3042:21
    #6 0x7f0f7159d431 in sd_event_dispatch /work/build/../../src/systemd/src/libsystemd/sd-event/sd-event.c:3455:21
    #7 0x7f0f7159ea8d in sd_event_run /work/build/../../src/systemd/src/libsystemd/sd-event/sd-event.c:3512:21
    #8 0x531f2b in fuzz_client /work/build/../../src/systemd/src/fuzz/fuzz-dhcp6-client.c:44:9
    #9 0x531bc1 in LLVMFuzzerTestOneInput /work/build/../../src/systemd/src/fuzz/fuzz-dhcp6-client.c:53:9
    #10 0x57bec8 in fuzzer::Fuzzer::ExecuteCallback(unsigned char const*, unsigned long) /src/libfuzzer/FuzzerLoop.cpp:570:15
    #11 0x579d67 in fuzzer::Fuzzer::RunOne(unsigned char const*, unsigned long, bool, fuzzer::InputInfo*, bool*) /src/libfuzzer/FuzzerLoop.cpp:479:3
    #12 0x57dc92 in fuzzer::Fuzzer::MutateAndTestOne() /src/libfuzzer/FuzzerLoop.cpp:707:19
    #13 0x580ca6 in fuzzer::Fuzzer::Loop(std::__1::vector<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> >, fuzzer::fuzzer_allocator<std::__1::basic_string<char, std::__1::char_traits<char>, std::__1::allocator<char> > > > const&) /src/libfuzzer/FuzzerLoop.cpp:838:5
    #14 0x55e968 in fuzzer::FuzzerDriver(int*, char***, int (*)(unsigned char const*, unsigned long)) /src/libfuzzer/FuzzerDriver.cpp:764:6
    #15 0x551a1c in main /src/libfuzzer/FuzzerMain.cpp:20:10
    #16 0x7f0f701a082f in __libc_start_main (/lib/x86_64-linux-gnu/libc.so.6+0x2082f)
    #17 0x41e928 in _start (/out/fuzz-dhcp6-client+0x41e928)

https://github.com/systemd/systemd/pull/10200
b387d3c132
(cherry picked from commit 7cb7cffc49)
(cherry picked from commit cd3aacefdd)
(cherry picked from commit 5b140a77bc)
(cherry picked from commit 0f25f47767)
(cherry picked from commit c13e43979e)
(cherry picked from commit b7b2c8ad38)
2018-10-29 21:18:43 +01:00
Thomas Haller
d8f9054e9b systemd/dhcp: fix assertion starting DHCP client without MAC address
An assertion in dhcp_network_bind_raw_socket() is triggered when
starting an sd_dhcp_client without setting setting a MAC address
first.

  - sd_dhcp_client_start()
    - client_start()
      - client_start_delayed()
        - dhcp_network_bind_raw_socket()

In that case, the arp-type and MAC address is still unset. Note that
dhcp_network_bind_raw_socket() already checks for a valid arp-type
and MAC address below, so we should just gracefully return -EINVAL.

Maybe sd_dhcp_client_start() should fail earlier when starting without
MAC address. But the failure here will be correctly propagated and
the start aborted.

See-also: https://github.com/systemd/systemd/pull/10054
(cherry picked from commit 34af574d58)
(cherry picked from commit 0a797bdc2a)
(cherry picked from commit f37ed84ca4)
(cherry picked from commit 1031b2bb5c)
(cherry picked from commit 4ca49f52fa)
(cherry picked from commit 59941b2124)
2018-10-29 21:18:43 +01:00
Jason Reeder
0e28a30033 libsystemd-network: ipv4ll probe conflict counter (#5361)
A bug exists where the conflict counter is cleared
regardless of whether or not the next probe attempt leads to
a successful address acquisition. This causes 'bursts' of
MAX_CONFLICTS probes followed by a delay of
RATE_LIMIT_INTERVAL instead of a single probe each
RATE_LIMIT_INTERVAL when beyond MAX_CONFLICTS.

The conflict counter should only be cleared after an
address is successfully acquired. This commit achieves that
goal.

From RFC3927:
A host should maintain a counter of the number of address
conflicts it has experienced in the process of trying to
acquire an address, and if the number of conflicts exceeds
MAX_CONFLICTS then the host MUST limit the rate at which it
probes for new addresses to no more than one new address per
RATE_LIMIT_INTERVAL.  This is to prevent catastrophic ARP
storms in pathological failure cases, such as a rogue host
that answers all ARP probes, causing legitimate hosts to go
into an infinite loop attempting to select a usable address.

Signed-off-by: Jason Reeder <jasonreeder@gmail.com>

(cherry picked from commit 0cbc024d591e1b1095d90494e0337dabd9ef2e19)
(cherry picked from commit eb8fd9cdfd)
2018-10-29 21:18:43 +01:00
Lubomir Rintel
3b207f9e58 systemd: drop xlocale.h include
It is not needed and doesn't exist in glibc 2.26 or other libcs.
systemd removed it in commit 284d1cd0a1 too.

(cherry picked from commit a5d7cf5c4b)
2018-10-29 21:18:36 +01:00
Thomas Haller
087fb85969 wifi: fix leaking fake AP in NMDeviceWifi's act_stage1_prepare()
Fixes: 96f40dcdcd
(cherry picked from commit ef61d7909f)
(cherry picked from commit d08530ac4b)
(cherry picked from commit 6c4c12c796)
(cherry picked from commit 4a345b2e78)
(cherry picked from commit ae112d0070)
(cherry picked from commit 0a95b1a593)
2018-09-13 16:31:21 +02:00
Thomas Haller
b4b6089218 dhcp: fix leak in dhclient's dhclient_start()
Fixes: 5d6d5cd136
(cherry picked from commit c87faf07a1)
(cherry picked from commit 8f9240de96)
(cherry picked from commit c740726b57)
(cherry picked from commit 0a69572cae)
(cherry picked from commit 13aaad7c5b)
(cherry picked from commit d95e1304e7)
2018-09-10 14:40:28 +02:00
Benjamin Berg
55d749f940 Add calls to g_simple_async_result_set_check_cancellable
If an operation is cancelled through the GCancellable, then the idiom is
that the operation is always cancelled, even if it has finished
successfully. To ensure this is the case, add calls to
g_simple_async_result_set_check_cancellable everywhere.

Without this, e.g. gnome-control-center will crash when switching away
from the power panel quickly, as the NMClient creation finishes
asynchronously and g-c-c assume that G_IO_ERROR_CANCELLED is returned to
ensure it doesn't access the now invalid user_data parameter.

https://bugzilla.gnome.org/show_bug.cgi?id=794088
(cherry picked from commit 26c215e22d)
(cherry picked from commit e1b99d9201)
(cherry picked from commit 2e62853509)
(cherry picked from commit 4bcb4c4ef2)
2018-03-08 15:42:55 +01:00
Beniamino Galvani
202ee6d1a3 bus-manager: don't leak connections
The bus manager takes extra references to the GDBusConnection every
time g_dbus_object_manager_server_get_connection() its called,
preventing its disposal once the connection is closed. This causes a
leak for each DHCP event.

https://bugzilla.redhat.com/show_bug.cgi?id=1461643
(cherry picked from commit 5b81d40338)
(cherry picked from commit bb4b6be912)
(cherry picked from commit 44cbd3b036)
2017-10-15 10:29:19 +02:00
Beniamino Galvani
6facaef7ac release: bump version to 1.4.7 (development) 2017-07-17 14:26:56 +02:00
Beniamino Galvani
2e32ec587b release: bump version to 1.4.6 2017-07-17 13:44:50 +02:00
Beniamino Galvani
29cbe0d7fb release: update NEWS 2017-07-17 11:02:22 +02:00
Thomas Haller
fb9c302af7 clients: fix appending integer to result in nmc_property_set_bytes()
(cherry picked from commit d76c190dc7)
(cherry picked from commit 06d3c95e4f)
2017-05-23 16:39:44 +02:00
Beniamino Galvani
e4750efb23 clients: fix setter for 802-1x.password-raw
The property is a GBytes, not a GByteArray.

https://bugzilla.gnome.org/show_bug.cgi?id=782836
(cherry picked from commit 30393ee236)
(cherry picked from commit cc6c9468fc)
2017-05-23 16:34:37 +02:00
Thomas Haller
faba5b7078 policy: fix memleak in lookup_callback() and cancelling
When the operation is cancelled, we must not touch user_data. Note that
NM_POLICY_GET_PRIVATE() theoretically doesn't dereference the pointer
(does it?) but doing pointer arithmetic on a dangling pointer is a very
ugly thing to do.

And of course, the memleak.

Fixes: 5c716c8af8
Fixes: a2cdf63204
(cherry picked from commit 3215508293)
(cherry picked from commit f1469558c0)
2017-05-02 18:30:09 +02:00
Thomas Haller
bd21d1054a device: fix restricting Generic connection by interface-name
NMDeviceGeneric:check_connection_compatible() doesn't check for a
matching interface name. It relies on the parent implementation to
do that.

The parent implementation calls nm_manager_get_connection_iface().
That fails for NM_SETTING_GENERIC_SETTING_NAME, because that one has
no factory. Maybe this imbalance of having no factory for the Generic device
is wrong, but usually factories only match a distinct set of device
types, while the generic factory would handle them all (as last resort).

Without this, activating a generic connection might activate the
wrong interface.

(cherry picked from commit 3876b10a47)
(cherry picked from commit 753a2cc4d9)
(cherry picked from commit bd72919b47)
2017-04-26 21:14:13 +02:00
Beniamino Galvani
1c06d66a05 vlan: use parent interface mtu as default
VLANs already inherit the MTU from parent device when manually
activated. At boot, since the vlan interface is created before
activating the parent, the MTU is left to the default value.

Fix this by inheriting the MTU from parent when activating the
VLAN. Note that this change is effective only when the connection has
an actual IPv4 configuration; for all other cases users should
explicitly set the desired MTU value in the 'ethernet.mtu' property.

See master commit 7dde8d8106 ("vlan: use parent interface mtu as default")

https://bugzilla.redhat.com/show_bug.cgi?id=1439166
2017-04-24 18:38:58 +02:00
Thomas Haller
c625a3c7e2 libnm: diconnect signal handler for NMObject from GDBusProxy
Similar to commit 0429753dab from
nm-1-6 branch.

Related: https://bugzilla.gnome.org/show_bug.cgi?id=778615
https://bugzilla.redhat.com/show_bug.cgi?id=1436603
2017-04-24 14:47:56 +02:00
Lubomir Rintel
2f92d8cee1 sparse: avoid clash with __bitwise and __force from 4.10 linux/types.h
It also used __bitwise and __force. It seems easier to rename
our versions since they are local to this one single header.

Also, undefine them afteerwards, so that we don't pollute the
preprocessor macro namespace.

https://github.com/systemd/systemd/pull/5061
(cherry picked from commit 13b2ac2214)
2017-04-24 09:56:44 +02:00
Thomas Haller
304615f301 build: fix type on Makefile.am
Fixes: 3cc00dd550
(cherry picked from commit e824dd34f0)
(cherry picked from commit 2ebc390734)
2017-04-20 15:54:57 +02:00
Thomas Haller
e391fe98a9 ifcfg: also read DEFROUTE and GATEWAY from alias files
Also accept DEFROUTE and GATEWAY when they are defined in
alias files -- provided, that they are not yet defined
in the main ifcfg file.

(cherry picked from commit 3cc00dd550)
(cherry picked from commit 4c595997f2)
2017-04-20 15:48:22 +02:00
Thomas Haller
faf1ffc5cc ifcfg: ensure ipv4.method is not "disabled" when reading IP addresses from alias files
When the main ifcfg file contains no IP addresses, the method
will be "disabled". Later, when reading IP addresses for the
aliases, we must ensure that the method is manual.

Otherwise, validation fails with

  ip.addresses: this property is not allowed for method=disabled

(cherry picked from commit a8f0d88596)
(cherry picked from commit be1daa4580)
2017-04-20 15:45:27 +02:00
Beniamino Galvani
369b323b2d device,default-route-manager: merge branch 'th/default-route-resync'
(cherry picked from commit 6197c27f24)
2017-04-03 13:33:11 +02:00
Thomas Haller
6cc6c42993 default-route-manager: decryptify logging line for default-route-manager
The default route manager logs for each entry relevant information,
in a compact but cryptic way:

  default-route: entry[0/dev:0x5633d5528560:enp0s25:1:+sync]: record:add    0.0.0.0/0 via 192.168.0.1 dev 2 metric 100 mss 0 rt-src user (100)

The flag whether a route is configured or not, was only expressed
via 0|1. Change that to log instead:

  default-route: entry[0/dev:0x5633d5528560:enp0s25:+has:+sync]: record:add    0.0.0.0/0 via 192.168.0.1 dev 2 metric 100 mss 0 rt-src user (100)

(cherry picked from commit 82bfb6c46d)
2017-04-03 13:30:50 +02:00
Thomas Haller
9e81a33949 default-route-manager: alyways force a sync of the default route
Whenever we call update for a non-assumed, synced route, we must
force a resync with the platform. Even if according to our internal
book-keeping the route is already configured, the route may have
been removed externally. So we cannot assume that everything is
still up-to-date.

https://bugzilla.redhat.com/show_bug.cgi?id=1431268
(cherry picked from commit c3c251ea12)
2017-04-03 13:30:49 +02:00
Thomas Haller
cd7c79e83f default-route-manager: simplify determining synced flag in _ipx_update_default_route()
No change in behavior at all. The same logic applies, but this should
be simpler to understand.

(cherry picked from commit 0b3ba99409)
2017-04-03 13:28:37 +02:00
Lubomir Rintel
1eebc0ca01 settings-connection: fix Save()
Avoid using new_settings when they are none. Also, don't shortcut when
the connection hasn't been changed -- let the settings plugin decide if
it needs to rewrite the connection.

(cherry picked from commit b47340fd3f)
(cherry picked from commit 58c9a41959)
2017-03-24 10:42:37 +01:00
Iain Lane
dec4423a9d nm-manager: Use g_dbus_message_new_method_error_literal()
GLib 2.52 added a G_GNUC_PRINTF attribute to
g_dbus_message_new_method_error(). This triggered warning in
NetworkManager when built with -Wformat, which is an error when built
with -Werror=format-security. It seems that gcc isn't smart enough to
see that (foo = "bar") should be treated as a literal.

Fortunately there is a g_dbus_message_new_method_error_literal()
function which does not take printf-style arguments, and we don't need
them, so we can use that.

This patch was originally by Rico Tzschichholz <ricotz@ubuntu.com>, and
was submitted to Launchpad at

https://bugs.launchpad.net/ubuntu/+source/network-manager/+bug/1650972
https://bugzilla.gnome.org/show_bug.cgi?id=780444
(cherry picked from commit 6a77258f4e)
(cherry picked from commit 1715ec53c1)
2017-03-23 13:14:46 +01:00
Dan Williams
fcba6a2881 ppp: only request IPV6CP when IPv6 is enabled in the connection
NM always asks pppd to run IPV6CP which will complete if the modem supports
IPv6.  If the user doesn't want IPv6 then NM just ignores the result.  But
if the host has disabled IPv6, then pppd will fail to complete the connection
because pppd tries to assign the Link-Local address to the pppX interface,
and if IPv6 is disabled that fails and terminates the PPP session.

So only request IPV6CP when the user wants IPv6 on the connection; if they
have disabled IPv6 on their host then they can simply set ipv6.method=ignore.

https://mail.gnome.org/archives/networkmanager-list/2017-March/msg00047.html
(cherry picked from commit 8d4570d28d)
2017-03-22 08:26:28 -05:00
Thomas Haller
aab4e2fdaa po: make update-po 2017-03-22 11:16:41 +01:00
Thomas Haller
51652d9360 zanata: update project-version 2017-03-21 15:25:31 +01:00
Beniamino Galvani
f0eb192d8c manager: ensure proper disposal of unrealized devices
When remove_device() is called on an already unrealized device, we
should release it from master if necessary and clear its IP
configurations to avoid leaks.

https://bugzilla.redhat.com/show_bug.cgi?id=1433303
(cherry picked from commit 2e0c3d1dac)
(cherry picked from commit 427a3e5cff)
2017-03-21 13:35:43 +01:00
Thomas Haller
42eb57c0c1 libnm: fix memleak of GUdevDevice in get_bus_name()
Fixes: f7b1b28202
(cherry picked from commit c033330c41)
(cherry picked from commit 6311bf6666)
2017-03-20 11:35:15 +01:00
Lubomir Rintel
b2059059fd nm-object: initialize the object buffer to zero
(cherry picked from commit df46c59775)
2017-03-16 17:56:41 +01:00
Beniamino Galvani
a75d6b8fbb device: fail DHCPv6 if a link-local address is not present
Instead of throwing an assertion, fail DHCPv6 when a IPv6 link-local
address is not configured on the device. There are different reasons
why the assertion may fail: for example the address was removed
externally; or the device is gone (and thus the platform already
received the notification of addresses removal) but the device is still
connecting because its disposal happens in an idle callback.

None of these deserves an assertion, which should only be for
programming errors.

https://bugzilla.redhat.com/show_bug.cgi?id=1432251
(cherry picked from commit 4987ec408a)
(cherry picked from commit 238fc87298)
2017-03-15 16:41:20 +01:00
Thomas Haller
135fa26dab libnm: chain up NMRemoteConnection::constructed() function
Fixes: 0fdd71fe6e
(cherry picked from commit 9ed0e3705e)
(cherry picked from commit 8a857c4475)
2017-03-09 15:22:55 +01:00
Thomas Haller
5843538252 platform: filter out invisible links for cache lookup by name
Fixes: ad1d74d142
(cherry picked from commit f0e295d3d7)
(cherry picked from commit 5cd90717ad)
2017-03-09 15:22:54 +01:00
Lubomir Rintel
f72c54a2cc tui: generate names for bonds, teams and bridges
This makes it more likely that the user will end up with a master
connection that has connection.interface-name property. This makes it
possible for ifcfg plugin to specify the master in the for of device
name (as opposed to UUID) for compatibility with the legacy network
tooling.

This is equivalent to what nmcli does.

https://bugzilla.redhat.com/show_bug.cgi?id=1369091
(cherry picked from commit ff46158d9e)
2017-02-20 16:09:13 +01:00
Beniamino Galvani
6913311d47 platform: fix detection of primary/secondary addresses
ip4_addr_subnets_is_secondary() should fill the list of addresses in
the same subnet also when returning FALSE, because
nm_platform_ip4_address_sync() uses it.

Fixes: 2f68a50041
(cherry picked from commit a347962831)
2017-02-08 15:14:12 +01:00
Beniamino Galvani
8b36e99ffe platform: fix the order of addition of primary and secondary IPv4 addresses
nm_platform_ip4_address_sync() tries to apply the new configuration
with the minimum effort and doesn't delete addresses if they are
already present on the interface. This can break the ordering, as an
existing address would be promoted by kernel to primary, even if it
was last in our configuration.

Add some logic to ensure the correct order of addresses is always
enforced. This fixes situations like:

 # nmcli connection add type ethernet ifname eth0 con-name t \
                        ipv4.method manual \
                        ipv4.addresses "1.1.1.1/24,1.1.1.2/24,1.1.1.5/24"
 # nmcli connection up t

  => addresses are applied in the right order:
     inet 1.1.1.1/24 brd 1.1.1.255 scope global eth0
     inet 1.1.1.2/24 brd 1.1.1.255 scope global secondary eth0
     inet 1.1.1.5/24 brd 1.1.1.255 scope global secondary eth0

 # nmcli connection mod t ipv4.addresses "1.1.1.5/24,1.1.1.2/24,1.1.1.1/24"
 # nmcli device reapply eth0

  => order is wrong:
     inet 1.1.1.2/24 brd 1.1.1.255 scope global eth0
     inet 1.1.1.5/24 brd 1.1.1.255 scope global secondary eth0
     inet 1.1.1.1/24 brd 1.1.1.255 scope global secondary eth0

Co-Authored-By: Thomas Haller <thaller@redhat.com>
(cherry picked from commit 2f68a50041)
2017-02-08 10:12:34 +01:00
Thomas Haller
e7ce496166 device/wifi: drop messing with wpa-supplicant's support for MAC address randomization
We no longer use wpa_supplicant for MAC address randomization. Instead, NetworkManager
handles it on it's own. It is actually important that supplicant does not interfere
when setting the MAC address of the device.

The code was only in effect when supplicant has a PreassocMacAddr property.
As this is a recent feature, the left-over code wasn't noticed until now.

https://mail.gnome.org/archives/networkmanager-list/2017-February/msg00003.html

Fixes: 767abfa690
(cherry picked from commit 0cb85f161e)
(cherry picked from commit 7ada0e0bc3)
2017-02-07 14:39:40 +01:00
Beniamino Galvani
3ddc18bb55 bond: fix crash in update_connection()
The value read from sysfs can be NULL.

Fixes: 2324410a75
(cherry picked from commit 0683ad5db2)
2017-02-07 11:16:24 +01:00
Francesco Giudici
86490fbb1d libnm-core: remove INFERRABLE flag from dhcp-hostname property
When assuming a dhcp connection don't consider the DHCP "Host Name"
Option (12) passed in the DHCP request for the match of the available
connections.

https://bugzilla.redhat.com/show_bug.cgi?id=1393997
(cherry picked from commit 0ce7da1e22)
2017-02-06 17:56:40 +01:00
Thomas Haller
2caf3b1f04 systemd: fix memleak in dhcp6_option_parse_domainname
https://github.com/systemd/systemd/pull/5114
419eaa8f8d
(cherry picked from commit c2d0b9eec0)
(cherry picked from commit 3a4c9676da)
2017-02-06 14:10:14 +01:00
Thomas Haller
d8cc0609f1 systemd: fix memleak in dhcp6_lease_set_domains
https://github.com/systemd/systemd/pull/5113
0b75a95ace
(cherry picked from commit 7cd2dfabec)
(cherry picked from commit d1fb96207e)
2017-02-06 14:10:12 +01:00
Thomas Haller
fa142d856c build: add missing GLIB_CFLAGS for compiling adsl device plugin
(cherry picked from commit cd267cceed)
(cherry picked from commit 38cef9de7a)
2017-01-29 12:27:58 +01:00
Thomas Haller
44ab1914a4 libnm-core: clear wifi.mac-address-randomization when unsetting wifi.cloned-mac-address
When a client clears wifi.cloned-mac-address, he clearly also want
to clear the deprected wifi.mac-address-randomization property.

Do that automatically in libnm.

https://mail.gnome.org/archives/networkmanager-list/2017-January/msg00060.html
(cherry picked from commit 7f63c875f9)
(cherry picked from commit 157b6d0ec4)
2017-01-28 17:19:55 +01:00
Thomas Haller
cb18faf2df ifcfg-rh: fix interpreting missing MAC_ADDRESS_RANDOMIZATION as permanent address
With commit 4f6c91d696, we aimed to
enable mac-address-randomization by default for Wi-Fi. That however
is not possible by default because it breaks various scenarios.
Also, later wifi.mac-address-randomization was deprecated in favor
of wifi.cloned-mac-address setting.

Both wifi.mac-address-randomization and wifi.cloned-mac-address support
global default values, so it is wrong to read a missing
MAC_ADDRESS_RANDOMIZATION setting as "NEVER" -- which due to
normalization also results in cloned-mac-address=permanent.

See also commit 46d53e1101 which does
something similar for keyfile.

This bug also prevents a user from clearing the cloned-mac-address:

  $ nmcli connection show "$CONN"
  ...
  802-11-wireless.cloned-mac-address:        permanent
  802-11-wireless.mac-address-randomization: never
  ...
  $ nmcli connection modify "$CONN: wifi.cloned-mac-address ''
  # ^ takes no effect

As workaround, you also need to clear mac-address-randomization:

  $ nmcli connection modify "$CONN: wifi.cloned-mac-address '' \
          wifi.mac-address-randomization default

https://mail.gnome.org/archives/networkmanager-list/2017-January/msg00060.html
(cherry picked from commit 27cba47957)
(cherry picked from commit 491ccd9d64)
2017-01-28 16:08:41 +01:00