All of lore.kernel.org
 help / color / mirror / Atom feed
* Re: [PATCH 1/3] acd: Emit event as the last statement in handler
@ 2022-06-13 16:33 Denis Kenzior
  0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2022-06-13 16:33 UTC (permalink / raw)
  To: ell

[-- Attachment #1: Type: text/plain, Size: 341 bytes --]

Hi Andrew,

On 6/10/22 20:45, Andrew Zaborowski wrote:
> Move l_acd_stop() to before the call to the event handler for
> L_ACD_EVENT_LOST to allow the handler to free the l_acd instance if
> needed.
> ---
>   ell/acd.c | 8 ++++----
>   1 file changed, 4 insertions(+), 4 deletions(-)
> 

All applied, thanks.

Regards,
-Denis

^ permalink raw reply	[flat|nested] 2+ messages in thread

* [PATCH 1/3] acd: Emit event as the last statement in handler
@ 2022-06-11  1:45 Andrew Zaborowski
  0 siblings, 0 replies; 2+ messages in thread
From: Andrew Zaborowski @ 2022-06-11  1:45 UTC (permalink / raw)
  To: ell

[-- Attachment #1: Type: text/plain, Size: 1188 bytes --]

Move l_acd_stop() to before the call to the event handler for
L_ACD_EVENT_LOST to allow the handler to free the l_acd instance if
needed.
---
 ell/acd.c | 8 ++++----
 1 file changed, 4 insertions(+), 4 deletions(-)

diff --git a/ell/acd.c b/ell/acd.c
index 2d84843..723ae17 100644
--- a/ell/acd.c
+++ b/ell/acd.c
@@ -317,12 +317,12 @@ static bool acd_read_handler(struct l_io *io, void *user_data)
 		if (acd->policy == L_ACD_DEFEND_POLICY_NONE) {
 			ACD_DEBUG("Conflict detected, giving up address");
 
+			l_acd_stop(acd);
+
 			if (acd->event_func)
 				acd->event_func(L_ACD_EVENT_LOST,
 							acd->user_data);
 
-			l_acd_stop(acd);
-
 			break;
 		}
 
@@ -387,6 +387,8 @@ static bool acd_read_handler(struct l_io *io, void *user_data)
 		acd->timeout = NULL;
 
 		ACD_DEBUG("Lost address");
+		l_acd_stop(acd);
+
 		/*
 		* RFC 5227 Section 2.4(b)
 		* "if this is not the first conflicting ARP packet the host has seen,
@@ -398,8 +400,6 @@ static bool acd_read_handler(struct l_io *io, void *user_data)
 		if (acd->event_func)
 			acd->event_func(L_ACD_EVENT_LOST, acd->user_data);
 
-		l_acd_stop(acd);
-
 		break;
 	}
 
-- 
2.34.1

^ permalink raw reply related	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2022-06-13 16:33 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-13 16:33 [PATCH 1/3] acd: Emit event as the last statement in handler Denis Kenzior
  -- strict thread matches above, loose matches on Subject: below --
2022-06-11  1:45 Andrew Zaborowski

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.