diff options
author | Tom Gundersen <teg@jklm.no> | 2015-08-20 11:40:10 +0200 |
---|---|---|
committer | Tom Gundersen <teg@jklm.no> | 2015-09-18 15:14:43 +0200 |
commit | b45e4eb679ad0c9a77c4fe6e404c8842d4097fdb (patch) | |
tree | f3e3c5ded72ac5fe0e182452c59a5bd4086d704b /src/libsystemd-network/test-ipv4ll.c | |
parent | 5707940ed31272d44ba2dcf0a74a3024256d2875 (diff) |
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.
Diffstat (limited to 'src/libsystemd-network/test-ipv4ll.c')
-rw-r--r-- | src/libsystemd-network/test-ipv4ll.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/src/libsystemd-network/test-ipv4ll.c b/src/libsystemd-network/test-ipv4ll.c index e7447d322f..55ec2f3972 100644 --- a/src/libsystemd-network/test-ipv4ll.c +++ b/src/libsystemd-network/test-ipv4ll.c @@ -133,7 +133,7 @@ static void test_public_api_setters(sd_event *e) { assert_se(sd_ipv4ll_set_index(ll, 99) == 0); assert_se(sd_ipv4ll_ref(ll) == ll); - assert_se(sd_ipv4ll_unref(ll) == ll); + assert_se(sd_ipv4ll_unref(ll) == NULL); /* Cleanup */ assert_se(sd_ipv4ll_unref(ll) == NULL); |