Opened 2 years ago

Closed 5 months ago

#192 closed Bug / Defect (fixed)

MacOS X build fails

Reported by: samuli Owned by:
Priority: major Milestone: release 2.3
Component: Building / Compiling Version: 2.2.2
Severity: Not set (if unsure, select this one) Keywords: mac osx build
Cc:

Description

In file syshead.h there is this:

/*
 * Does this platform support linux-style IP_PKTINFO?
 */

#if defined(ENABLE_MULTIHOME) && defined(HAVE_IN_PKTINFO) && defined(IP_PKTINFO) && defined(HAVE_MSGHDR) && defined(HAVE_CMSGHDR) && defined(HAVE_IOVEC) && defined(CMSG_FIRSTHDR) && defined(CMSG_NXTHDR) && defined(HAVE_RECVMSG) && defined(HAVE_SENDMSG)
#define ENABLE_IP_PKTINFO 1
#else
#define ENABLE_IP_PKTINFO 0
#endif


While compiling under MacOS X 10.7 (Lion), this results in ENABLE_IP_PKTINFO = 1
but while compiling socket.c this part fails:

static socket_descriptor_t
create_socket_udp (const unsigned int flags)
{
  socket_descriptor_t sd;

  if ((sd = socket (PF_INET, SOCK_DGRAM, IPPROTO_UDP)) < 0)
    msg (M_SOCKERR, "UDP: Cannot create UDP socket");
#if ENABLE_IP_PKTINFO
  else if (flags & SF_USE_IP_PKTINFO)
    {
      int pad = 1;
      setsockopt (sd, SOL_IP, IP_PKTINFO, (void*)&pad, sizeof(pad));
    }
#endif
  return sd;
}

It fails because IP_PKTINFO is not defined.
In other words ENABLE_IP_PKTINFO should be 0 under MacOS X.
Hardcoding it in syshead.h made the compile issue go away.

Change History (5)

comment:1 Changed 2 years ago by samuli

This bug report was sent via email because the user had issues with Trac authorization.

comment:2 Changed 2 years ago by samuli

  • Version changed from 2.2.1 to 2.2.2

comment:3 Changed 2 years ago by samuli

  • Milestone set to release 2.2.3

comment:4 Changed 20 months ago by dazo

  • Milestone changed from release 2.2.3 to release 2.3

comment:5 Changed 5 months ago by samuli

  • Keywords mac osx build added
  • Resolution set to fixed
  • Status changed from new to closed

OpenVPN builds fine on MacOS X, so this bug was fixed at some point. Closing.

Note: See TracTickets for help on using tickets.