libteam/SOURCES/libteam-teamd-return-0-if-tdport-doesn-t-exist-in-teamd_conf.patch
2021-09-09 21:04:04 +00:00

53 lines
1.8 KiB
Diff

From 2bf8652cce4303d3ae79dff8bdef10dfae27439b Mon Sep 17 00:00:00 2001
Message-Id: <2bf8652cce4303d3ae79dff8bdef10dfae27439b.1562149639.git.lucien.xin@gmail.com>
From: Xin Long <lucien.xin@gmail.com>
Date: Tue, 2 Jul 2019 19:30:43 +0800
Subject: [PATCH] teamd: return 0 if tdport doesn't exist in
teamd_config_port_set
This issue can be reproduced by doing:
# ip link add dummy1 type dummy
# teamd -t team0 -c '{"runner": {"name": "activebackup"}}' -d
# teamdctl team0 port config update dummy1 '{"prio": -10}'
# ip link set dummy0 master team0
and the error shows:
libteamdctl: usock: Error message received: "ConfigUpdateFail"
libteamdctl: usock: Error message content: "Failed to update config."
command call failed (Invalid argument)
It's a regression caused by Commit c8b356a3cd36 ("teamd: config: update
local prio to kernel") where it requires the tdport has to exist when
a tdport config is being updated. However teamd supports for the port
config going first before the port being enslaved.
This issue breaks how NM-team starts a team device. Here to fix it by
returning 0 even if the tdport doesn't exist in teamd_config_port_set.
Reported-by: Radek Vykydal <rvykydal@redhat.com>
Fixes: c8b356a3cd36 ("teamd: config: update local prio to kernel")
Signed-off-by: Xin Long <lucien.xin@gmail.com>
Signed-off-by: Jiri Pirko <jiri@mellanox.com>
---
teamd/teamd_config.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/teamd/teamd_config.c b/teamd/teamd_config.c
index 34fef1f..1bf85ac 100644
--- a/teamd/teamd_config.c
+++ b/teamd/teamd_config.c
@@ -164,7 +164,7 @@ static int teamd_config_port_set(struct teamd_context *ctx, const char *port_nam
tdport = teamd_get_port_by_ifname(ctx, port_name);
if (!tdport)
- return -ENODEV;
+ return 0;
config = json_object_get(port_obj, "prio");
if (json_is_integer(config)) {
--
2.18.1