From b8a1a68c48849accb658b926f3596857dba41654 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Fri, 10 Feb 2023 09:53:47 +0000 Subject: [PATCH] networkd: Only add link if we created it Signed-off-by: Michael Tremer --- src/networkd/link.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/networkd/link.c b/src/networkd/link.c index b6ece825..32a66cdf 100644 --- a/src/networkd/link.c +++ b/src/networkd/link.c @@ -159,15 +159,15 @@ int nw_link_process(sd_netlink* rtnl, sd_netlink_message* message, void* data) { ERROR("Could not create link: %m\n"); goto ERROR; } + + // Add it to the list + r = nw_links_add_link(links, link); + if (r) + goto ERROR; } // TODO Import any data from the netlink message - // Add it to the list - r = nw_links_add_link(links, link); - if (r) - goto ERROR; - break; case RTM_DELLINK: -- 2.47.3