On Thu, Sep 29, 2016 at 01:33:48PM +0200, Julien Sansonnens wrote:
> Hi list,
> 
> I'm using bird 1.6.1 on debian Jessie.
> For some reason (COULD be related to updating to 1.6.1, but not sure),
> bird6 is not working anymore. It used to work some weeks ago.

Does attached patch fix it?

-- 
Elen sila lumenn' omentielvo

Ondrej 'Santiago' Zajicek (email: santi...@crfreenet.org)
OpenPGP encrypted e-mails preferred (KeyID 0x11DEADC3, wwwkeys.pgp.net)
"To err is human -- to blame it on a computer is even more so."
Signed-off-by: Jan Moskyto Matejka <m...@ucw.cz>
---
 sysdep/bsd/krt-sock.c  | 7 +++++++
 sysdep/linux/netlink.c | 7 +++++++
 sysdep/unix/io.c       | 2 +-
 3 files changed, 15 insertions(+), 1 deletion(-)

diff --git a/sysdep/bsd/krt-sock.c b/sysdep/bsd/krt-sock.c
index 6ff3b2b..f2ae81c 100644
--- a/sysdep/bsd/krt-sock.c
+++ b/sysdep/bsd/krt-sock.c
@@ -911,6 +911,12 @@ krt_sock_hook(sock *sk, int size UNUSED)
   return 0;
 }
 
+static void
+krt_sock_err_hook(sock *sk, int e UNUSED)
+{
+  krt_sock_hook(sk, 0);
+}
+
 static sock *
 krt_sock_open(pool *pool, void *data, int table_id)
 {
@@ -932,6 +938,7 @@ krt_sock_open(pool *pool, void *data, int table_id)
   sk = sk_new(pool);
   sk->type = SK_MAGIC;
   sk->rx_hook = krt_sock_hook;
+  sk->err_hook = krt_sock_err_hook;
   sk->fd = fd;
   sk->data = data;
 
diff --git a/sysdep/linux/netlink.c b/sysdep/linux/netlink.c
index 1490213..79dd140 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");
diff --git a/sysdep/unix/io.c b/sysdep/unix/io.c
index 120eb90..3ceadd9 100644
--- a/sysdep/unix/io.c
+++ b/sysdep/unix/io.c
@@ -1857,7 +1857,7 @@ void
 sk_err(sock *s, int revents)
 {
   int se = 0, sse = sizeof(se);
-  if (revents & POLLERR)
+  if ((s->type != SK_MAGIC) && (revents & POLLERR))
     if (getsockopt(s->fd, SOL_SOCKET, SO_ERROR, &se, &sse) < 0)
     {
       log(L_ERR "IO: Socket error: SO_ERROR: %m");
-- 
2.9.3

Attachment: signature.asc
Description: Digital signature

Reply via email to