$OpenBSD$

Index: ualpn.c
--- ualpn.c.orig
+++ ualpn.c
@@ -25,6 +25,7 @@
 #include <getopt.h>
 #include <grp.h>
 #include <inttypes.h>
+#include <libgen.h>
 #include <limits.h>
 #include <netdb.h>
 #include <netinet/in.h>
@@ -84,6 +85,10 @@
 
 #define MAXHOST 64
 #define MAXSERV 16
+
+#ifndef SOL_TCP
+#define SOL_TCP IPPROTO_TCP
+#endif
 
 #if defined(USE_GNUTLS)
 #if GNUTLS_VERSION_NUMBER < 0x03031e
