Opened 4 years ago

Closed 4 years ago

#17551 closed defect (fixed)

net/pfvar.h is not properly detected on OpenBSD

Reported by: rubiate Owned by:
Priority: Medium Milestone: Tor: 0.2.8.x-final
Component: Core Tor/Tor Version:
Severity: Normal Keywords: 027-backport openbsd
Cc: Actual Points:
Parent ID: Points:
Reviewer: Sponsor:

Description

The autoconf test for net/pfvar.h is missing a header to have the test successfully detect it:

    configure:9992: checking for net/pfvar.h
    configure:9992: gcc -std=gnu99 -c -g -O2 -D_FORTIFY_SOURCE=2 -fstack-protector-all -Wstack-protector -fwrapv --param ssp-buffer-size=1 -fPIE -fasynchronous-unwind-tables  -I${top_srcdir}/src/common conftest.c >&5
    In file included from conftest.c:111:
    /usr/include/net/pfvar.h:132: error: field 'v4' has incomplete type
    /usr/include/net/pfvar.h:133: error: field 'v6' has incomplete type
    /usr/include/net/pfvar.h:947: error: field '_pfra_ip4addr' has incomplete type
    /usr/include/net/pfvar.h:948: error: field '_pfra_ip6addr' has incomplete type
    /usr/include/net/pfvar.h:1002: error: field 'sin' has incomplete type
    /usr/include/net/pfvar.h:1003: error: field 'sin6' has incomplete type
    configure:9992: $? = 1
    configure: failed program was:
    ...

It needs netinet/in.h

This is not problem for the port/package as the OpenBSD ports tree infrastructure pre-defines a bunch of variables for headers that it knows exist, including $ac_cv_header_net_pfvar_h, so autoconf uses the cached result there, however it's a problem if manually building from source and not from ports.

As a bonus, the OPENBSD pre-processor macro is only defined if transparent proxy support is enabled, which it isn't when net/pfvar.h can't be detected (the malloc.h warnings was what made me look into this :-) )

Child Tickets

Attachments (1)

pfvar.patch (355 bytes) - added by rubiate 4 years ago.
Add netinet/in.h to net/pfvar.h test

Download all attachments as: .zip

Change History (3)

Changed 4 years ago by rubiate

Attachment: pfvar.patch added

Add netinet/in.h to net/pfvar.h test

comment:1 Changed 4 years ago by nickm

Keywords: 027-backport openbsd added
Milestone: Tor: 0.2.8.x-final
Status: newneeds_review

comment:2 Changed 4 years ago by nickm

Resolution: fixed
Status: needs_reviewclosed

Merged to 0.2.7 and master. Thanks!

Note: See TracTickets for help on using tickets.