$ nmcli dev disconnect nm-bond
Error: Timeout 10 sec expired.
When a software device is disconnected, it will be removed. And it may not go
to NM_DEVICE_STATE_DISCONNECTED state before that. So we need to listen to
"device-removed" signal.
Fixes:Beaker:test_log-NetworkManager_Test189_bond_activate
Things explode on i386 when marshalling a 32-bit value when a 64-bit one is
expected:
Program received signal SIGSEGV, Segmentation fault.
__memset_sse2 () at ../sysdeps/i386/i686/multiarch/memset-sse2.S:242
242 movdqu %xmm0, (%edx)
Missing separate debuginfos, use: debuginfo-install nss-mdns-0.10-15.fc21.i686
(gdb) bt
#0 0xffffffff in __memset_sse2 () at ../sysdeps/i386/i686/multiarch/memset-sse2.S:242
#1 0xffffffff in g_hash_table_remove_all_nodes (__len=<optimized out>, __ch=0, __dest=<optimized out>)
at /usr/include/bits/string3.h:84
#2 0xffffffff in g_hash_table_remove_all_nodes (hash_table=hash_table@entry=0x82ee250<error reading variable: Cannot access memory at address 0x8dbaacd6>, notify=notify@entry=1) at ghash.c:481
#3 0xffffffff in g_hash_table_unref (hash_table=0x82ee250<error reading variable: Cannot access memory at address 0x8dbaacd6>) at ghash.c:1042
#4 0xffffffff in _g_type_boxed_free (type=136861824, value=0x82ee250) at gtype.c:4262
#5 0xffffffff in boxed_proxy_value_free (value=0xbfffe8ec) at gboxed.c:209
#6 0xffffffff in g_value_unset (value=value@entry=0xbfffe8ec) at gvalue.c:272
#7 0xffffffff in g_signal_emit_valist (instance=instance@entry=0x82492b8, signal_id=signal_id@entry=125, detail=detail@entry=0, var_args=<optimized out>, var_args@entry=0xbfffea4c "\030\342.\bL#") at gsignal.c:3338
#8 0xffffffff in g_signal_emit (instance=0x82492b8, signal_id=125, detail=0) at gsignal.c:3365
#9 0x0809c05d in handle_event (proxy=0xb5d012e8 [DBusGProxy], options=0x82eb640 = {...}, user_data=0x82492b8)
at dhcp-manager/nm-dhcp-listener.c:146
#10 0xffffffff in g_cclosure_marshal_VOID__BOXED (closure=0x82bf270, return_value=0x0, n_param_values=2, param_values=0x82c60c0, invocation_hint=0xbfffec68, marshal_data=0x0) at gmarshal.c:1120
#11 0xffffffff in marshal_dbus_message_to_g_marshaller () at /lib/libdbus-glib-1.so.2
#15 0xffffffff in <emit signal received:org-freedesktop-nm_dhcp_client-Event on instance 0xb5d012e8 [DBusGProxy]> (instance=0xb5d012e8, signal_id=19, detail=915) at gsignal.c:3365
#12 0xffffffff in g_closure_invoke (closure=0x82bf270, return_value=return_value@entry=0x0, n_param_values=n_param_values@entry=3, param_values=param_values@entry=0xbfffecc0, invocation_hint=invocation_hint@entry=0xbfffec68) at gclosure.c:768
#13 0xffffffff in signal_emit_unlocked_R (node=node@entry=0x8263660, detail=detail@entry=915, instance=0xb5d012e8, emission_return=emission_return@entry=0x0, instance_and_params=0xbfffecc0) at gsignal.c:3553
#14 0xffffffff in g_signal_emit_valist (instance=instance@entry=0xb5d012e8, signal_id=signal_id@entry=19, detail=detail@entry=915, var_args=0xbfffee34 "\340\370.\b\004",
var_args@entry=0xbfffee2c "\340\370.\b\300\303/\b\340\370.\b\004") at gsignal.c:3309
#16 0xffffffff in dbus_g_proxy_manager_filter () at /lib/libdbus-glib-1.so.2
#17 0xffffffff in dbus_connection_dispatch () at /lib/libdbus-1.so.3
#18 0xffffffff in message_queue_dispatch () at /lib/libdbus-glib-1.so.2
#19 0xffffffff in g_main_context_dispatch (context=0x8246720) at gmain.c:3111
#20 0xffffffff in g_main_context_dispatch (context=context@entry=0x8246720) at gmain.c:3710
#21 0xffffffff in g_main_context_iterate (context=0x8246720, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3781
#22 0xffffffff in g_main_loop_run (loop=0x8246798) at gmain.c:3975
#23 0x08070c09 in main (argc=1, argv=0xbffff2b4) at main.c:479
(gdb)
PIDs use native word width, a gint seems more suitable than gint32 or gint64.
https://bugzilla.gnome.org/show_bug.cgi?id=739861
Causes the info->remaining to be counted incorrectly possibly resulting in
g_main_loop_quit() being called twice:
Program received signal SIGSEGV, Segmentation fault.
0x00007ffff5a03155 in g_mutex_lock (mutex=0x7ffff7b764b4) at gthread-posix.c:1331
1331 if G_UNLIKELY (g_atomic_int_add (&mutex->i[0], 1) != 0)
Missing separate debuginfos, use: debuginfo-install libgcc-4.9.2-1.fc21.x86_64 libgudev1-216-8.fc21.x86_64 libselinux-2.3-5.fc21.x86_64 libuuid-2.25.2-1.fc21.x86_64 ncurses-libs-5.9-16.20140323.fc21.x86_64 nspr-4.10.7-1.fc21.x86_64 nss-3.17.2-1.fc21.x86_64 nss-softokn-3.17.2-1.fc21.x86_64 nss-softokn-freebl-3.17.2-1.fc21.x86_64 nss-util-3.17.2-1.fc21.x86_64 sqlite-3.8.7-1.fc21.x86_64 systemd-libs-216-8.fc21.x86_64
(gdb) bt
#0 0x00007ffff5a03155 in g_mutex_lock (mutex=0x7ffff7b764b4) at gthread-posix.c:1331
#1 0x00007ffff59bf258 in g_main_loop_quit (loop=0x7fffffffd130) at gmain.c:4000
#5 0x00007ffff5edc3bf in <emit signal notify:active-connection on instance 0x5555557bd180 [NMDeviceVlan]> (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>) at gsignal.c:3365
#2 0x00007ffff5ec1d35 in g_closure_invoke (closure=0x5555557b3da0, return_value=return_value@entry=0x0, n_param_values=2, param_values=param_values@entry=0x7fffffffd760, invocation_hint=invocation_hint@entry=0x7fffffffd700) at gclosure.c:768
#3 0x00007ffff5ed3a52 in signal_emit_unlocked_R (node=node@entry=0x555555787040, detail=detail@entry=341, instance=instance@entry=0x5555557bd180, emission_return=emission_return@entry=0x0, instance_and_params=instance_and_params@entry=0x7fffffffd760) at gsignal.c:3553
#4 0x00007ffff5edc191 in g_signal_emit_valist (instance=<optimized out>, signal_id=<optimized out>, detail=<optimized out>, var_args=var_args@entry=0x7fffffffd8f0) at gsignal.c:3309
#6 0x00007ffff5ec6465 in g_object_dispatch_properties_changed (object=0x7ffff7b764b4, n_pspecs=1434087776, pspecs=0x5555557ba880) at gobject.c:1056
#7 0x00007ffff5ec88c1 in g_object_notify (pspec=<optimized out>, object=0x5555557bd180 [NMDeviceVlan])
at gobject.c:1149
#8 0x00007ffff5ec88c1 in g_object_notify (object=0x5555557bd180 [NMDeviceVlan], property_name=property_name@entry=0x7ffff7b772f6 "active-connection") at gobject.c:1197
#9 0x00007ffff7ae57d3 in deferred_notify_cb (data=<optimized out>) at nm-object.c:246
#10 0x00007ffff59beafb in g_main_context_dispatch (context=0x555555784ac0) at gmain.c:3111
#11 0x00007ffff59beafb in g_main_context_dispatch (context=context@entry=0x555555784ac0) at gmain.c:3710
#12 0x00007ffff59bee98 in g_main_context_iterate (context=0x555555784ac0, block=block@entry=1, dispatch=dispatch@entry=1, self=<optimized out>) at gmain.c:3781
#13 0x00007ffff59bf1c2 in g_main_loop_run (loop=0x5555557699e0) at gmain.c:3975
#14 0x000055555555811d in test_activate_virtual () at test-nm-client.c:1103
#15 0x00007ffff59e4243 in g_test_run_suite_internal (tc=0x555555769a30) at gtestutils.c:2059
#16 0x00007ffff59e4243 in g_test_run_suite_internal (suite=suite@entry=0x555555766640, path=path@entry=0x7ffff5a6355e "") at gtestutils.c:2120
#17 0x00007ffff59e4412 in g_test_run_suite_internal (suite=suite@entry=0x555555766620, path=<optimized out>,
path@entry=0x7ffff5a6355e "") at gtestutils.c:2131
#18 0x00007ffff59e477b in g_test_run_suite (suite=0x555555766620) at gtestutils.c:2184
#19 0x00007ffff59e47b1 in g_test_run () at gtestutils.c:1488
#20 0x0000555555556c01 in main (argc=1, argv=0x7fffffffe028) at test-nm-client.c:1189
https://bugzilla.gnome.org/show_bug.cgi?id=739861
Because internal objects do some processing/setup in the various
_added class signal handlers, they need to be emitted before
property change notifications. Otherwise it leads to situations
where external objects that listen to NMClient property changes
will be called before internal processing has been completed.
Specifically, NMRemoteSettings uses connection_added() to check
connection visibility and assign the new connection to one of
two internal arrays. If a client got a property notification
for NMClient::connections before NMRemoteSettings can process
the new connection, then nm_client_get_connections() will
return an empty array because NMRemoteSettings hasn't had the
chance to add the new connection to priv->visible yet, which
is done in NMRemoteSettings::connection_added().
Fixes:Beaker:NetworkManager_Test240_nmtui_general_realtime_refresh_edit_screen
Make NMClient disconnect from the NMManager and NMRemoteSettings
signals when disposing, in case they outlive the NMClient (which
shouldn't happen, but...)
Add contrib/fedora/rpm/ directory to POTFILES.skip.
Otherwise, after building an RPM, make check would fail
due to the source files from the rpmbuild.
Signed-off-by: Thomas Haller <thaller@redhat.com>
When quitting, the Manager asks each device to spawn the interface helper,
which persists and manages dynamic address on the interface after NetworkManager
is gone. If the dynamic address cannot be maintaned, the helper quits and
the interface's address may be removed when their lifetime runs out.
To keep the helper as simple as possible, NetworkManager passes most of the
configuration on the command-line, including some properties of the device's
current state, which are necessary for the helper to maintain DHCP leases
or IPv6 SLAAC addresses.
Cloud setups often have a never-changing setup and since every cycle counts,
they don't really want a management process running in the background after
network setup is complete. Since it's likely a VM, it's not like links
are going to go up/down very often.
Add a new "configure-quit=true/false" config option which, when set to true,
will quit NetworkManager after startup and initial configuration is complete.
Really only used by systemd because it doesn't have as good lease
handling, but it's also necessary if we switch DHCP clients mid-stream
(which we'll be doing later) since the new DHCP client won't
have a lease file for the current IP address, and thus has nowhere
to pull the current IP address from to request the same address
from the DHCP server.
Make the type return GBytes since most in-tree users want that.
Allow the function to accept many more formats as valid hex, including
bytes delimited by ':' and a leading '0x'.
Update the docs build to include and exclude the correct files.
Fill in some missing documentation, and fix problems in the existing
docs. (In particular, "<" can't appear as a literal in documentation,
so change it to "<". Also, "PKCS#12" has to be written as
"PKCS#<!-- -->12", or gtk-doc will think "#12" is a reference to a
type named "12".)
shvar.c has apparently never stripped trailing whitespace, but
obviously a shell doesn't care. Unfortunately NM does. Strip
trailing whitespace before unescaping, to preserve quoted
whitespace.
https://bugzilla.redhat.com/show_bug.cgi?id=1100336
This fixes an assertion during shutdown. NMManager:dispose()
calls remove_device(), which eventually hit the assertion
in nm_default_route_manager_ip4_get_best_device().
Remove the assertion, but also make sure that the function only
returns devices from the provided list. It is counter intuitive,
that the function might return devices that are not in the provided
list.
Signed-off-by: Thomas Haller <thaller@redhat.com>
We'll ever have WWAN devices with a NULL gateway because the IPv6 over
WWAN still uses router advertisements to get a prefix. Thus you'll
always have a gateway if the device has real IPv6 connectivity.
For the IPv4 case, we still allow default routes without gateway on
WWAN.
https://bugzilla.gnome.org/show_bug.cgi?id=735512
Signed-off-by: Thomas Haller <thaller@redhat.com>
Now that both VPN and devices are managed (and ordered) by
NMDefaultRouteManager, refactor get_best_config() to use the
priority accordingly.
Before, we would first iterate over all VPN connections and
returning the best one. Only if no suitable VPN connection
was found, a best device would be returned.
Modify get_best_config() to treat VPN and device the same and
return the best one based on the route metric.
With this change, get_best_config() gives consistent results
together with get_best_device(). Also, you can configure
that a device gets a higher priority then a VPN.
Signed-off-by: Thomas Haller <thaller@redhat.com>
get_best_device() has two different modes depending on the @fully_activated argument.
If @fully_activated, it only considers devices that are considered as active.
Otherwise, it returns the best activating device (if that device is expected
to be better then any of the already activated devices).
Before, the check whether an activated device is considered best device
also involved looking at the device state. This redundancy was harmful
because part of NMDefaultRouteManager considered a device as fully activated,
but get_best_device() might not return them.
Split get_best_device() in two parts. The one part _ipx_get_best_activating_device()
now checks for still activating devices. When inspecting devices with
an entry, those devices are weighted according to _ipx_get_best_device().
That means that both functions now give a consistent result.
Signed-off-by: Thomas Haller <thaller@redhat.com>
Extend NMDefaultRouteManager to track NMVpnConnection beside
NMDevice. That way, all default routes are managed by
NMDefaultRouteManager.
For VPN connections the manager also tracks connections that are
set never_default. That is useful because NMPolicy still uses VPNs
without default route to setup DNS. Hence, NMDefaultRouteManager
trackes those connections to have the relative priority of the
devices.
Interestingly, that means that for VPNs that are ipv4.never-default,
ipv4.route-metric still has an effect in determining relative priorities
for DNS configuration.
This commit only adds the parts to track the default route. NMPolicy
still sets the route as before.
Signed-off-by: Thomas Haller <thaller@redhat.com>
NMDefaultRouteManager has a sorted list of routes. Change get_best_device()
to better consider that list when choosing a best device.
Always prefer the priority as reported from entry->effective_metric
if the device is registered to have a default route. Before for
!fully_activated, we choose the metric based on
nm_device_get_ipx_route_metric().
Add more checks in case of equal priority. For @fully_activated,
always prefer the device that is sorted by NMDefaultRouteManager.
For non @fully_activated, prefer the device with an entry.
Signed-off-by: Thomas Haller <thaller@redhat.com>
Up to now, NMPolicy would iterate over all devices to find the "best"
device and assign the default route to that device.
A better approach is to add a default route to *all* devices that
are never-default=no. The relative priority is choosen according to
the route metrics.
If two devices receive the same metric, we want to prefer the device
that activates first. That way, the default route sticks to the same
device until a better device activates or the device deactivates.
Hence, the order of activation is imporant in this case (as it is
already now).
Also, if several devices have identical metrics, increment their
metrics so that every metric is unique.
This makes the routing deterministic according to what we choose as best
device.
A special case is assumed devices. In this case we cannot adjust the metric
in face of equal metrics.
Add a new singleton class NMDefaultRouteManager that has a list of all
devices and their default routes. The manager will order the devices by
their priority and configure the routes using platform.
Also update the metric for VPN connections. Later we will track VPN
routes also via NMDefaultRouteManager. For now, fix the VPN metric because
otherwise VPNs would always get metric 1024 (which is usually much larger then the
device metrics).
https://bugzilla.gnome.org/show_bug.cgi?id=735512
Signed-off-by: Thomas Haller <thaller@redhat.com>
get_best_ip4_config() and get_best_ip6_config() checked both for
never-default of the setting. This check was redundant, because
the never-default value was already merged into NMIPXConfig.
Signed-off-by: Thomas Haller <thaller@redhat.com>