Commit graph

12441 commits

Author SHA1 Message Date
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
Lubomir Rintel
317b6cb880 tests: fix 32-bit build
Fixes: 874f455d6d
(cherry picked from commit f71f9d5fcf)
2015-09-08 13:13:37 +02:00
Lubomir Rintel
12af09b779 test: fix duplicate test names
New glib complains.

(cherry picked from commit 874f455d6d)
2015-09-08 13:13:36 +02:00
Lubomir Rintel
e10a8f1f37 device: don't reset NM_UNMANAGED_DEFAULT when platform doesn't override this
This would cause the ip_vti0 generic device (that appears upon insertion of
ip_vti module during libreswan ipsec stack init) to go managed and brought UP.
Without addresses assigned the device would cause all the VPN traffic to
disappear in the oblivion.

(cherry picked from commit 1c46ddf196)
2015-09-08 12:33:29 +02:00
Lubomir Rintel
15e4ee69df vpn-connection: fix unsetting the gateway
Addresses the clash between the two commits which would cause the parent device
gateway to be overwritten with 0.0.0.0 upon route-based VPN activation:

Fixes: 063677101a
Fixes: 1465c1d326
(cherry picked from commit da2ae8ce4e)
2015-09-08 12:33:28 +02:00
Thomas Haller
f768f09a86 core/test: extend timeout for kill-process utils test
On slow virtual machine, these tests could fail because the
timeout was too low. As in a successful run the timeouts should
not be reached anyway, just extend them.

(cherry picked from commit bf6187e030)
2015-09-04 20:55:04 +02:00
Thomas Haller
765ba17ab5 config: fix wrong signature of class-method config_changed() for signal
Actually, just drop it. It's unused anyway.

(cherry picked from commit 39de56844e)
2015-09-04 16:36:54 +02:00
Beniamino Galvani
5ec73e70bb cli: describe usage of the 'connection.metered' property
(cherry picked from commit 04e29df47d)
2015-09-04 11:00:10 +02:00
Jiří Klimeš
7f0269673a device: give the default wired profiles the lowest autoconnect-priority
Later when other connections are created, they will be preferred over the
default one.

https://bugzilla.redhat.com/show_bug.cgi?id=1075148#c15

(cherry picked from commit 54019a403a)
2015-09-04 10:01:33 +02:00
Jiří Klimeš
7cfd6fc641 libnm-core: fix a crash in priority_strv_to_maplist()
strv can be NULL.

Reproducer:
$ nmcli con mod my-vlan vlan.ingress 1:5

(cherry picked from commit 71c8c2e587)
2015-09-01 16:13:01 +02:00
Michael Biebl
7ac3b75f42 Split out the bits which determine ID_NET_DRIVER or DRIVERS into separate udev rules file
Those are not required with systemd-udevd v210 or newer. This way
distros which have a new enough version of udev can skip installing
84-nm-drivers.rules. While at it, don't use absolute paths for sed and
ethtool.

(cherry picked from commit 8b67de901a0ae1390479d32ed52ace719ebb3734)
2015-08-31 22:40:24 +02:00
Jiří Klimeš
c908cf90fd introspection: add AUDIT domain to available list in SetLogging() description
Fixes: 41e7051165

(cherry picked from commit 988fa1ba8c)
2015-08-31 09:08:55 +02:00
Jiří Klimeš
71104eefdc doc: fix the names of [in|e]gress-priority-map properties in ifcfg-rh man page
(cherry picked from commit 5e3582c6b1)
2015-08-31 09:08:32 +02:00