Skip to content

Commit

Permalink
Merge pull request #2160 from jwillemsen/jwi-nonconstcmsgspace
Browse files Browse the repository at this point in the history
Add support for a non const CMSG_SPACE macro, some code is disabled a…
  • Loading branch information
jwillemsen authored Nov 9, 2023
2 parents 527ba77 + c80d23d commit fb48cc3
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
10 changes: 5 additions & 5 deletions ACE/ace/SOCK_Dgram.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -311,12 +311,12 @@ ACE_SOCK_Dgram::recv (iovec iov[],
#define ACE_USE_MSG_CONTROL
union control_buffer {
cmsghdr control_msg_header;
#if defined (IP_RECVDSTADDR)
#if defined (IP_RECVDSTADDR) && !defined (ACE_HAS_NONCONST_CMSG_SPACE)
u_char padding[ACE_CMSG_SPACE (sizeof (in_addr))];
#elif defined (IP_PKTINFO)
#elif defined (IP_PKTINFO) && !defined (ACE_HAS_NONCONST_CMSG_SPACE)
u_char padding[ACE_CMSG_SPACE (sizeof (in_pktinfo))];
#endif
#if defined (ACE_HAS_IPV6)
#if defined (ACE_HAS_IPV6) && !defined (ACE_HAS_NONCONST_CMSG_SPACE)
u_char padding6[ACE_CMSG_SPACE (sizeof (in6_pktinfo))];
#endif
} cbuf;
Expand Down Expand Up @@ -349,7 +349,7 @@ ACE_SOCK_Dgram::recv (iovec iov[],
if (to_addr) {
this->get_local_addr (*to_addr);
if (to_addr->get_type() == AF_INET) {
#if defined (IP_RECVDSTADDR) || defined (IP_PKTINFO)
#if (defined (IP_RECVDSTADDR) || defined (IP_PKTINFO)) && !defined (ACE_HAS_NONCONST_CMSG_SPACE)
for (cmsghdr *ptr = ACE_CMSG_FIRSTHDR (&recv_msg); ptr; ptr = ACE_CMSG_NXTHDR (&recv_msg, ptr)) {
#if defined (IP_RECVDSTADDR)
if (ptr->cmsg_level == IPPROTO_IP && ptr->cmsg_type == IP_RECVDSTADDR) {
Expand All @@ -369,7 +369,7 @@ ACE_SOCK_Dgram::recv (iovec iov[],
}
#endif
}
#if defined (ACE_HAS_IPV6) && defined (IPV6_PKTINFO)
#if defined (ACE_HAS_IPV6) && defined (IPV6_PKTINFO) && !defined (ACE_HAS_NONCONST_CMSG_SPACE)
else if (to_addr->get_type() == AF_INET6) {
for (cmsghdr *ptr = ACE_CMSG_FIRSTHDR (&recv_msg); ptr; ptr = ACE_CMSG_NXTHDR (&recv_msg, ptr)) {
if (ptr->cmsg_level == IPPROTO_IPV6 && ptr->cmsg_type == IPV6_PKTINFO) {
Expand Down
2 changes: 2 additions & 0 deletions ACE/ace/config-qnx.h
Original file line number Diff line number Diff line change
Expand Up @@ -138,6 +138,8 @@
# define ACE_SIZEOF_DOUBLE 8
# define ACE_SIZEOF_FLOAT 4
# define _POSIX_C_SOURCE 199506
#else
# define ACE_HAS_NONCONST_CMSG_SPACE
#endif

#define ACE_LACKS_ISCTYPE
Expand Down

0 comments on commit fb48cc3

Please sign in to comment.