Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 12 additions & 1 deletion src/network.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -3,8 +3,19 @@
#include "errno.h"

#ifdef __FreeBSD__
#define _KERNEL
// They're under #ifdef _KERNEL.
// I moved them into here to prevent other errors that can occur
// because _KERNEL isn't intended for general purpose usage.
// Taken from netinet6/in6.h and removed comments.
#define IPV6_2292PKTINFO 19
#define IPV6_2292HOPLIMIT 20
#define IPV6_2292NEXTHOP 21
#define IPV6_2292HOPOPTS 22
#define IPV6_2292DSTOPTS 23
#define IPV6_2292RTHDR 24
#define IPV6_2292PKTOPTIONS 25
#endif

#include <netinet/in.h>
#ifdef __FreeBSD__
#undef _KERNEL
Expand Down
8 changes: 8 additions & 0 deletions src/network.h
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,14 @@
#include <netdb.h>
#include "argrewrite.h"

#ifdef __FreeBSD__
// kinda hacky:
// this header re#defines inet_ntop/inet_pton as __inet_ntop
// so while namespace will be incompatible generic way (and we don't need to),
// I don't need to put other crutches.
#include <arpa/inet.h>
#endif

namespace shim {

namespace bionic {
Expand Down