diff options
author | Thomas Haller <thaller@redhat.com> | 2016-07-05 15:04:37 +0200 |
---|---|---|
committer | Thomas Haller <thaller@redhat.com> | 2016-07-05 23:11:57 +0200 |
commit | e8518b2a37c8b9455130e81467c443932b3ee331 (patch) | |
tree | 445eda49b2c689ee8f03794935bdb491e848a650 /src/platform | |
parent | e81d4f2b643fe99fb480ef4398add115c4f991ea (diff) | |
download | NetworkManager-e8518b2a37c8b9455130e81467c443932b3ee331.tar.gz |
device: tune down warning about failure to set userspace IPv6LL on non-existing device
When a device gets removed externally, we still try to clear userspace IPv6LL address handling.
That fails, due to non-existing device. Such a failure should not be logged as warning.
<debug> [1467723214.2078] device[0x558c59335ca0] (enp0s25): disposing
<debug> [1467723214.2079] device[0x558c59335ca0] (enp0s25): remove_pending_action (0): 'dhcp6' not pending (expected)
<debug> [1467723214.2079] device[0x558c59335ca0] (enp0s25): remove_pending_action (0): 'autoconf6' not pending (expected)
<debug> [1467723214.2079] device[0x558c59335ca0] (enp0s25): will disable userland IPv6LL
<debug> [1467723214.2079] platform-linux: link: change 20: user-ipv6ll: set IPv6 address generation mode to eui64
<trace> [1467723214.2080] platform-linux: delayed-action: schedule wait-for-nl-response (seq 92, timeout in 0.199998611)
<trace> [1467723214.2080] platform-linux: delayed-action: schedule refresh-link (ifindex 20)
<trace> [1467723214.2080] platform-linux: delayed-action: handle refresh-link (ifindex 20)
<debug> [1467723214.2080] platform-linux: do-request-link: 20
<trace> [1467723214.2080] platform-linux: netlink: recvmsg: new message type 2, seq 92
<debug> [1467723214.2080] platform-linux: netlink: recvmsg: error message from kernel: No such device (19) for request 92
<trace> [1467723214.2081] platform-linux: delayed-action: complete wait-for-nl-response (seq 92, timeout in 0.199895684, failure 19 (No such device))
<trace> [1467723214.2081] platform-linux: delayed-action: schedule wait-for-nl-response (seq 93, timeout in 0.199999306)
<trace> [1467723214.2081] platform-linux: delayed-action: handle wait-for-nl-response (any)
<trace> [1467723214.2081] platform-linux: netlink: recvmsg: new message type 2, seq 93
<debug> [1467723214.2081] platform-linux: netlink: recvmsg: error message from kernel: No such device (19) for request 93
<trace> [1467723214.2082] platform-linux: delayed-action: complete wait-for-nl-response (seq 93, timeout in 0.199921142, failure 19 (No such device))
<debug> [1467723214.2082] platform-linux: do-change-link[20]: failure changing link: failure 19 (No such device)
<warn> [1467723214.2082] device (enp0s25): failed to disable userspace IPv6LL address handling
https://bugzilla.redhat.com/show_bug.cgi?id=1323571
Diffstat (limited to 'src/platform')
-rw-r--r-- | src/platform/nm-linux-platform.c | 8 | ||||
-rw-r--r-- | src/platform/nm-platform.c | 13 | ||||
-rw-r--r-- | src/platform/nm-platform.h | 5 |
3 files changed, 13 insertions, 13 deletions
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index 9e98665b72..360670a174 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -4328,7 +4328,7 @@ link_get_udev_device (NMPlatform *platform, int ifindex) return obj_cache ? (GObject *) obj_cache->_link.udev.device : NULL; } -static gboolean +static NMPlatformError link_set_user_ipv6ll_enabled (NMPlatform *platform, int ifindex, gboolean enabled) { nm_auto_nlmsg struct nl_msg *nlmsg = NULL; @@ -4336,7 +4336,7 @@ link_set_user_ipv6ll_enabled (NMPlatform *platform, int ifindex, gboolean enable if (!_support_user_ipv6ll_get ()) { _LOGD ("link: change %d: user-ipv6ll: not supported", ifindex); - return FALSE; + return NM_PLATFORM_ERROR_OPNOTSUPP; } _LOGD ("link: change %d: user-ipv6ll: set IPv6 address generation mode to %s", @@ -4351,9 +4351,9 @@ link_set_user_ipv6ll_enabled (NMPlatform *platform, int ifindex, gboolean enable 0); if ( !nlmsg || !_nl_msg_new_link_set_afspec (nlmsg, mode, NULL)) - g_return_val_if_reached (FALSE); + g_return_val_if_reached (NM_PLATFORM_ERROR_BUG); - return do_change_link (platform, ifindex, nlmsg) == NM_PLATFORM_ERROR_SUCCESS; + return do_change_link (platform, ifindex, nlmsg); } static gboolean diff --git a/src/platform/nm-platform.c b/src/platform/nm-platform.c index fd8e32cb28..75c85b9255 100644 --- a/src/platform/nm-platform.c +++ b/src/platform/nm-platform.c @@ -205,6 +205,7 @@ NM_UTILS_LOOKUP_STR_DEFINE (_nm_platform_error_to_string, NMPlatformError, NM_UTILS_LOOKUP_STR_ITEM (NM_PLATFORM_ERROR_WRONG_TYPE, "wrong-type"), NM_UTILS_LOOKUP_STR_ITEM (NM_PLATFORM_ERROR_NOT_SLAVE, "not-slave"), NM_UTILS_LOOKUP_STR_ITEM (NM_PLATFORM_ERROR_NO_FIRMWARE, "no-firmware"), + NM_UTILS_LOOKUP_STR_ITEM (NM_PLATFORM_ERROR_OPNOTSUPP, "not-supported"), NM_UTILS_LOOKUP_ITEM_IGNORE (_NM_PLATFORM_ERROR_MININT), ); @@ -981,18 +982,16 @@ nm_platform_link_get_user_ipv6ll_enabled (NMPlatform *self, int ifindex) * platform or OS doesn't support changing the IPv6LL address mode, this call * will fail and return %FALSE. * - * Returns: %TRUE if the operation was successful, %FALSE if it failed. + * Returns: %NM_PLATFORM_ERROR_SUCCESS if the operation was successful or an error code otherwise. */ -gboolean +NMPlatformError nm_platform_link_set_user_ipv6ll_enabled (NMPlatform *self, int ifindex, gboolean enabled) { - _CHECK_SELF (self, klass, FALSE); + _CHECK_SELF (self, klass, NM_PLATFORM_ERROR_BUG); - g_return_val_if_fail (ifindex >= 0, FALSE); + g_return_val_if_fail (ifindex > 0, NM_PLATFORM_ERROR_BUG); - if (klass->link_set_user_ipv6ll_enabled) - return klass->link_set_user_ipv6ll_enabled (self, ifindex, enabled); - return FALSE; + return klass->link_set_user_ipv6ll_enabled (self, ifindex, enabled); } /** diff --git a/src/platform/nm-platform.h b/src/platform/nm-platform.h index f2d3ae64d3..c419855a98 100644 --- a/src/platform/nm-platform.h +++ b/src/platform/nm-platform.h @@ -88,6 +88,7 @@ typedef enum { /*< skip >*/ NM_PLATFORM_ERROR_WRONG_TYPE, NM_PLATFORM_ERROR_NOT_SLAVE, NM_PLATFORM_ERROR_NO_FIRMWARE, + NM_PLATFORM_ERROR_OPNOTSUPP, } NMPlatformError; @@ -519,7 +520,7 @@ typedef struct { const char *(*link_get_udi) (NMPlatform *self, int ifindex); GObject *(*link_get_udev_device) (NMPlatform *self, int ifindex); - gboolean (*link_set_user_ipv6ll_enabled) (NMPlatform *, int ifindex, gboolean enabled); + NMPlatformError (*link_set_user_ipv6ll_enabled) (NMPlatform *, int ifindex, gboolean enabled); gboolean (*link_set_token) (NMPlatform *, int ifindex, NMUtilsIPv6IfaceId iid); gboolean (*link_get_permanent_address) (NMPlatform *, @@ -753,7 +754,7 @@ const char *nm_platform_link_get_udi (NMPlatform *self, int ifindex); GObject *nm_platform_link_get_udev_device (NMPlatform *self, int ifindex); -gboolean nm_platform_link_set_user_ipv6ll_enabled (NMPlatform *self, int ifindex, gboolean enabled); +NMPlatformError nm_platform_link_set_user_ipv6ll_enabled (NMPlatform *self, int ifindex, gboolean enabled); gboolean nm_platform_link_set_ipv6_token (NMPlatform *self, int ifindex, NMUtilsIPv6IfaceId iid); gboolean nm_platform_link_get_permanent_address (NMPlatform *self, int ifindex, guint8 *buf, size_t *length); |