Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Build and run on FreeBSD #5

Merged
merged 1 commit into from
Nov 27, 2019
Merged

Build and run on FreeBSD #5

merged 1 commit into from
Nov 27, 2019

Conversation

rlibby
Copy link
Contributor

@rlibby rlibby commented Nov 25, 2019

An assortment of small changes to build and run on FreeBSD. FreeBSD:

  • Doesn't have IP_PKTINFO, but does have IP_RECVDSTADDR.
  • Doesn't have IP_MULTICAST_ALL (and doesn't need to disable it).
  • Is sensitive about the claimed size of the sockaddr, and has
    sockaddrs with builtin len fields.
  • Doesn't export s6_addr32.

I checked that basic send/receive on a single node works, on Ubuntu Linux and on FreeBSD.

@troglobit
Copy link
Owner

Great stuff! Only thing I'd like to change is the #ifdef __FreeBSD__ to instead look for .sa_len capability so it could work on the other BSDs as well.

In the sysklogd project I added this to a shared header file:

/* BSD have sa_len, Linux/GNU doesn't */
#if defined(_AIX) || (defined(BSD) && (BSD >= 199006)) /* sa_len was added with 4.3-Reno */
#define HAVE_SA_LEN
#endif

An assortment of small changes to build and run on FreeBSD.  FreeBSD:
 - Doesn't have IP_PKTINFO, but does have IP_RECVDSTADDR.
 - Doesn't have IP_MULTICAST_ALL (and doesn't need to disable it).
 - Is sensitive about the claimed size of the sockaddr, and has
   sockaddrs with builtin len fields.
 - Doesn't export s6_addr32.
@rlibby
Copy link
Contributor Author

rlibby commented Nov 26, 2019

Good idea. I added a configure check. Will that do?

@troglobit
Copy link
Owner

Awesome, that works too definitely! :)

Just push it as another commit to your branch and I'll merge the PR.

@rlibby
Copy link
Contributor Author

rlibby commented Nov 26, 2019

Should be there now in 27657e2.

@troglobit troglobit merged commit 828a0fb into troglobit:master Nov 27, 2019
@troglobit
Copy link
Owner

Awesome, great work!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants