summaryrefslogtreecommitdiff
path: root/sysdep/linux/netlink.c
diff options
context:
space:
mode:
authorJan Moskyto Matejka <mq@ucw.cz>2016-09-29 12:00:53 +0200
committerJan Moskyto Matejka <mq@ucw.cz>2016-09-29 13:21:16 +0200
commitccd2a3eda24230df550e9880f4340fc6341c8f52 (patch)
treeab5d5e0944c68b7c30ae34daade8947dddee322c /sysdep/linux/netlink.c
parent79e2293ab2abbd92bb3326a95759a4ca32d9af81 (diff)
Kernel socket missing err_hook fix
Thanks to Tim Weippert for bugreport.
Diffstat (limited to 'sysdep/linux/netlink.c')
-rw-r--r--sysdep/linux/netlink.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/sysdep/linux/netlink.c b/sysdep/linux/netlink.c
index 1490213e..79dd1405 100644
--- a/sysdep/linux/netlink.c
+++ b/sysdep/linux/netlink.c
@@ -1526,6 +1526,12 @@ nl_async_hook(sock *sk, int size UNUSED)
}
static void
+nl_async_err_hook(sock *sk, int e UNUSED)
+{
+ nl_async_hook(sk, 0);
+}
+
+static void
nl_open_async(void)
{
sock *sk;
@@ -1563,6 +1569,7 @@ nl_open_async(void)
sk = nl_async_sk = sk_new(krt_pool);
sk->type = SK_MAGIC;
sk->rx_hook = nl_async_hook;
+ sk->err_hook = nl_async_err_hook;
sk->fd = fd;
if (sk_open(sk) < 0)
bug("Netlink: sk_open failed");