mirror of
https://git.proxmox.com/git/mirror_frr
synced 2025-08-14 14:05:31 +00:00
commit
5cc78f91b6
@ -1701,7 +1701,7 @@ static void ospf6_send(struct in6_addr *src, struct in6_addr *dst,
|
|||||||
|
|
||||||
/* send message */
|
/* send message */
|
||||||
if (oi->area->ospf6->fd != -1) {
|
if (oi->area->ospf6->fd != -1) {
|
||||||
len = ospf6_sendmsg(src, dst, &oi->interface->ifindex, iovector,
|
len = ospf6_sendmsg(src, dst, oi->interface->ifindex, iovector,
|
||||||
oi->area->ospf6->fd);
|
oi->area->ospf6->fd);
|
||||||
if (len != ntohs(oh->length))
|
if (len != ntohs(oh->length))
|
||||||
flog_err(EC_LIB_DEVELOPMENT,
|
flog_err(EC_LIB_DEVELOPMENT,
|
||||||
|
@ -171,7 +171,7 @@ static int iov_totallen(struct iovec *iov)
|
|||||||
}
|
}
|
||||||
|
|
||||||
int ospf6_sendmsg(struct in6_addr *src, struct in6_addr *dst,
|
int ospf6_sendmsg(struct in6_addr *src, struct in6_addr *dst,
|
||||||
ifindex_t *ifindex, struct iovec *message, int ospf6_sock)
|
ifindex_t ifindex, struct iovec *message, int ospf6_sock)
|
||||||
{
|
{
|
||||||
int retval;
|
int retval;
|
||||||
struct msghdr smsghdr;
|
struct msghdr smsghdr;
|
||||||
@ -184,7 +184,6 @@ int ospf6_sendmsg(struct in6_addr *src, struct in6_addr *dst,
|
|||||||
struct sockaddr_in6 dst_sin6;
|
struct sockaddr_in6 dst_sin6;
|
||||||
|
|
||||||
assert(dst);
|
assert(dst);
|
||||||
assert(*ifindex);
|
|
||||||
|
|
||||||
memset(&cmsgbuf, 0, sizeof(cmsgbuf));
|
memset(&cmsgbuf, 0, sizeof(cmsgbuf));
|
||||||
scmsgp = (struct cmsghdr *)&cmsgbuf;
|
scmsgp = (struct cmsghdr *)&cmsgbuf;
|
||||||
@ -192,7 +191,7 @@ int ospf6_sendmsg(struct in6_addr *src, struct in6_addr *dst,
|
|||||||
memset(&dst_sin6, 0, sizeof(struct sockaddr_in6));
|
memset(&dst_sin6, 0, sizeof(struct sockaddr_in6));
|
||||||
|
|
||||||
/* source address */
|
/* source address */
|
||||||
pktinfo->ipi6_ifindex = *ifindex;
|
pktinfo->ipi6_ifindex = ifindex;
|
||||||
if (src)
|
if (src)
|
||||||
memcpy(&pktinfo->ipi6_addr, src, sizeof(struct in6_addr));
|
memcpy(&pktinfo->ipi6_addr, src, sizeof(struct in6_addr));
|
||||||
else
|
else
|
||||||
@ -204,7 +203,7 @@ int ospf6_sendmsg(struct in6_addr *src, struct in6_addr *dst,
|
|||||||
dst_sin6.sin6_len = sizeof(struct sockaddr_in6);
|
dst_sin6.sin6_len = sizeof(struct sockaddr_in6);
|
||||||
#endif /*SIN6_LEN*/
|
#endif /*SIN6_LEN*/
|
||||||
memcpy(&dst_sin6.sin6_addr, dst, sizeof(struct in6_addr));
|
memcpy(&dst_sin6.sin6_addr, dst, sizeof(struct in6_addr));
|
||||||
dst_sin6.sin6_scope_id = *ifindex;
|
dst_sin6.sin6_scope_id = ifindex;
|
||||||
|
|
||||||
/* send control msg */
|
/* send control msg */
|
||||||
scmsgp->cmsg_level = IPPROTO_IPV6;
|
scmsgp->cmsg_level = IPPROTO_IPV6;
|
||||||
@ -223,7 +222,8 @@ int ospf6_sendmsg(struct in6_addr *src, struct in6_addr *dst,
|
|||||||
|
|
||||||
retval = sendmsg(ospf6_sock, &smsghdr, 0);
|
retval = sendmsg(ospf6_sock, &smsghdr, 0);
|
||||||
if (retval != iov_totallen(message))
|
if (retval != iov_totallen(message))
|
||||||
zlog_warn("sendmsg failed: ifindex: %d: %s (%d)", *ifindex,
|
zlog_warn("sendmsg failed: source: %pI6 Dest: %pI6 ifindex: %d: %s (%d)",
|
||||||
|
src, dst, ifindex,
|
||||||
safe_strerror(errno), errno);
|
safe_strerror(errno), errno);
|
||||||
|
|
||||||
return retval;
|
return retval;
|
||||||
|
@ -28,9 +28,11 @@ extern int ospf6_serv_sock(struct ospf6 *ospf6);
|
|||||||
extern void ospf6_serv_close(int *ospf6_sock);
|
extern void ospf6_serv_close(int *ospf6_sock);
|
||||||
extern int ospf6_sso(ifindex_t ifindex, struct in6_addr *group, int option);
|
extern int ospf6_sso(ifindex_t ifindex, struct in6_addr *group, int option);
|
||||||
|
|
||||||
extern int ospf6_sendmsg(struct in6_addr *, struct in6_addr *, ifindex_t *,
|
extern int ospf6_sendmsg(struct in6_addr *src, struct in6_addr *dst,
|
||||||
struct iovec *, int ospf6_sock);
|
ifindex_t ifindex, struct iovec *message,
|
||||||
extern int ospf6_recvmsg(struct in6_addr *, struct in6_addr *, ifindex_t *,
|
int ospf6_sock);
|
||||||
struct iovec *, int ospf6_sock);
|
extern int ospf6_recvmsg(struct in6_addr *src, struct in6_addr *dst,
|
||||||
|
ifindex_t *ifindex, struct iovec *message,
|
||||||
|
int ospf6_sock);
|
||||||
|
|
||||||
#endif /* OSPF6_NETWORK_H */
|
#endif /* OSPF6_NETWORK_H */
|
||||||
|
Loading…
Reference in New Issue
Block a user