summaryrefslogtreecommitdiffstats
path: root/sysdep/linux/netlink/netlink.c
diff options
context:
space:
mode:
authorMartin Mares <mj@ucw.cz>2000-05-08 14:05:55 +0200
committerMartin Mares <mj@ucw.cz>2000-05-08 14:05:55 +0200
commitb6c9d8eb2e255b65f29efd1acfd35a4277b3bf14 (patch)
tree7cfde3426fed8b5a6caeb081b458f3cfd69bf644 /sysdep/linux/netlink/netlink.c
parentd0126f0bf0098104cd99fedd61a4bdbe7f7b3f1f (diff)
downloadbird-b6c9d8eb2e255b65f29efd1acfd35a4277b3bf14.tar
bird-b6c9d8eb2e255b65f29efd1acfd35a4277b3bf14.zip
Removed the `async' switch which was used for debugging only anyway.
Don't moan when netlink reports lost packets.
Diffstat (limited to 'sysdep/linux/netlink/netlink.c')
-rw-r--r--sysdep/linux/netlink/netlink.c23
1 files changed, 17 insertions, 6 deletions
diff --git a/sysdep/linux/netlink/netlink.c b/sysdep/linux/netlink/netlink.c
index 7f66af9..db74413 100644
--- a/sysdep/linux/netlink/netlink.c
+++ b/sysdep/linux/netlink/netlink.c
@@ -768,7 +768,16 @@ nl_async_hook(sock *sk, int size)
x = recvmsg(sk->fd, &m, 0);
if (x < 0)
{
- if (errno != EWOULDBLOCK)
+ if (errno == ENOBUFS)
+ {
+ /*
+ * Netlink reports some packets have been thrown away.
+ * One day we might react to it by asking for route table
+ * scan in near future.
+ */
+ return 1; /* More data are likely to be ready */
+ }
+ else if (errno != EWOULDBLOCK)
log(L_ERR "Netlink recvmsg: %m");
return 0;
}
@@ -800,6 +809,11 @@ nl_open_async(void)
sock *sk;
struct sockaddr_nl sa;
int fd;
+ static int nl_open_tried = 0;
+
+ if (nl_open_tried)
+ return;
+ nl_open_tried = 1;
DBG("KRT: Opening async netlink socket\n");
@@ -859,11 +873,9 @@ krt_scan_postconfig(struct krt_config *x)
void
krt_scan_construct(struct krt_config *x)
{
- x->scan.async = 1;
#ifndef IPV6
x->scan.table_id = RT_TABLE_MAIN;
#endif
- /* FIXME: Use larger defaults for scanning times? */
}
void
@@ -874,8 +886,7 @@ krt_scan_start(struct krt_proto *p, int first)
if (first)
{
nl_open();
- if (KRT_CF->scan.async) /* FIXME: Async is for debugging only. Get rid of it some day. */
- nl_open_async();
+ nl_open_async();
}
}
@@ -888,5 +899,5 @@ void
krt_if_start(struct kif_proto *p)
{
nl_open();
- /* FIXME: nl_open_async() after scan.async is gone */
+ nl_open_async();
}