Commit 67b89aba authored by Ghislain MARY's avatar Ghislain MARY

Do not use anonymous union to prevent compilation errors.

parent f2f27af9
......@@ -31,7 +31,7 @@ typedef struct ortp_recv_addr {
union {
struct in_addr ipi_addr;
struct in6_addr ipi6_addr;
};
} addr;
} ortp_recv_addr_t;
typedef struct msgb
......
......@@ -1070,28 +1070,28 @@ int rtp_session_rtp_recv_abstract(ortp_socket_t socket, mblk_t *msg, int flags,
#ifdef IP_PKTINFO
if ((cmsghdr->cmsg_level == IPPROTO_IP) && (cmsghdr->cmsg_type == IP_PKTINFO)) {
struct in_pktinfo *pi = (struct in_pktinfo *)CMSG_DATA(cmsghdr);
memcpy(&msg->recv_addr.ipi_addr, &pi->ipi_addr, sizeof(msg->recv_addr.ipi_addr));
memcpy(&msg->recv_addr.addr.ipi_addr, &pi->ipi_addr, sizeof(msg->recv_addr.addr.ipi_addr));
msg->recv_addr.family = AF_INET;
}
#endif
#ifdef IPV6_PKTINFO
if ((cmsghdr->cmsg_level == IPPROTO_IPV6) && (cmsghdr->cmsg_type == IPV6_PKTINFO)) {
struct in6_pktinfo *pi = (struct in6_pktinfo *)CMSG_DATA(cmsghdr);
memcpy(&msg->recv_addr.ipi6_addr, &pi->ipi6_addr, sizeof(msg->recv_addr.ipi6_addr));
memcpy(&msg->recv_addr.addr.ipi6_addr, &pi->ipi6_addr, sizeof(msg->recv_addr.addr.ipi6_addr));
msg->recv_addr.family = AF_INET6;
}
#endif
#ifdef IP_RECVDSTADDR
if ((cmsghdr->cmsg_level == IPPROTO_IP) && (cmsghdr->cmsg_type == IP_RECVDSTADDR)) {
struct in_addr *ia = (struct in_addr *)CMSG_DATA(cmsghdr);
memcpy(&msg->recv_addr.ipi_addr, ia, sizeof(msg->recv_addr.ipi_addr));
memcpy(&msg->recv_addr.addr.ipi_addr, ia, sizeof(msg->recv_addr.addr.ipi_addr));
msg->recv_addr.family = AF_INET;
}
#endif
#ifdef IPV6_RECVDSTADDR
if ((cmsghdr->cmsg_level == IPPROTO_IPV6) && (cmsg->cmsg_type == IPV6_RECVDSTADDR)) {
struct in6_addr *ia = (struct in6_addr *)CMSG_DATA(cmsghdr);
memcpy(&msg->recv_addr.ipi6_addr, ia, sizeof(msg->recv_addr.ipi6_addr));
memcpy(&msg->recv_addr.addr.ipi6_addr, ia, sizeof(msg->recv_addr.addr.ipi6_addr));
msg->recv_addr.family = AF_INET6;
}
#endif
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment