Source
+ * -------------------------------- IPv4 ----------------------------
diff -urN ../ijb-zlib-11.orig/bind.c ./bind.c
--- ../ijb-zlib-11.orig/bind.c Thu Aug 3 23:38:32 2000
+++ ./bind.c Thu Jan 6 15:39:42 2005
@@ -37,7 +37,7 @@
-#include <gnu_regex.h>
+#include <gnuregex.h>
/* For atoip() */
@@ -45,6 +45,242 @@
long remote_ip_long;
char *remote_ip_str;
+#ifdef HAVE_IPV6
+#ifdef HAVE_POLL
+/*
+ * Do we have the superiour poll() interface?
+ */
+#include <sys/poll.h>
+
+static struct pollfd *b_pfd;
+static int nr_fds;
+#else
+/*
+ * Argh, we've only got the select() interface.
+ */
+#include <sys/select.h>
+
+static fd_set sfd;
+static int max_fd;
+#endif
+
+static int add_fd(fd)
+ int fd;
+{
+#ifdef HAVE_POLL
+ struct pollfd *n;
+ int nr = nr_fds + 1;
+
+ n = realloc(b_pfd, nr * sizeof(*n));
+ if (!n)
+ return -3;
+
+ n[nr_fds].fd = fd;
+ n[nr_fds].events = POLLIN;
+
+ b_pfd = n;
+ nr_fds = nr;
+
+ return 0;
+#else
+ if (fd >= max_fd)
+ max_fd = fd + 1;
+ FD_SET(fd, &sfd);
+ return 0;
+#endif
+}
+
+/*
+ * Bind one port of an address family, specified by `ai'