diff options
| author | Michael Biebl <biebl@debian.org> | 2020-07-13 22:03:16 +0200 |
|---|---|---|
| committer | Michael Biebl <biebl@debian.org> | 2020-07-13 22:03:16 +0200 |
| commit | 136d191f1c96dbae1489fed7c2565f5e1b1f8d40 (patch) | |
| tree | b219a4d9541be3533b0ea62d99a41828e148e3ef /src/platform/nm-linux-platform.c | |
| parent | 10ae7d8cd706062742d0cdb1803d49909aef9e06 (diff) | |
New upstream version 1.26.0 upstream/1.26.0
Diffstat (limited to 'src/platform/nm-linux-platform.c')
| -rw-r--r-- | src/platform/nm-linux-platform.c | 25 |
1 files changed, 9 insertions, 16 deletions
diff --git a/src/platform/nm-linux-platform.c b/src/platform/nm-linux-platform.c index 710a6f91..fbcc2b31 100644 --- a/src/platform/nm-linux-platform.c +++ b/src/platform/nm-linux-platform.c @@ -3398,6 +3398,7 @@ rta_multipath_done: obj = nmp_object_new (is_v4 ? NMP_OBJECT_TYPE_IP4_ROUTE : NMP_OBJECT_TYPE_IP6_ROUTE, NULL); + obj->ip_route.type_coerced = nm_platform_route_type_coerce (rtm->rtm_type); obj->ip_route.table_coerced = nm_platform_route_table_coerce ( tb[RTA_TABLE] ? nla_get_u32 (tb[RTA_TABLE]) : (guint32) rtm->rtm_table); @@ -7249,7 +7250,7 @@ link_supports_sriov (NMPlatform *platform, int ifindex) nm_auto_pop_netns NMPNetns *netns = NULL; nm_auto_close int dirfd = -1; char ifname[IFNAMSIZ]; - int total = -1; + int num = -1; if (!nm_platform_netns_push (platform, &netns)) return FALSE; @@ -7258,13 +7259,13 @@ link_supports_sriov (NMPlatform *platform, int ifindex) if (dirfd < 0) return FALSE; - total = nm_platform_sysctl_get_int32 (platform, - NMP_SYSCTL_PATHID_NETDIR (dirfd, - ifname, - "device/sriov_totalvfs"), - -1); + num = nm_platform_sysctl_get_int32 (platform, + NMP_SYSCTL_PATHID_NETDIR (dirfd, + ifname, + "device/sriov_numvfs"), + -1); - return total > 0; + return num != -1; } static int @@ -7407,15 +7408,7 @@ link_set_sriov_params_async (NMPlatform *platform, ifname, "device/sriov_totalvfs"), 10, 0, G_MAXUINT, 0); - if (errno) { - g_set_error (&error, - NM_UTILS_ERROR, - NM_UTILS_ERROR_UNKNOWN, - "failed reading sriov_totalvfs value: %s", - nm_strerror_native (errno)); - goto out_idle; - } - if (num_vfs > total) { + if (!errno && num_vfs > total) { _LOGW ("link: %d only supports %u VFs (requested %u)", ifindex, total, num_vfs); num_vfs = total; } |