* [PATCH] genl: Call vanished function on error when fetching netlink family info
@ 2014-10-27 12:48 Patrik Flykt
2014-11-15 3:51 ` Denis Kenzior
0 siblings, 1 reply; 2+ messages in thread
From: Patrik Flykt @ 2014-10-27 12:48 UTC (permalink / raw)
To: ell
[-- Attachment #1: Type: text/plain, Size: 1146 bytes --]
If initial information of the netlink family could not be received, call
the registered generic netlink vanished function immediately. The reason
for the error can for example be that the proper kernel module has not
been loaded or the proper functionality has not been compiled in.
---
There does not seem to be any way of communicating an error to the caller,
which now will hang indefinitely waiting for an answer that is not coming.
Thus improvising a bit with the currently unused 'vanished' callback.
Another option is to always require a timer in the calling application.
Cheers,
Patrik
ell/genl.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/ell/genl.c b/ell/genl.c
index 67bde5b..4948d26 100644
--- a/ell/genl.c
+++ b/ell/genl.c
@@ -864,8 +864,11 @@ static void get_family_callback(struct l_genl_msg *msg, void *user_data)
return;
error = l_genl_msg_get_error(msg);
- if (error < 0)
+ if (error < 0) {
+ if (family->watch_vanished)
+ family->watch_vanished(family->watch_data);
return;
+ }
if (!l_genl_attr_init(&attr, msg))
return;
--
2.1.1
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH] genl: Call vanished function on error when fetching netlink family info
2014-10-27 12:48 [PATCH] genl: Call vanished function on error when fetching netlink family info Patrik Flykt
@ 2014-11-15 3:51 ` Denis Kenzior
0 siblings, 0 replies; 2+ messages in thread
From: Denis Kenzior @ 2014-11-15 3:51 UTC (permalink / raw)
To: ell
[-- Attachment #1: Type: text/plain, Size: 908 bytes --]
On 10/27/2014 07:48 AM, Patrik Flykt wrote:
> If initial information of the netlink family could not be received, call
> the registered generic netlink vanished function immediately. The reason
> for the error can for example be that the proper kernel module has not
> been loaded or the proper functionality has not been compiled in.
> ---
>
> There does not seem to be any way of communicating an error to the caller,
> which now will hang indefinitely waiting for an answer that is not coming.
> Thus improvising a bit with the currently unused 'vanished' callback.
> Another option is to always require a timer in the calling application.
>
> Cheers,
>
> Patrik
>
>
> ell/genl.c | 5 ++++-
> 1 file changed, 4 insertions(+), 1 deletion(-)
>
Patch has been applied thanks. I shortened the commit header since that
should ideally be under 50 characters.
Regards,
-Denis
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2014-11-15 3:51 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-27 12:48 [PATCH] genl: Call vanished function on error when fetching netlink family info Patrik Flykt
2014-11-15 3:51 ` Denis Kenzior
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.