vnet: include platform specific un.h 46/40346/4
authorTom Jones <thj@freebsd.org>
Mon, 29 Jan 2024 15:23:23 +0000 (15:23 +0000)
committerDamjan Marion <dmarion@0xa5.net>
Mon, 19 Feb 2024 18:12:06 +0000 (18:12 +0000)
On FreeBSD define UNIX_PATH_MAX so it is available in punt.c. FreeBSD's
max path is 4 bytes shorter than Linux's.

Type: improvement
Change-Id: I2c4b7aa11246213575b557fab44669706885e6b7
Signed-off-by: Tom Jones <thj@freebsd.org>
src/vnet/ip/punt.h

index 09e6e73..e8495ca 100644 (file)
 #ifndef included_punt_h
 #define included_punt_h
 
+#ifdef __linux__
 #include <linux/un.h>
+#elif __FreeBSD__
+#include <sys/un.h>
+#define UNIX_PATH_MAX SUNPATHLEN
+#endif /* __linux__ */
 #include <stdbool.h>
 #include <vnet/ip/ip.h>