isisd: make send_lsp more robust
Signed-off-by: Christian Franke <chris@opensourcerouting.org>
Tested-by: NetDEF CI System <cisystem@netdef.org>
diff --git a/isisd/isis_bpf.c b/isisd/isis_bpf.c
index f6176ef..fd65608 100644
--- a/isisd/isis_bpf.c
+++ b/isisd/isis_bpf.c
@@ -29,6 +29,7 @@
#include <net/bpf.h>
#include "log.h"
+#include "network.h"
#include "stream.h"
#include "if.h"
@@ -339,8 +340,14 @@
/* now we can send this */
written = write (circuit->fd, sock_buff, buflen);
-
- return ISIS_OK;
+ if (written < 0)
+ {
+ zlog_warn("IS-IS bpf: could not transmit packet on %s: %s",
+ circuit->interface->name, safe_strerror(errno));
+ if (ERRNO_IO_RETRY(errno))
+ return ISIS_WARNING;
+ return ISIS_ERROR;
+ }
}
int