return 0;
}
+#ifndef WITH_TCP
+ if (proto != IPPROTO_UDP) {
+ fr_strerror_printf("only UDP is supported");
+ return 0;
+ }
+#endif
+
ps = NULL;
i = start = SOCK2OFFSET(sockfd);
memset(ps, 0, sizeof(*ps));
ps->ctx = ctx;
+#ifdef WITH_TCP
ps->proto = proto;
+#endif
/*
* Get address family, etc. first, so we know if we
*/
RADCLIENT *client_find_old(const fr_ipaddr_t *ipaddr)
{
- return client_find(root_clients, ipaddr
-#ifdef WITH_TCP
- , IPPROTO_UDP
-#endif
- );
+ return client_find(root_clients, ipaddr, IPPROTO_UDP);
}
static struct in_addr cl_ip4addr;
fr_event_fd_delete(el, 0, this->fd);
FD_MUTEX_UNLOCK(&fd_mutex);
+#ifdef WITH_TCP
+ /*
+ * We track requests using this socket only for
+ * TCP. For UDP, we don't currently close
+ * sockets.
+ */
#ifdef WITH_PROXY
if (this->type != RAD_LISTEN_PROXY)
#endif
goto finish;
}
}
-#endif
+#endif /* WITH_PROXY */
+#endif /* WITH_TCP */
/*
* Re-open the socket, pointing it to /dev/null.
*/
}
+#ifdef WITH_TCP
/*
* Called ONLY from the main thread. On the following
* conditions:
*/
listen_free(&this);
}
+#endif /* WITH_TCP */
+
+ return 1;
}
static void handle_signal_self(int flag)
}
#endif
+#ifdef WITH_TCP
#ifdef WITH_PROXY
/*
* Add event handlers for idle timeouts && maximum lifetime.
PTHREAD_MUTEX_UNLOCK(&proxy_mutex);
}
-#endif
+#endif /* WITH_PROXY */
+#endif /* WITH_TCP */
}
#ifdef __MINGW32__