be0c12
From 270e3f46d1fe474eb3b4cd6789520b36a740ef32 Mon Sep 17 00:00:00 2001
be0c12
From: David Tardon <dtardon@redhat.com>
be0c12
Date: Wed, 8 Dec 2021 09:49:24 +0100
be0c12
Subject: [PATCH] Do not fail if the same alt. name is set again
be0c12
be0c12
This is a workaround for a kernel bug.
be0c12
be0c12
RHEL-only
be0c12
be0c12
Related: #2005008
be0c12
---
be0c12
 src/udev/net/link-config.c | 2 +-
be0c12
 1 file changed, 1 insertion(+), 1 deletion(-)
be0c12
be0c12
diff --git a/src/udev/net/link-config.c b/src/udev/net/link-config.c
be0c12
index 5220f247f0..9046c5bd2a 100644
be0c12
--- a/src/udev/net/link-config.c
be0c12
+++ b/src/udev/net/link-config.c
be0c12
@@ -526,7 +526,7 @@ int link_config_apply(link_config_ctx *ctx, link_config *config,
be0c12
         strv_uniq(altnames);
be0c12
         strv_sort(altnames);
be0c12
         r = rtnl_set_link_alternative_names(&ctx->rtnl, ifindex, altnames);
be0c12
-        if (r == -EOPNOTSUPP)
be0c12
+        if (IN_SET(r, -EOPNOTSUPP, -EEXIST))
be0c12
                 log_debug_errno(r, "Could not set AlternativeName= or apply AlternativeNamesPolicy= on %s, ignoring: %m", old_name);
be0c12
         else if (r < 0)
be0c12
                 return log_warning_errno(r, "Could not set AlternativeName= or apply AlternativeNamesPolicy= on %s: %m", old_name);