]> git.ipfire.org Git - thirdparty/util-linux.git/commitdiff
netlink process_addr(): Ignore UL_NL_SOFT_ERROR
authorStanislav Brabec <sbrabec@suse.cz>
Sun, 5 Oct 2025 00:53:17 +0000 (02:53 +0200)
committerStanislav Brabec <sbrabec@suse.cz>
Sun, 5 Oct 2025 00:56:57 +0000 (02:56 +0200)
UL_NL_SOFT_ERROR can be issued if kernel sends unpaired RTM_DELADDR. It
should not happen, but it can happen due to race condition. And it happened
in some kernel versions. It is not reason to exit the processing loop.

Signed-off-by: Stanislav Brabec <sbrabec@suse.cz>
lib/netlink.c

index f8ac2c4c8bf8cf1d262236d07a1a535ee014fcca..3e58e17da250f1bdfb6eb11130287a1a99a2df63 100644 (file)
@@ -130,7 +130,9 @@ static int process_addr(struct ul_nl_data *nl, struct nlmsghdr *nh)
                nl->addr.ifname = ifname;
        else
        {
-               /* There can be race, we do not return error here */
+               /* There can be race, we do not return error here.
+                * It also happens on RTM_DELADDR, as interface name could
+                * disappear from kernel tables before we process it. */
                /* FIXME I18N: *"unknown"* is too generic. Use context. */
                /* TRANSLATORS: unknown network interface, maximum 15
                 * (IF_NAMESIZE-1) bytes */
@@ -289,7 +291,8 @@ int ul_nl_process(struct ul_nl_data *nl, bool async, bool loop)
                                    ul_debugobj(nl,
                                                "process_msg() returned %d",
                                                rc));
-                               return rc;
+                               if (rc != UL_NL_SOFT_ERROR)
+                                       return rc;
                        }
                }
                if (!loop)