Commit graph

12453 commits

Author SHA1 Message Date
Jiří Klimeš
b1dffe1391 libnm-core/libnm-util: fix an erroneous error message
ipv6.dns: 'this property is not allowed for '%s=%s'' not allowed for method=ignore

(cherry picked from commit 12e6cf1f20)
2015-09-25 16:15:38 +02:00
Jiří Klimeš
1b253ee722 cli: allow 'ipv6' and 'ppp' settings for GSM and CDMA connections (rh #1265993)
Otherwise the settings cannot be changed.

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

(cherry picked from commit ecf0849355)
2015-09-25 16:15:29 +02:00
Thomas Haller
d0e367aeb7 libnm-util: don't include "nm-version.h" in "NetworkManager.h"
We want "NetworkManager.h" to have no dependancy on libnm and glib.

(cherry picked from commit 159e827a72)
2015-09-25 15:56:48 +02:00
Thomas Haller
ea8e3b88d1 libnm: don't include "nm-version.h" in "nm-dbus-interface.h"
We want "nm-dbus-interface.h" to have no dependancy on libnm and glib.
That way, it is usable for example in the QT examples without dragging
in dependencies to glib.

Also drop all the unneccessary include to "nm-dbus-interface.h", which
we already get by directly or indirectly including "nm-core-types.h".

(cherry picked from commit c0852964a8)
2015-09-25 15:51:36 +02:00
Jiří Klimeš
f9757b7d5b man: fix in nm-settings-ifcfg-rh description
(cherry picked from commit 66b7e45708)
2015-09-25 13:26:02 +02:00
Jiří Klimeš
a0ffb5ad19 modem-broadband: update modem's supported-ip-families (rh #1263959)
If SIM in a modem is locked, ModemManager can't initialize SupportedIpFamilies
and NetworkManager will set the property to 0. ModemManager then updates the
property after the modem is unlocked, but NetworkManager did not watch changes
to the property. And that resulted in a connection failure:
(ttyUSB1): Failed to connect 'O2 Internet': Connection requested IPv4 but IPv4 is unsuported by the modem.
(ttyUSB1): device state change: prepare -> failed (reason 'modem-init-failed') [40 120 28]

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

(cherry picked from commit eecb4c46cc)
2015-09-25 10:20:56 +02:00
Quentin Glidic
4971ce9a12 tools/check-exports.sh: use ${NM} when available
This way you can export NM to use a prefixed tool

https://bugzilla.gnome.org/show_bug.cgi?id=755540

Signed-off-by: Quentin Glidic <sardemff7+git@sardemff7.net>
(cherry picked from commit 2a4a222d95)
2015-09-24 16:33:12 +02:00
Thomas Haller
2eeadb977f systemd: merge branch 'th/systemd-dhcp-timer-rh1260727'
https://bugzilla.redhat.com/show_bug.cgi?id=1260727

(cherry picked from commit 1b7196ec51)
2015-09-24 11:00:05 +02:00
Thomas Haller
fe70a87f94 systemd: avoid potential crash due to uncanceled timers in client_receive_advertise()
Got a crash with unknown reason on nm-1-0 branch. It's unclear why,
but the reason could be that a lease in client_receive_advertise()
was cleared, but not its timers.

Backtrace from nm-1-0 branch (note that the systemd code where the crash
happend is different, but similar):

    #0  sd_event_source_unref (s=0xf5c007e8fb894853) at dhcp-manager/systemd-dhcp/nm-sd-adapt.c:53
    #1  0x0000555555682340 in client_timeout_t1 (s=<optimized out>, usec=<optimized out>, userdata=0x5555559f5240)
        at dhcp-manager/systemd-dhcp/src/libsystemd-network/sd-dhcp6-client.c:451
    #2  0x00005555556a078f in time_ready (source=0x5555559f3c20) at dhcp-manager/systemd-dhcp/nm-sd-adapt.c:146
    #3  0x00007ffff4a481b3 in g_timeout_dispatch () from /lib64/libglib-2.0.so.0
    #4  0x00007ffff4a4779a in g_main_context_dispatch () from /lib64/libglib-2.0.so.0
    #5  0x00007ffff4a47ae8 in g_main_context_iterate.isra.24 () from /lib64/libglib-2.0.so.0
    #6  0x00007ffff4a47dba in g_main_loop_run () from /lib64/libglib-2.0.so.0
    #7  0x0000555555597073 in main (argc=1, argv=0x7fffffffe2b8) at main.c:512

Equivalent upstream systemd patch:
  https://github.com/systemd/systemd/pull/1332
  f89087272b

https://bugzilla.redhat.com/show_bug.cgi?id=1260727
(cherry picked from commit 401a2eb834)
2015-09-24 10:57:41 +02:00
Thomas Haller
0e6a13bccc systemd/adapt: refactor sd_event_source to use a union for holding mutually exclusive fields
sd_event_source is either used for sd_event_add_io() or sd_event_add_time().
Depending on the use, different fields of the struct are relevant. Refactor
the struct to have a union.

This reduces the size of the struct, but more importantly, it makes it
clear which fields are used in which context.

(cherry picked from commit 2d2d742cf1)
2015-09-24 10:56:04 +02:00
Thomas Haller
11237a0a66 systemd/adapt: assert that a @source argument is passed to sd_event_add_time()
Systemd supports omitting the output source argument. In this case,
the created event source is floating and the reference count
is handled properly.

We have however no callers that make use of that functionality, so
instead of implementing floating references, assert that we don't
need it.

This isn't a change in behavior, because previously the could would just
SEGFAULT if a caller didn't want to take ownership of the created event.

(cherry picked from commit 02c51d4231)
2015-09-24 10:56:02 +02:00
Thomas Haller
55e46923c0 systemd/adapt: fix potential crash invoking sd_event_source callbacks
It is common that the callbacks unref the event source. Hence we must
ensure that the @source stays alive until the callback returns.

(cherry picked from commit 9901047ae3)
2015-09-24 10:56:01 +02:00
Thomas Haller
8c08014f47 systemd/adapt: use slice-allocator for struct sd_event_source
(cherry picked from commit fb0e87be39)
2015-09-24 10:56:00 +02:00
Thomas Haller
436ed50f4a systemd/adapt: refactor creation of struct sd_event_source
(cherry picked from commit 41917a52c0)
2015-09-24 10:55:53 +02:00
Thomas Haller
972865bc4e logging: coerce negative error values to positive errno
Especially systemd, which makes use of the error argument for logging, likes
to represent errors as negative numbers. We hence must invert a negative error
code to get the real errno.

(cherry picked from commit d6370d09e6)
2015-09-24 10:55:37 +02:00
Jiří Klimeš
e6160d3bc4 supplicant: adjust fragment_size according to MTU (bgo #755145)
NetworkManager set wpa_supplicant's fragment_size option to 1300. But if MTU
was lower, wpa_supplicant failed with "l2_packet_send - sendto: Message too
long" due to fragmentation of EAP-TLS or EAP-PEAP packets.

Actually, MTU has to be 14 bytes bigger than the "fragment_size" parameter.

Ideally, wpa_supplicant would take MTU in the account and adjust the
fragmentation limit accordingly. See discussion in
http://lists.shmoo.com/pipermail/hostap/2015-August/033546.html

https://bugzilla.gnome.org/show_bug.cgi?id=755145

(cherry picked from commit 94bbe7465f)
2015-09-23 13:01:25 +02:00
Jiří Klimeš
19bcc95d48 contrib/rpm: fix creating proper po/Makefile.in.in (rh #1265117)
Without that DATADIRNAME was not present in po/Makefile.in.in
and it resulted in /usr/\@DATADIRNAME\@/locale/cs/LC_MESSAGES/ path instead of
/usr/share/locale/cs/LC_MESSAGES/.

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

(cherry picked from commit 2318c0de92)
2015-09-22 13:05:37 +02:00
Jiří Klimeš
b010870d84 manager: cleanup NMRfkillManager in dispose()
Fixes: b15fb8641e

(cherry picked from commit 85d7dc1a0f)
2015-09-22 08:29:50 +02:00
Jiří Klimeš
117fd7ef51 manager: disconnect signal handlers on 'settings' in dispose() (rh #1264676)
Otherwise a crash can occur when shutting down.

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

(cherry picked from commit dd8c3ef3a0)
2015-09-22 08:29:50 +02:00
Jiří Klimeš
3e26774e06 merge: fix ADSL in nmcli and libnm-core/libnm-utils (rh #1264089)
- implements 'nmcli connection add type adsl'
- initializes adsl.protocol for 'nmcli con edit type adsl'
- fixes errors in adsl properties in libnm-core/libnm-util

(cherry picked from commit e9f9f4ecb9)
2015-09-21 15:50:45 +02:00
Jiří Klimeš
b590a31839 cli: allow creating ADSL connections with 'nmcli connection add' (rh #1264089)
https://bugzilla.redhat.com/show_bug.cgi?id=1264089

(cherry picked from commit 290c1626b9)
2015-09-21 15:49:38 +02:00
Jiří Klimeš
9bca3b7a37 cli: initialize adsl.protocol in editor when creating a new connection
The protocol is required and it is nice to have a valid initial value for
the property.

(cherry picked from commit 5502d8691a)
2015-09-21 15:49:20 +02:00
Jiří Klimeš
1f7be49519 libnm-core/libnm-util: fix an assertion in adsl setting
(process:7799): GLib-CRITICAL **: g_ascii_strdown: assertion 'str != NULL' failed

(cherry picked from commit 3d64d45d16)
2015-09-21 15:48:44 +02:00
Jiří Klimeš
890b27adc6 device: remove unused ip_iface
(cherry picked from commit 73d2bd53c5)
2015-09-21 09:19:13 +02:00
Jiří Klimeš
e8bf4bed02 wifi: remove unused variables
(cherry picked from commit 3b11b85753)
2015-09-21 09:18:19 +02:00
Thomas Haller
52923b6c73 platform: merge branch 'th/platform-permanent-hwaddr-rh1264024'
https://bugzilla.redhat.com/show_bug.cgi?id=1264024
Related: https://bugzilla.redhat.com/show_bug.cgi?id=1256430

(cherry picked from commit b6459ace2f)
2015-09-18 13:41:53 +02:00
Thomas Haller
0f18a2ed23 platform: don't accept 00:00:00:00:00:00 as valid permanent address
In nmp_utils_ethtool_get_permanent_address(), don' accept a permanent
address of all zeros.

https://bugzilla.redhat.com/show_bug.cgi?id=1264024
(cherry picked from commit 2733aacd64)
2015-09-18 13:34:03 +02:00
Thomas Haller
6839a5f9e3 platform: stack-allocate request data for nmp_utils_ethtool_get_permanent_address()
(cherry picked from commit 2e66aea123)
2015-09-18 13:33:59 +02:00
Thomas Haller
e8f5005d3d platform: merge branch 'th/platform-refresh-link-bgo754996'
https://bugzilla.gnome.org/show_bug.cgi?id=754996

(cherry picked from commit 54afd0400b)
2015-09-18 11:31:37 +02:00
Thomas Haller
91c00072f2 platform: cancel delayed action REFRESH_LINK when receiving an update
When we receive an update for a link, cancel a scheduled
REFRESH_LINK delayed-action for that ifindex. At the point when we
scheduled refrehing the link, we only cared about receiving a
notification that was newer then the current state.

We scheduled requesting this new notification to resync the cache.
It is not necessary to actually request a new update, any update we
receive *after* requesting a new update will suffice.

This potentially saves extra round-trips re-requesting the link.

(cherry picked from commit f4f4e1cf09)
2015-09-18 11:30:53 +02:00
Thomas Haller
e79caf9b4a platform: refresh links when parent gets removed
When moving a link to another netns, it gets removed from
NMPlatform's view.

Currently kernel does not sent a notification to inform about
that change (see related bug rh#1262908).

Ensure that we reload all linked interfaces which now might
have an invisible parent.

(cherry picked from commit 2cd6aaa918)
2015-09-18 11:30:52 +02:00
Thomas Haller
bdbc3bbb7b platform: fix handling refresh-link delayed actions
Due to a bug, we would only handle one REFRESH_LINK delayed action
and ignore the ones queued afterwards.

Fixes: 051cf8bbde
(cherry picked from commit eee240ffe8)
2015-09-18 11:30:51 +02:00
Jiří Klimeš
3543cbdfc2 coverity: calm coverity for clock_gettime() return value check
Defect type: CHECKED_RETURN
3. NetworkManager-1.0.6/src/platform/nm-linux-platform.c:1145: check_return: Calling "clock_gettime" without checking return value (as is done elsewhere 6 out of 7 times).

(cherry picked from commit 0f694f1a9a)
2015-09-18 08:46:27 +02:00
Thomas Haller
f05b42e6df dhcp/systemd: fix leaking leases after dhcp_lease_load()
Fixes: d2dd3b2c90
(cherry picked from commit 9e52613612)
2015-09-17 18:15:50 +02:00
Jiří Klimeš
0aa99069ed ifcfg-rh: ignore GATEWAY from network file for DHCP connections (rh #1262972)
The GATEWAY from /etc/sysconfig/network file is used as a default value when
no GATEWAY is in ifcfg file. However, we have to ignore that GATEWAY for
connections without static addresses. Otherwise such connections would be
invalid and would disappear after restart/reaload.

Some notes:
Putting GATEWAY into /etc/sysconfig/network is not recommended, because it
inherently belongs to the ifcfg file as it is a per-interface property.
The recommended practice is to specify GATEWAY in individual ifcfg files and
define DEFROUTE=no if the interface should not get the default route.
But we continue to read GATEWAY from /etc/sysconfig/network for compatibility
reasons.
See also
https://bugzilla.redhat.com/show_bug.cgi?id=896198#c25
https://bugzilla.redhat.com/show_bug.cgi?id=896198#c27

Fixes: f17699f4e3

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

(cherry picked from commit ed85fcc711)
2015-09-17 15:09:51 +02:00
Jiří Klimeš
827b49f089 ifcfg-rh: (trivial) remove unused network_file parameter
(cherry picked from commit 64e3873faf)
2015-09-17 15:09:01 +02:00
Thomas Haller
1bc3e1d513 systemd: fix systemd logging statements to show "file:line (func)" properly
Previously, we would stringify the arguments, resulting in logging
lines like
    "__FILE__:__LINE__(__PRETTY_FUNCTION__): assert return: ..."
2015-09-16 18:09:25 +02:00
Beniamino Galvani
80d4fbf4ac device: retry creation of default connection after link is initialized
When a new link is detected, NM tries to generate a default "Wired
connection" in nm_settings_device_added(), but if the link has not
been initialized by udev yet the function returns early because
priv->unmanaged_flags = UNMANAGED_PLATFORM_INIT.

To be sure that a default connection is created is such situation, we
need to call again nm_settings_device_added() after link
initialization.

https://bugzilla.redhat.com/show_bug.cgi?id=1254089
(cherry picked from commit b3b0b46250)
2015-09-16 13:14:46 +02:00
Jiří Klimeš
b46ed87919 nmcli: allow adding 'generic' connections via nmcli connection add
'nmcli connection edit' already allows adding and editing generic connections
(added by 2a2af5825a).

(cherry picked from commit 0ff9b75387)
2015-09-15 14:48:28 +02:00
Jiří Klimeš
aac87ecfd7 merge: improve handling of wake-on-lan property (rh #1260584)
https://bugzilla.redhat.com/show_bug.cgi?id=1260584
2015-09-15 12:19:10 +02:00
Jiří Klimeš
c0c1cb1dc8 nmcli: wake-on-lan property set/get fixes
- accept a numeric value (decimal or hex (0x prefix))
- display a numeric value of the property in addition to the strings
- add/accept spaces between string names

to behave similar to other flags' properties.

(cherry picked from commit 4485b4ec2f)
2015-09-15 12:18:18 +02:00
Jiří Klimeš
65f6bb0b7b nmcli: allow "none" value for ethernet.wake-on-lan property (rh #1260584)
Aliases "disable" and "disabled" are accepted too.

nmcli> set 802-3-ethernet.wake-on-lan none

It was possible to remove flags by setting a string containing just white
spaces, but it was user unfriendly and non-intuitive.

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

(cherry picked from commit f88ce92b25)
2015-09-15 12:17:26 +02:00
Thomas Haller
1ec0b4e7e8 iface-helper: enabled dhcp4/slaac according to IP method
If at the moment when spawning nm-iface-helper dhcp4/slaac
did not yet complete, we would not enable it.

That is wrong. If the connection indicates to use dhcp4/slaac,
it should be used by nm-iface-helper without considering the
current state on the device.

https://bugzilla.redhat.com/show_bug.cgi?id=1260243
(cherry picked from commit b0815813fa)
2015-09-13 15:51:49 +02:00
Piotr Drąg
8192ef04dc po: update Polish (pl) translation (bgo #754798)
https://bugzilla.gnome.org/show_bug.cgi?id=754798
(cherry picked from commit 12746da039)
2015-09-10 11:26:06 +02:00
Lubomir Rintel
2b9f0db807 utils: match a cloned mac address with a connection that does not specify it
We do the same for the original MAC address.

A device enslaved to a bond it inherits the bond's MAC address. When
NetworkManager tries to assume a connection the generated cloned-mac property
causes a mismatch with the connection that originally brought up the device,
causing the generated connection to be used instead:

  NetworkManager[14190]: <debug> [1424355817.112154] [NetworkManagerUtils.c:1641]
         nm_utils_match_connection(): Connection 'eth2' differs from candidate
         'bond-slave-eth2' in 802-3-ethernet.cloned-mac-address

https://bugzilla.gnome.org/show_bug.cgi?id=744812
https://bugzilla.redhat.com/show_bug.cgi?id=1256430
(cherry picked from commit cd2cef9cab)
2015-09-09 18:40:22 +02:00
Thomas Haller
8de6ee4eba core: fix handling ignore-auto-dns for IPv6 nameservers
https://bugzilla.redhat.com/show_bug.cgi?id=1261428

Fixes: f7a8962dd4
(cherry picked from commit e0fe47b74e)
2015-09-09 13:03:26 +02:00
Thomas Haller
d7970c58eb platform/test: add test for invoking platform signals
There seems to be an issue with glib/ffi that causes failures
to pass enum-typed arguments to signals (related bug rh#1260577).

Add a test for platform signals which, beside NM_CONFIG_SIGNAL_CONFIG_CHANGED,
is the only place where we use enum-typed arguments for signals.

Strangely, this test doesn't cause the failure, so it's unclear why
the workaround was necessary for "config-changed" signal (commit
e7d66f1df6).

(cherry picked from commit 52cd5ee612)
2015-09-09 12:47:07 +02:00
Thomas Haller
9aecabe29f config: workaround invocation of "config-changed" signal
There seems to be a bug in glib/ffi that hits on s390x/ppc64 architecture.
It causes @changes in nm-dns-manager.c:config_changed_cb() to be NONE,
although it is clearly set (see the related bug rh #1260577 for glib).

Workaround this, by making the argument type a plain guint.

Note that the ill behavior is caught by test_config_signal() in
"src/tests/config/test-config.c".

Related: https://bugzilla.redhat.com/show_bug.cgi?id=1062301
(cherry picked from commit e7d66f1df6)
2015-09-09 12:06:59 +02:00
Thomas Haller
ce7687e499 config/test: add a test for nm_config_reload() with different signals
(cherry picked from commit e6c64af8be)
2015-09-09 12:06:59 +02:00
Beniamino Galvani
2b9db2bf1b device: retry DHCP after timeout/expiration for assumed connections
If DHCP fails for an assumed connection, NetworkManager would
transition the device to the FAILED and then to the ACTIVATED state
(because it is assumed); hence if the DHCP server goes temporarily
down the device will go into a permanent state without IP
configuration.

Fix this and try DHCP again after some time when the connection
is an assumed one.

https://bugzilla.redhat.com/show_bug.cgi?id=1246496
2015-09-08 13:27:48 +02:00