Commit graph

12429 commits

Author SHA1 Message Date
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
Ulrich Ölmann
8a22a98157 config: bugfix: parse commandline options into correct object
Config related commandline options should be parsed into a function argument but
were instead parsed into an object with local scope. As a result none of them
had any impact.

Signed-off-by: Ulrich Ölmann <u.oelmann@pengutronix.de>

Fixes: b4ad7434a8

https://mail.gnome.org/archives/networkmanager-list/2015-August/msg00033.html
2015-08-28 08:24:02 +02:00
Thomas Haller
26e6b2c189 platform: assert to successfully dlopen libnl3
(cherry picked from commit a922d5e587)
2015-08-27 20:29:11 +02:00
Lubomir Rintel
0ae203bf9d release: bump version to 1.0.7 (development) 2015-08-27 19:25:11 +02:00
Lubomir Rintel
59deb78f85 release: update NEWS 2015-08-27 18:21:26 +02:00
Lubomir Rintel
8ce6c3c0ce release: bump version to 1.0.6 2015-08-27 18:21:26 +02:00
Lubomir Rintel
d3a91d1ca0 platform: remove bogus asserts
You can't really compare a symbol resolved by ld.so to dlsym()'d one. The
former one is likely just an address of trampoline in PLT.
2015-08-27 18:21:26 +02:00
Lubomir Rintel
c872c6656c dbus: allow talking to more plugins in DBus policy
These two has been seen in the wild.
Libreswan is the RHEL's openswan fork.

(cherry picked from commit 82031add33)
2015-08-27 15:12:50 +02:00
Jiří Klimeš
0dee0d415f merge: allow overriding MTU for team devices (rh #1255927)
https://bugzilla.redhat.com/show_bug.cgi?id=1255927

(cherry picked from commit 4207671ecd)
2015-08-27 10:36:22 +02:00
Jiří Klimeš
33ee3b2a49 ifcfg-rh: save wired properties also for bond/team (rh #1255927)
Without that MTU is not saved to ifcfg file for bond and team and thus it is
lost over NetworkManager restart.

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

(cherry picked from commit feb5b5538a)
2015-08-27 10:34:28 +02:00
Jiří Klimeš
65783f7a92 team: allow overriding the MTU for team device (rh #1255927)
Set the MTU if 802-3-ethernet.mtu is present and non-zero. The ifcfg-rh writer
sets it if there's a MTU key.

The same change as for bond in commit a169a79a7d.

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

(cherry picked from commit 7d3a4178a5)
2015-08-27 10:33:47 +02:00
Beniamino Galvani
78fc92abe8 device: accept multiple addresses in a DHCPv6 lease
When the DHCPv6 lease received from the server contains multiple
addresses, dhclient generates a new BOUND event for each of
them. Instead of overwriting the previous IP6 configuration for each
BOUND event, we should try to detect if the new configuration belongs
to the same lease and merge its addresses with the existing one in
such case.

This allows NetworkManager to configure multiple addresses on an
interface via DHCPv6.

https://bugzilla.gnome.org/show_bug.cgi?id=681764
https://bugzilla.redhat.com/show_bug.cgi?id=1244293
(cherry picked from commit 1d6e8e8da7)
2015-08-26 15:18:34 +02:00
Beniamino Galvani
eb1ccf90b8 device: fix clearing of dhcp6_restart_id in dhcp6_cleanup()
Fixes: abc96ecdfd
(cherry picked from commit 905220b337)
2015-08-26 11:51:19 +02:00