Commit Graph

18706 Commits

Author SHA1 Message Date
Thomas Haller
286f21db1c man: fix example for device section in NetworkManager.conf's manual
We currently don't support marking a device a managed/unmanaged via
the [device] section. Eventually, I think we should, because the
existing "keyfile.unmanaged-devices" looks keyfile specific (which
it isn't). But more importantly, "keyfile.unmanaged-devices" sets the
unmanaged flag NM_UNMANAGED_USER_SETTINGS, which cannot be overruled
via D-Bus (see commit c210134bd5).
A device.managed flag would make sense for a more sensible way to
express configuration in NetworkManager.conf, which still can be
overwritten via D-Bus.

Anyway, it's not yet implemented. Fix the example.
2017-09-28 14:40:17 +02:00
Beniamino Galvani
c9edd222c5 core: merge branch 'bg/parent-uuid'
https://mail.gnome.org/archives/networkmanager-list/2017-September/msg00032.html
2017-09-28 13:27:28 +02:00
Beniamino Galvani
6a5363bc8b device: match all UUIDs when no connection is active
nm_device_match_parent() is called to check whether a device is
compatible with a given parent (UUID or interface). Accept any UUID If
there is no connection active on the device.

Without this, when there is a VLAN/MACVLAN connection with a parent
UUID the manager would create the device in
system_create_virtual_device(), realize it and then at the next call
of system_create_virtual_device() it would notice that the connection
is not compatible with the device because of the parent UUID;
therefore the manager would try to create again the same device,
failing.

https://mail.gnome.org/archives/networkmanager-list/2017-September/msg00034.html
2017-09-28 10:54:01 +02:00
Beniamino Galvani
d2e4a2f639 device: deduplicate match_hwaddr() 2017-09-28 10:54:01 +02:00
Beniamino Galvani
27c281ac5a device: deduplicate match_parent() 2017-09-28 10:54:01 +02:00
Beniamino Galvani
ed640f857a manager: ignore unmanaged devices when looking for parent by UUID
If the device is unmanaged, it is not compatible with any connection.

https://mail.gnome.org/archives/networkmanager-list/2017-September/msg00032.html
2017-09-28 10:54:01 +02:00
Thomas Haller
8a5ebd3cb7 libnl: merge branch 'th/libnm-ip-route-equals'
https://github.com/NetworkManager/NetworkManager/pull/30
2017-09-27 18:59:02 +02:00
Thomas Haller
f83e6b9743 libnm: add nm_ip_route_equal_full() function
Expose previously internal function nm_ip_route_equal_full(). It's
just useful API.

However, add a @cmp_flags argument, so that in the future we could
extend it.
2017-09-27 18:58:53 +02:00
Thomas Haller
f05ebc4261 libnm: don't skip routes in nm_setting_ip_config_add_route() that only differ by attributes
For kernel and NetworkManager's core, route identity is a complicated topic
(see NM_PLATFORM_IP_ROUTE_CMP_TYPE_ID). For example, a route
without explity table is treated identical to "table 254" or "table 0".

It would be complicated to have nm_setting_ip_config_add_route()
implement that logic, especially since libnm offers not public API
to expose kernel's logic.

However, previously nm_setting_ip_config_add_route() would only consider
dest/prefix,next_hop,metric when comparing for equality. Hence, with

  nmcli connection modify "$CON" +ipv4.routes '192.168.5.0/24'
  nmcli connection modify "$CON" +ipv4.routes '192.168.5.0/24 table=42'

the second route was not actually added, although it is a very different
route. Fix that, and consider attributes too. Note that this allows the user
to add two routes that look different to libnm, but are actually idential:

  nmcli connection modify "$CON" +ipv4.routes '192.168.5.0/24'
  nmcli connection modify "$CON" +ipv4.routes '192.168.5.0/24 table=254'

In the above example, the route instances look different, but
sementically they are both the same route in the main table (254).

This also allows the user to add routes that are semantically different, but
are treated as the same route by kernel:

  nmcli connection modify "$CON" +ipv6.routes 'a🅱️c::/120'
  nmcli connection modify "$CON" +ipv6.routes 'a🅱️c::/120 mtu=600'

I think libnm should allow to add routes as long as they look different
to libnm. Regardless how kernel and NetworkManager-core thinks about
route identity.

This changes API of nm_setting_ip_config_add_route(). However, I think
the previous behavior was just broken.

Same for nm_setting_ip_config_remove_route_by_value().
2017-09-27 18:58:53 +02:00
Thomas Haller
d06c46b80f libnm: make index variable i unsigned for iterating array
GArray's and GPtrArray's plen argument is unsigned. The index variable
to iterate the list, should not have a smaller range (or different data type).

Also, assert against negative idx argument.
2017-09-27 18:58:53 +02:00
Thomas Haller
513d0c2286 contrib/rpm: enable "NetworkManager-wait-online.service" on package upgrade
Since commit d61eaf2545 ("service: don't
install dependency for "NetworkManager-wait-online.service" to
"network-online.target.wants") we no longer install NM-w-o.service
in "network-online.target.wants" directory.

Obviously, for previous RPM versions NM-w-o.service was always enabled.
For current versions, it depends now on the preset. Most importantly,
this allows the user to disable the service, without masking it.
Previously NM-w-o.service was always implicitly enabled.

But presets are not applied during package upgrade, so it means that
after upgrade the service will be disabled. Hack around that via an RPM
scriptlet.

https://bugzilla.redhat.com/show_bug.cgi?id=1455704
2017-09-27 18:02:51 +02:00
Beniamino Galvani
e25de114b2 nm-policy: use nm_g_hash_table_add() instead of g_hash_table_add()
The return value of g_hash_table_add() was added in GLib 2.40, use the
wrapper to avoid compile error on older versions:

 src/nm-policy.c: In function ‘auto_activate_device’:
 src/nm-policy.c:1279:7: error: void value not ignored as it ought to be

Fixes: a1ea422aad
2017-09-27 14:17:11 +02:00
Beniamino Galvani
a1ea422aad policy: watch active-connection state to detect autoconnect early failures
When a connection is autoactivated NMPolicy only detects a failure by
watching the device state, or when the activation fails immediately.

If the activation fails after the asynchronus authorization check
before the device enters the PREPARE state, no other connection is
tried.

Let NMPolicy watch the active-connection state to detect early
failures and disconnect the signal handler when we detect that the
device state is progressing.

https://bugzilla.redhat.com/show_bug.cgi?id=1310676
2017-09-27 13:45:07 +02:00
Thomas Haller
e6292bcb2a core: merge branch 'th/policy-routing-pt1-rh1436531'
Add initial support for policy-routing/source-routing.
It does not support rules (yet), only configuring routes
in a different routing table then 254 (main). And this
currently only works for manually configured routes,
not routes from DHCP or the default-route.

https://bugzilla.redhat.com/show_bug.cgi?id=1436531
2017-09-26 19:49:53 +02:00
Thomas Haller
5b0f895e19 libnm,core: add TABLE attribute for routes settings
https://bugzilla.redhat.com/show_bug.cgi?id=1436531
2017-09-26 19:39:36 +02:00
Thomas Haller
c71f26bf92 libnm,cli: add IP setting "route-table-sync" 2017-09-26 19:39:36 +02:00
Thomas Haller
a22b017830 cli: show additional route attributes in IP4_CONFIG output 2017-09-26 19:36:51 +02:00
Thomas Haller
ccb83e34a3 cli: refactor printing IP6 device info 2017-09-26 19:36:51 +02:00
Thomas Haller
6aed608011 libnm-core: sort attribute names for nm_ip_route_get_attribute_names()
The function shall return the attribute names in a consistent order.
Let's sort by name.
2017-09-26 19:36:51 +02:00
Thomas Haller
7cd04ce014 core: inject route list to delete for nm_platform_ip_route_sync()
Whenever we call a platform operation that reads or writes the netlink
socket, there is the possibility that the cache gets updated, as we
receive netlink events.

It is thus racy, if nm_platform_ip_route_sync() *first* adds routes, and
then obtains a list of routes to delete. The correct approach is to
determine which routes to delete first (and keep it in a list
@routes_prune), and pass that list down to nm_platform_ip_route_sync().

Arguably, this doesn't yet solve every race. For example, NMDevice
calls update_ext_ip_config() during ip4_config_merge_and_apply().
That is good, as it resyncs with platform. However, before calling
nm_ip4_config_commit() it calls other platform operations, like
_commit_mtu(). So, the race is still there.
2017-09-26 19:36:51 +02:00
Thomas Haller
0fce60c767 device: do full update_ext_ip_config() during merge-and-apply
Since commit a21b8882cc ("device: update
external configuration before commit"), we correctly re-sync the
external IP configuration before a merge, in case we notice that
there were some changes in platform.

Go a step further, and do the full update_ext_ip_config(). We should
have one way how to capture the external config, including intersect
and subtract. Otherwise, we end up with an @ext_ip4_config, which is
different from how it looks usually.
2017-09-26 19:36:51 +02:00
Thomas Haller
8207bfd5d6 device: refactor update-ip-config for device
Refactor the code. There should be no changes in behavior at all.

The point is, to be able to reuse update_ext_ip_config() in the
next commit.

And also, I think it's an antipattern to have mirroring functions like
ip4_xyz() and ip6_xyz(). Instead, there should be one function, with
extra addr_family argument. That way, it'much clearer where two
implementations differ and where they are identical.
Basically, it moves the differentiation per the address family down
the call stack, closer to the place where the behavior is actually
different.
2017-09-26 19:35:32 +02:00
Thomas Haller
f7616eee1e shared: move nm_dedup_multi_obj_ref() to header as inline
nm_dedup_multi_obj_ref() is a trivial function, that only uses the field
which is already declared in the same header file. Move it to the header
so that it can be inlined (without LTO).
2017-09-26 19:31:17 +02:00
Thomas Haller
9acf80a979 platform: handle route table RT_TABLE_UNSPEC specially
Kernel does not allow to add a route with table 0 (RT_TABLE_UNSPEC). It
effectively is an alias for the main table. We must consider that when
comparing routes sementically.
2017-09-26 19:31:17 +02:00
Thomas Haller
4ca2e1b10c cli: merge branch 'th/cli-interactive-mode-crash-bgo788104'
https://bugzilla.gnome.org/show_bug.cgi?id=788104
2017-09-26 15:14:57 +02:00
Thomas Haller
889ecc98a1 cli: use cleanup attribute in editor_menu_main() 2017-09-26 15:11:58 +02:00
Thomas Haller
54490be96d cli: fix crash in interactive mode for "describe ."
https://bugzilla.gnome.org/show_bug.cgi?id=788104
2017-09-26 15:11:58 +02:00
Beniamino Galvani
7070d17ced device: reset @con_ip6_config on failure before RA
If the commit of static connection parameters fails before starting
RA, we should reset @con_ip6_config; otherwise any external update
arriving before the commit of RA parameters will remove from
@con_ip6_config all parameters not present externally, because in
update_ip6_config() we do:

  /* This function was called upon external changes. Remove the configuration
   * (addresses,routes) that is no longer present externally from the internal
   * config. This way, we don't re-add addresses that were manually removed
   * by the user. */
  if (priv->con_ip6_config)
      nm_ip6_config_intersect (priv->con_ip6_config, priv->ext_ip6_config);

Instead if @con_ip6_config is cleared it will be rebuilt from the
connection setting at the next commit.

Fixes-test: @ipv6_preserve_cached_routes
2017-09-26 08:53:56 +02:00
Beniamino Galvani
7dc1f8b479 ifcfg-rh: trivial: rename write_bonding_setting() to write_bond_setting()
The setting name is NMSettingBond.
2017-09-25 22:36:45 +02:00
Beniamino Galvani
e89ed9b51e ifcfg-rh: write DEVICE only once
The plugin already writes DEVICE in write_connection_setting(), there
is no need to write it again elsewhere.
2017-09-25 22:36:43 +02:00
Thomas Haller
18f53a8b30 contrib/scripts: update coloring for platform messages in NM-log (2)
Fixes: 9344013977
2017-09-25 18:36:08 +02:00
Thomas Haller
01677a3e40 build: cleanup style for toplevel Makefile.am
Use consistently $() instead of ${}.

Don't use the $(top_*) variables, because we don't do recursive make
and the toplevel directory is the same as the current directory.
For consistency, only use the non-toplevel versions of the variables.
2017-09-25 18:23:15 +02:00
Thomas Haller
9344013977 contrib/scripts: update coloring for platform messages in NM-log 2017-09-25 15:13:02 +02:00
Thomas Haller
5819988ac7 platform: cleanup logging for adding link
No need for duplicate log lines

  <debug> [1506146476.8462] platform: link: adding tap tap0 owner 107 group -1
  <debug> [1506146476.8462] platform-linux: link: add tap tap0 owner 107 group -1

Merge them.

Also, for consistency change the logging output for adding generic
interfaces in nm_platform_link_add().
2017-09-25 14:49:44 +02:00
Iain Lane
b18896f770 {vpn,remote}-connection: disconnect signal handlers when disposed
GNOME Settings 3.26 is crashing every time a VPN connection changed its
state. After some digging, a debug message was put on dispose, and this
issue was found:

libnm-Message: Object 0x55555633c070 disposed
libnm-Message: Object 0x55555633c730 disposed
libnm-Message: Object 0x55555633eae0 disposed
libnm-Message: Object 0x555556340a80 disposed

Thread 1 "gnome-control-c" received signal SIGSEGV, Segmentation fault.
g_type_check_instance_cast (type_instance=type_instance@entry=0x55555633c070, iface_type=93825006537856) at /.../glib/gobject/gtype.c:4057
4057		  node = lookup_type_node_I (type_instance->g_class->g_type);
(gdb) bt

NetworkManager is calling callbacks on disposed objects, which leads to
crashes in clients (e.g. GNOME Settings).

Fix this issue by disconnecting signal handlers when the objects are
disposed.

Patch originally by Georges Basile Stavracas Neto <georges.stavracas@gmail.com>

https://bugzilla.gnome.org/show_bug.cgi?id=787893
2017-09-22 14:16:50 +02:00
Iain Lane
91fa202379 manager: Disconnect from signals on the proxy when we're disposed
We're calling a callback on a proxy after it has been disposed. We
should make sure to disconnect from it when we go away.

https://bugzilla.gnome.org/show_bug.cgi?id=787897
2017-09-22 14:15:53 +02:00
Francesco Giudici
15344be0e1 device: avoid touching IPv6 on "external" connections without IPv6 conf
When a device managed by NetworkManager is configured manually (adding
ip addresses), NetworkManager will track the device configuration with
an in-memory only config, marking the device as "external".
Devices marked external should be just tracked but left untouched.
This does not happens on current code base: if an ipv4 address is added,
NM generates the in-memory connection, marking the ipv6.method as "ignore".
While activating the connection, NM will process the IPv6 "ignore" method:
this implies leaving the IPv6LL address generation to the kernel. To
trigger this NM will disable/enable IPv6 on the interface.
This not only may change the device configuration but may cause also
a potential race with an external IPv6 assignment on the device.

NetworkManager should do nothing to IPv6 when method is "ignore" and
connection is marked as "external": this commit fixes this behavior.
Note that if/once an IPv6 address is externally added, IPv6 method in the
tracked connection is changed to "manual" and a link local address will be
generated if needed.

https://bugzilla.redhat.com/show_bug.cgi?id=1462260
2017-09-22 13:19:10 +02:00
Beniamino Galvani
2f66fbf32d build: add missing header file to Makefile
Fixes: 734c5b38ad
2017-09-22 12:06:11 +02:00
Thomas Haller
734c5b38ad dhcp: use systemd defines for DHCP options 2017-09-21 15:49:48 +02:00
Thomas Haller
61f0f198bf systemd: merge branch systemd into master 2017-09-21 15:33:32 +02:00
Thomas Haller
eba874f859 systemd: update code from upstream (2017-09-21)
This is a direct dump from systemd git on 2017-09-21, git commit
f679ed61163468f4fb2d4a17fa0984c8c1f0ba36.

======

SYSTEMD_DIR=../systemd
COMMIT=f679ed61163468f4fb2d4a17fa0984c8c1f0ba36

(
  cd "$SYSTEMD_DIR"
  git checkout "$COMMIT"
  git reset --hard
  git clean -fdx
)

git ls-files :/src/systemd/src/ | xargs -d '\n' rm -f

nm_copy_sd() {
    mkdir -p "./src/systemd/$(dirname "$1")"
    cp "$SYSTEMD_DIR/$1" "./src/systemd/$1"
}

nm_copy_sd "src/basic/alloc-util.c"
nm_copy_sd "src/basic/alloc-util.h"
nm_copy_sd "src/basic/async.h"
nm_copy_sd "src/basic/escape.c"
nm_copy_sd "src/basic/escape.h"
nm_copy_sd "src/basic/ether-addr-util.c"
nm_copy_sd "src/basic/ether-addr-util.h"
nm_copy_sd "src/basic/extract-word.c"
nm_copy_sd "src/basic/extract-word.h"
nm_copy_sd "src/basic/fileio.c"
nm_copy_sd "src/basic/fileio.h"
nm_copy_sd "src/basic/fd-util.c"
nm_copy_sd "src/basic/fd-util.h"
nm_copy_sd "src/basic/fs-util.c"
nm_copy_sd "src/basic/fs-util.h"
nm_copy_sd "src/basic/hash-funcs.c"
nm_copy_sd "src/basic/hash-funcs.h"
nm_copy_sd "src/basic/hashmap.c"
nm_copy_sd "src/basic/hashmap.h"
nm_copy_sd "src/basic/hexdecoct.c"
nm_copy_sd "src/basic/hexdecoct.h"
nm_copy_sd "src/basic/hostname-util.c"
nm_copy_sd "src/basic/hostname-util.h"
nm_copy_sd "src/basic/in-addr-util.c"
nm_copy_sd "src/basic/in-addr-util.h"
nm_copy_sd "src/basic/io-util.c"
nm_copy_sd "src/basic/io-util.h"
nm_copy_sd "src/basic/list.h"
nm_copy_sd "src/basic/log.h"
nm_copy_sd "src/basic/macro.h"
nm_copy_sd "src/basic/mempool.h"
nm_copy_sd "src/basic/mempool.c"
nm_copy_sd "src/basic/parse-util.c"
nm_copy_sd "src/basic/parse-util.h"
nm_copy_sd "src/basic/path-util.c"
nm_copy_sd "src/basic/path-util.h"
nm_copy_sd "src/basic/prioq.h"
nm_copy_sd "src/basic/prioq.c"
nm_copy_sd "src/basic/process-util.h"
nm_copy_sd "src/basic/process-util.c"
nm_copy_sd "src/basic/random-util.c"
nm_copy_sd "src/basic/random-util.h"
nm_copy_sd "src/basic/refcnt.h"
nm_copy_sd "src/basic/set.h"
nm_copy_sd "src/basic/signal-util.h"
nm_copy_sd "src/basic/siphash24.c"
nm_copy_sd "src/basic/siphash24.h"
nm_copy_sd "src/basic/socket-util.c"
nm_copy_sd "src/basic/socket-util.h"
nm_copy_sd "src/basic/sparse-endian.h"
nm_copy_sd "src/basic/stdio-util.h"
nm_copy_sd "src/basic/string-table.c"
nm_copy_sd "src/basic/string-table.h"
nm_copy_sd "src/basic/string-util.c"
nm_copy_sd "src/basic/string-util.h"
nm_copy_sd "src/basic/strv.c"
nm_copy_sd "src/basic/strv.h"
nm_copy_sd "src/basic/time-util.c"
nm_copy_sd "src/basic/time-util.h"
nm_copy_sd "src/basic/umask-util.h"
nm_copy_sd "src/basic/unaligned.h"
nm_copy_sd "src/basic/utf8.c"
nm_copy_sd "src/basic/utf8.h"
nm_copy_sd "src/basic/util.c"
nm_copy_sd "src/basic/util.h"
nm_copy_sd "src/libsystemd-network/arp-util.c"
nm_copy_sd "src/libsystemd-network/arp-util.h"
nm_copy_sd "src/libsystemd-network/dhcp6-internal.h"
nm_copy_sd "src/libsystemd-network/dhcp6-lease-internal.h"
nm_copy_sd "src/libsystemd-network/dhcp6-network.c"
nm_copy_sd "src/libsystemd-network/dhcp6-option.c"
nm_copy_sd "src/libsystemd-network/dhcp6-protocol.h"
nm_copy_sd "src/libsystemd-network/dhcp-identifier.c"
nm_copy_sd "src/libsystemd-network/dhcp-identifier.h"
nm_copy_sd "src/libsystemd-network/dhcp-internal.h"
nm_copy_sd "src/libsystemd-network/dhcp-lease-internal.h"
nm_copy_sd "src/libsystemd-network/dhcp-network.c"
nm_copy_sd "src/libsystemd-network/dhcp-option.c"
nm_copy_sd "src/libsystemd-network/dhcp-packet.c"
nm_copy_sd "src/libsystemd-network/dhcp-protocol.h"
nm_copy_sd "src/libsystemd-network/lldp-internal.h"
nm_copy_sd "src/libsystemd-network/lldp-neighbor.c"
nm_copy_sd "src/libsystemd-network/lldp-neighbor.h"
nm_copy_sd "src/libsystemd-network/lldp-network.c"
nm_copy_sd "src/libsystemd-network/lldp-network.h"
nm_copy_sd "src/libsystemd-network/network-internal.c"
nm_copy_sd "src/libsystemd-network/network-internal.h"
nm_copy_sd "src/libsystemd-network/sd-dhcp6-client.c"
nm_copy_sd "src/libsystemd-network/sd-dhcp6-lease.c"
nm_copy_sd "src/libsystemd-network/sd-dhcp-client.c"
nm_copy_sd "src/libsystemd-network/sd-dhcp-lease.c"
nm_copy_sd "src/libsystemd-network/sd-ipv4ll.c"
nm_copy_sd "src/libsystemd-network/sd-ipv4acd.c"
nm_copy_sd "src/libsystemd-network/sd-lldp.c"
nm_copy_sd "src/libsystemd/sd-event/sd-event.c"
nm_copy_sd "src/libsystemd/sd-id128/id128-util.c"
nm_copy_sd "src/libsystemd/sd-id128/id128-util.h"
nm_copy_sd "src/libsystemd/sd-id128/sd-id128.c"
nm_copy_sd "src/shared/dns-domain.c"
nm_copy_sd "src/shared/dns-domain.h"
nm_copy_sd "src/systemd/_sd-common.h"
nm_copy_sd "src/systemd/sd-dhcp6-client.h"
nm_copy_sd "src/systemd/sd-dhcp6-lease.h"
nm_copy_sd "src/systemd/sd-dhcp-client.h"
nm_copy_sd "src/systemd/sd-dhcp-lease.h"
nm_copy_sd "src/systemd/sd-event.h"
nm_copy_sd "src/systemd/sd-ndisc.h"
nm_copy_sd "src/systemd/sd-id128.h"
nm_copy_sd "src/systemd/sd-ipv4acd.h"
nm_copy_sd "src/systemd/sd-ipv4ll.h"
nm_copy_sd "src/systemd/sd-lldp.h"
2017-09-21 15:08:50 +02:00
Lucas Rangit Magasweran
843ea77e93 examples: linker requires that library dependencies follow use
On modern distributions, ld runs with the '--as-needed' option
enabled by default, meaning library dependencies must come after
files that require them. Also, this allows indirect linking so the
build commands can be simplified.

The alternative is to add the '-Wl,--no-as-needed' gcc option or
use the top-level Makefile.

Tested on:
 * Ubuntu 16.04.3 with gcc Ubuntu 5.4.1-8ubuntu1
 * Fedora 24 with gcc Red Hat 6.1.1-3

Signed-off-by: Lucas Magasweran <lucas.magasweran@ieee.org>

https://mail.gnome.org/archives/networkmanager-list/2017-September/msg00022.html
https://mail.gnome.org/archives/networkmanager-list/2017-September/msg00023.html
https://mail.gnome.org/archives/networkmanager-list/2017-September/msg00025.html
2017-09-21 13:14:56 +02:00
Thomas Haller
8022ed3ab2 core: avoid maybe-uninitialized compiler warning with nmp_cache_iter_for_each()
CC       src/devices/src_libNetworkManager_la-nm-device.lo
  In file included from src/devices/nm-device.c:45:0:
  src/devices/nm-device.c: In function ‘_v4_has_shadowed_routes_detect’:
  ./src/platform/nmp-object.h:400:54: error: ‘o’ may be used uninitialized in this function [-Werror=maybe-uninitialized]
     _obj ? &_NM_CONSTCAST (NMPObject, _obj)->ip4_route : NULL; \
                                                        ^
  src/devices/nm-device.c:2774:19: note: ‘o’ was declared here
    const NMPObject *o;
                     ^
2017-09-21 13:14:56 +02:00
Thomas Haller
85e3f956ad contrib/rpm: update spec file with upstream source URL
This isn't useful for contrib/fedora/rpm itself because here
the __SOURCE__ gets set by the build scripts.

But this spec file is copied to Fedora downstream where the
SOURCE URL is used.
2017-09-20 14:29:53 +02:00
Beniamino Galvani
7af471919a cli: wifi: connect with PSK when the AP supports WPA-PSK and WPA-EAP
'nmcli device wifi connect' only supports WEP and WPA-PSK at the
moment, but not WPA-EAP. If the AP supports both WPA-PSK and WPA-EAP,
nmcli doesn't add the PSK to the connection, causing a connection
failure. Fix this.

https://bugzilla.redhat.com/show_bug.cgi?id=1492064
2017-09-20 09:23:54 +02:00
Beniamino Galvani
05618aaaf3 core: merge branch 'bg/manager-parent-warnings-rh1490157'
https://bugzilla.redhat.com/show_bug.cgi?id=1490157
2017-09-20 08:07:05 +02:00
Beniamino Galvani
b53f8de08b vlan: improve error message on missing parent ifindex
The message should only tell what went wrong.
2017-09-20 08:01:02 +02:00
Beniamino Galvani
41b0e8c5a5 manager: downgrade error message for missing dependencies
At startup the manager tries to create virtual devices without a
specific order and spits warnings when a device can't be realized
because the parent device is not yet created. These failures are not
something the user should worry about because the creation will be
retried when the parent appears.

A better approach is to return an error code from the device's
create_and_realize() telling that it failed because the parent doesn't
exist. In this way, the manager knows that the device isn't ready and
can avoid printing warning messages.
2017-09-20 08:01:02 +02:00
Beniamino Galvani
74845f80ec manager: try other connections only after the device is realized
After a device is created in system_create_virtual_device(), the
manager tries to activate connections that depend on the device
even if the device isn't realized, as in the following log:

 # team0 gets created
  <info>  manager: (team0): new Team device (/org/freedesktop/NetworkManager/Devices/7)

 # team0.23 gets created
  <debug> device[0x28079b0] (team0.23): constructed (NMDeviceVlan)
  <debug> manager: (team0-vlan23) create virtual device team0.23
  <debug> device[0x28079b0] (team0.23): unmanaged: flags set to [platform-init,!sleeping=0x10/0x11/unmanaged/unrealized], set-managed [sleeping
  <info>  manager: (team0.23): new VLAN device (/org/freedesktop/NetworkManager/Devices/8)

 # the manager tries to realize team0.23
  <debug> device[0x28079b0] (team0.23): create (is nm-owned)
  <warn>  manager: (team0-vlan23) couldn't create the device: cannot retrieve ifindex of interface team0 (Team): skip VLAN creation for now
  <debug> manager: (team0.23): removing device (allow_unmanage 1, managed 0)
  <debug> device[0x28079b0] (team0.23): ip4-config: update (commit=0, new-config=(nil))
  <debug> device[0x28079b0] (team0.23): ip6-config: update (commit=0, new-config=(nil))
  <debug> device[0x28079b0] (team0.23): disposing
  <debug> device[0x28079b0] (team0.23): ip4-config: update (commit=1, new-config=(nil))
  <debug> device[0x28079b0] (team0.23): ip6-config: update (commit=1, new-config=(nil))
  <debug> device[0x28079b0] (team0.23): finalize(): NMDeviceVlan

 # the manager realizes team0
  <debug> device[0x2800870] (team0): create (is nm-owned)
  <debug> platform: link: add link 'team0' of type 'team' (196610)

Change the order of operations and try the child connection only after
the parent has been realized.
2017-09-20 07:54:13 +02:00
Thomas Haller
03e1cc96a5 core: fix handling IPv6 device-route and use correct route metric
Before commit 6698bf58bb, we would rely on
kernel to add the device-route for manual IPv6 routes. We broke that and now
kernel would still add the device-route, however nm_platform_ip_route_sync()
would delete it immediately after.
That is because previously nm_platform_ip_route_sync() would ignore routes
with rtm_protocol RTPRO_KERNEL. Now, it will sync and delete those too.

Fix that by adding the device-route like we do it for IPv4. This also
fixes an actual issue where the automatically added route always had
route-metric 256. Instead, we now use the metric from ipv6.route-metric
setting.

Fixes: 6698bf58bb
2017-09-19 11:49:29 +02:00