summaryrefslogtreecommitdiffhomepage
path: root/lib
diff options
context:
space:
mode:
authorJo-Philipp Wich <jo@mein.io>2025-02-01 15:04:21 +0100
committerJo-Philipp Wich <jo@mein.io>2025-02-01 15:04:21 +0100
commit6f71a35c4cfa3fd600addd0c1eedcd7eba195c2e (patch)
treee2ff692859f02191cde81678adbb4dc9c53c7b39 /lib
parent5b74722408cbfa545396b259b81c3d686fbb9d3d (diff)
rtnl: properly handle runtime exceptions in listener callback
Avoid re-invoking any event listener callbacks after an invocation triggered an exception in order to avoid accidentially clearing the exception information. Signed-off-by: Jo-Philipp Wich <jo@mein.io>
Diffstat (limited to 'lib')
-rw-r--r--lib/rtnl.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/lib/rtnl.c b/lib/rtnl.c
index 6d2c819..f11a653 100644
--- a/lib/rtnl.c
+++ b/lib/rtnl.c
@@ -3612,6 +3612,10 @@ cb_listener_event(struct nl_msg *msg, void *arg)
if (uc_vm_call(vm, true, 1) != EXCEPTION_NONE) {
uloop_end();
+ set_error(NLE_FAILURE, "Runtime exception in callback");
+
+ errno = EINVAL;
+
return NL_STOP;
}
@@ -3631,12 +3635,8 @@ uc_nl_listener_cb(struct uloop_fd *fd, unsigned int events)
nl_recvmsgs_default(nl_conn.evsock);
- if (errno != 0) {
- if (errno != EAGAIN && errno != EWOULDBLOCK)
- set_error(errno, NULL);
-
+ if (errno != 0)
break;
- }
}
}