Opened 7 years ago

Closed 7 years ago

#1284 closed defect (fixed)

Build failure if defined IP_PKTINFO but missing ipi_spec_dst in struct in_pktinfo

Reported by: OBATA Akio Owned by:
Priority: minor Milestone:
Component: other Version:
Keywords: Cc:
uname -a: NetBSD 7.1 i386
nginx -V: 1.13.0

Description

In ngx_sendmsg() of src/os/unix/ngx_udp_sendmsg_chain.c,
if IP_PKTINFO is available for setsockopt (NGX_HAVE_PKTINFO),
in_pktinfo.ipi_spec_dst is used unconditionally.

But it is missing for NetBSD-7.1, so I cannot build nginx-1.13.0.

Attachments (1)

pktinfo (950 bytes ) - added by Roman Arutyunyan 7 years ago.

Download all attachments as: .zip

Change History (6)

comment:1 by Roman Arutyunyan, 7 years ago

Thanks for reporting this.
Please try the attached patch.

by Roman Arutyunyan, 7 years ago

Attachment: pktinfo added

comment:2 by OBATA Akio, 7 years ago

Yes, it resolve the build failure, but NGX_HAVE_IP_PKTINFO is also used in other places without using in_pktinfo.ipi_spec_dst.

From manual of NetBSD ip(4) and Windows Sockets 2 (used on Cygwin), ipi_addr member of
in_pktinfo is usable for both source and destnation depending on its usage.

comment:3 by Roman Arutyunyan, 7 years ago

As for NetBSD, the manual seems to be wrong.
IP_PKTINFO is in fact only supported for recvmsg().

http://gnats.netbsd.org/48280

comment:4 by Roman Arutyunyan, 7 years ago

comment:5 by Roman Arutyunyan, 7 years ago

Resolution: fixed
Status: newclosed
Note: See TracTickets for help on using tickets.