diff options
Diffstat (limited to 'ospf6d/ospf6_network.c')
| -rw-r--r-- | ospf6d/ospf6_network.c | 20 |
1 files changed, 12 insertions, 8 deletions
diff --git a/ospf6d/ospf6_network.c b/ospf6d/ospf6_network.c index 7b1cf91932..2227d03477 100644 --- a/ospf6d/ospf6_network.c +++ b/ospf6d/ospf6_network.c @@ -113,7 +113,7 @@ ospf6_serv_sock (void) /* ospf6 set socket option */ int -ospf6_sso (u_int ifindex, struct in6_addr *group, int option) +ospf6_sso (ifindex_t ifindex, struct in6_addr *group, int option) { struct ipv6_mreq mreq6; int ret; @@ -193,19 +193,23 @@ iov_totallen (struct iovec *iov) int ospf6_sendmsg (struct in6_addr *src, struct in6_addr *dst, - unsigned int *ifindex, struct iovec *message) + ifindex_t *ifindex, struct iovec *message) { int retval; struct msghdr smsghdr; struct cmsghdr *scmsgp; - u_char cmsgbuf[CMSG_SPACE(sizeof (struct in6_pktinfo))]; + union + { + struct cmsghdr hdr; + u_char buf[CMSG_SPACE (sizeof (struct in6_pktinfo))]; + } cmsgbuf; struct in6_pktinfo *pktinfo; struct sockaddr_in6 dst_sin6; assert (dst); assert (*ifindex); - scmsgp = (struct cmsghdr *)cmsgbuf; + scmsgp = (struct cmsghdr *)&cmsgbuf; pktinfo = (struct in6_pktinfo *)(CMSG_DATA(scmsgp)); memset (&dst_sin6, 0, sizeof (struct sockaddr_in6)); @@ -222,7 +226,7 @@ ospf6_sendmsg (struct in6_addr *src, struct in6_addr *dst, dst_sin6.sin6_len = sizeof (struct sockaddr_in6); #endif /*SIN6_LEN*/ memcpy (&dst_sin6.sin6_addr, dst, sizeof (struct in6_addr)); -#ifdef HAVE_SIN6_SCOPE_ID +#ifdef HAVE_STRUCT_SOCKADDR_IN6_SIN6_SCOPE_ID dst_sin6.sin6_scope_id = *ifindex; #endif @@ -238,8 +242,8 @@ ospf6_sendmsg (struct in6_addr *src, struct in6_addr *dst, smsghdr.msg_iovlen = iov_count (message); smsghdr.msg_name = (caddr_t) &dst_sin6; smsghdr.msg_namelen = sizeof (struct sockaddr_in6); - smsghdr.msg_control = (caddr_t) cmsgbuf; - smsghdr.msg_controllen = scmsgp->cmsg_len; + smsghdr.msg_control = (caddr_t) &cmsgbuf.buf; + smsghdr.msg_controllen = sizeof(cmsgbuf.buf); retval = sendmsg (ospf6_sock, &smsghdr, 0); if (retval != iov_totallen (message)) @@ -251,7 +255,7 @@ ospf6_sendmsg (struct in6_addr *src, struct in6_addr *dst, int ospf6_recvmsg (struct in6_addr *src, struct in6_addr *dst, - unsigned int *ifindex, struct iovec *message) + ifindex_t *ifindex, struct iovec *message) { int retval; struct msghdr rmsghdr; |
