summaryrefslogtreecommitdiff
path: root/ospf6d/ospf6_message.c
diff options
context:
space:
mode:
Diffstat (limited to 'ospf6d/ospf6_message.c')
-rw-r--r--ospf6d/ospf6_message.c18
1 files changed, 13 insertions, 5 deletions
diff --git a/ospf6d/ospf6_message.c b/ospf6d/ospf6_message.c
index 4830b38a66..eb8c414d9b 100644
--- a/ospf6d/ospf6_message.c
+++ b/ospf6d/ospf6_message.c
@@ -1532,10 +1532,14 @@ int ospf6_receive(struct thread *thread)
struct iovec iovector[2];
struct ospf6_interface *oi;
struct ospf6_header *oh;
+ struct ospf6 *ospf6;
/* add next read thread */
+ ospf6 = THREAD_ARG(thread);
sockfd = THREAD_FD(thread);
- thread_add_read(master, ospf6_receive, NULL, sockfd, NULL);
+
+ thread_add_read(master, ospf6_receive, ospf6, ospf6->fd,
+ &ospf6->t_ospf6_receive);
/* initialize */
memset(&src, 0, sizeof(src));
@@ -1548,7 +1552,7 @@ int ospf6_receive(struct thread *thread)
iovector[1].iov_len = 0;
/* receive message */
- len = ospf6_recvmsg(&src, &dst, &ifindex, iovector);
+ len = ospf6_recvmsg(&src, &dst, &ifindex, iovector, sockfd);
if (len > iobuflen) {
flog_err(EC_LIB_DEVELOPMENT, "Excess message read");
return 0;
@@ -1696,9 +1700,13 @@ static void ospf6_send(struct in6_addr *src, struct in6_addr *dst,
}
/* send message */
- len = ospf6_sendmsg(src, dst, &oi->interface->ifindex, iovector);
- if (len != ntohs(oh->length))
- flog_err(EC_LIB_DEVELOPMENT, "Could not send entire message");
+ if (oi->area->ospf6->fd != -1) {
+ len = ospf6_sendmsg(src, dst, &oi->interface->ifindex, iovector,
+ oi->area->ospf6->fd);
+ if (len != ntohs(oh->length))
+ flog_err(EC_LIB_DEVELOPMENT,
+ "Could not send entire message");
+ }
}
static uint32_t ospf6_packet_max(struct ospf6_interface *oi)