dryang / rpms / systemd

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