diff options
author | Dan Winship <danw@gnome.org> | 2014-03-26 12:39:13 -0400 |
---|---|---|
committer | Dan Winship <danw@gnome.org> | 2014-03-26 12:56:57 -0400 |
commit | 726e84cfbfc7531924afa26d5abe6349d0dd69bb (patch) | |
tree | e8a880ab27b1d37573c86929598ad39ed9b8b9a8 | |
parent | cfba0f8693de9a13bd68f4dd8c6bed191302521a (diff) | |
download | NetworkManager-726e84cfbfc7531924afa26d5abe6349d0dd69bb.tar.gz |
devices: if a generated connection doesn't verify, log why
-rw-r--r-- | src/devices/nm-device.c | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/src/devices/nm-device.c b/src/devices/nm-device.c index 4f7a7ab15c..7e2f034ec8 100644 --- a/src/devices/nm-device.c +++ b/src/devices/nm-device.c @@ -1771,6 +1771,7 @@ nm_device_generate_connection (NMDevice *device) gs_free char *name = NULL; int master_ifindex = 0; const char *ip4_method, *ip6_method; + GError *error = NULL; /* If update_connection() is not implemented, just fail. */ if (!klass->update_connection) @@ -1851,7 +1852,13 @@ nm_device_generate_connection (NMDevice *device) klass->update_connection (device, connection); /* Check the connection in case of update_connection() bug. */ - g_return_val_if_fail (nm_connection_verify (connection, NULL), NULL); + if (!nm_connection_verify (connection, &error)) { + nm_log_err (LOGD_DEVICE, "(%s): Generated connection does not verify: %s", + nm_device_get_iface (device), error->message); + g_clear_error (&error); + g_object_unref (connection); + return NULL; + } /* Ignore the connection if it has no IP configuration, * no slave configuration, and is not a master interface. |