From b45e4eb679ad0c9a77c4fe6e404c8842d4097fdb Mon Sep 17 00:00:00 2001 From: Tom Gundersen Date: Thu, 20 Aug 2015 11:40:10 +0200 Subject: sd-ipv4ll: rework callbacks Firstly, no longer distinguish between STOP and INIT states. Secondly, do not trigger STOP events when calls to sd_ipv4ll_*() fail. The caller is the one who would receive the event and will already know that the call to sd_ipv4ll_*() has failed, so it is redundant. STOP events will now only be triggered by calling sd_ipv4ll_stop() explicitly or by some internal error in the library triggered by receiving a packet or an expiring timeout (i.e., any error that would otherwise not be reported back to the consumer of the library). Lastly, follow CODING_STYLE and always return NULL on unref. Protect from objects being destroyed in callbacks accordingly. --- src/network/networkd-ipv4ll.c | 5 +---- 1 file changed, 1 insertion(+), 4 deletions(-) (limited to 'src/network/networkd-ipv4ll.c') diff --git a/src/network/networkd-ipv4ll.c b/src/network/networkd-ipv4ll.c index 0a27a30278..43aaa749ff 100644 --- a/src/network/networkd-ipv4ll.c +++ b/src/network/networkd-ipv4ll.c @@ -195,10 +195,7 @@ static void ipv4ll_handler(sd_ipv4ll *ll, int event, void *userdata){ } break; default: - if (event < 0) - log_link_warning(link, "IPv4 link-local error: %s", strerror(-event)); - else - log_link_warning(link, "IPv4 link-local unknown event: %d", event); + log_link_warning(link, "IPv4 link-local unknown event: %d", event); break; } } -- cgit v1.2.3-54-g00ecf