Page MenuHomeFreeBSD

Unbreak on 11.x and 12.x
ClosedPublic

Authored by farrokhi on Jun 6 2017, 9:36 AM.

Details

Summary

Fix build on 11.0 and later due to missing libpcap header file

Diff Detail

Repository
rP FreeBSD ports repository
Lint
Automatic diff as part of commit; lint not applicable.
Unit
Automatic diff as part of commit; unit tests not applicable.

Event Timeline

farrokhi created this revision.Jun 6 2017, 9:36 AM
bapt edited edge metadata.Jul 3 2017, 6:42 PM

I find it weird to include header files like that, newer version of libcap does not provide pcap-int.h, it is probably because it has been replaced by something, there might be a better approach to address this, I'll think about it and come back to you

farrokhi updated this revision to Diff 30391.Jul 4 2017, 6:29 AM

Removed reference to unnecessary header files to unbreak on 11.x and 12.x

Turns out there was a much simpler solution for this build failure. By simply removing reference to "pcap-int.h" (which was not used at all) now this port builds on 10.x, 11.x and 12x just fine.

farrokhi updated this revision to Diff 30392.Jul 4 2017, 7:07 AM

Unbreak on 11.x+ by removing reference to unused header file.

Also fixed an issue with creating RAW sockets which caused failure when tracing TCP/UDP (reported by Andrew Wu <yauhwawu@gmail.com>)

bapt added inline comments.Jul 4 2017, 8:34 AM
net/lft/files/patch-lft__types.h
6 ↗(On Diff #30392)

Maybe just add a && !defined(FreeBSD) which will be less intrusive

farrokhi updated this revision to Diff 30394.Jul 4 2017, 8:40 AM
farrokhi marked an inline comment as done.

Use a less intrusive method to find out if we should include "pcap-int.h"

bapt added inline comments.Jul 4 2017, 8:45 AM
net/lft/files/patch-lft__icmptrace.c
8 ↗(On Diff #30394)

Instead of changing this one, it seems to me more apropriate to modify lft_lib.h line 280 to also add a && !defined(FreeBSD)

net/lft/files/patch-lft__lib.c
8 ↗(On Diff #30394)

The change in lft_lib.h should also make that patch obsolete (needs testing)

farrokhi updated this revision to Diff 30396.Jul 4 2017, 9:07 AM
farrokhi marked 2 inline comments as done.

Improve the logic when detecting when whether or not we should reverse byte order for ip_len and ip_off.

farrokhi added inline comments.Jul 4 2017, 9:08 AM
net/lft/files/patch-lft__icmptrace.c
8 ↗(On Diff #30394)

True. I just adjusted the logic to disable SCREWED_IP_LEN flag if it is being built on FreeBSD so that byte order reversal will be done appropriately.

bapt accepted this revision.Jul 4 2017, 9:34 AM
This revision is now accepted and ready to land.Jul 4 2017, 9:34 AM
This revision was automatically updated to reflect the committed changes.

Be sure to send these upstream as well

Be sure to send these upstream as well

Sure. I just did. Thanks for noting.