More patches to build without certain features
[freeradius.git] / src / main / listen.c
index 92c6fde..1f40ead 100644 (file)
@@ -884,6 +884,7 @@ static int common_socket_parse(CONF_SECTION *cs, rad_listen_t *this)
        sock->my_ipaddr = ipaddr;
        sock->my_port = listen_port;
 
+#ifdef WITH_PROXY
        if (check_config) {
                if (home_server_find(&sock->my_ipaddr, sock->my_port, sock->proto)) {
                                char buffer[128];
@@ -896,6 +897,7 @@ static int common_socket_parse(CONF_SECTION *cs, rad_listen_t *this)
 
                return 0;       /* don't do anything */
        }
+#endif
 
        /*
         *      If we can bind to interfaces, do so,
@@ -2445,6 +2447,7 @@ static rad_listen_t *listen_parse(CONF_SECTION *cs, const char *server)
        return this;
 }
 
+#ifdef WITH_PROXY
 static int is_loopback(const fr_ipaddr_t *ipaddr)
 {
        /*
@@ -2464,6 +2467,7 @@ static int is_loopback(const fr_ipaddr_t *ipaddr)
 
        return 0;
 }
+#endif
 
 /*
  *     Generate a list of listeners.  Takes an input list of
@@ -2844,8 +2848,11 @@ RADCLIENT_LIST *listener_find_client_list(const fr_ipaddr_t *ipaddr,
        for (this = mainconfig.listen; this != NULL; this = this->next) {
                listen_socket_t *sock;
 
-               if ((this->type != RAD_LISTEN_AUTH) &&
-                   (this->type != RAD_LISTEN_ACCT)) continue;
+               if ((this->type != RAD_LISTEN_AUTH)
+#ifdef WITH_ACCOUNTING
+                   && (this->type != RAD_LISTEN_ACCT)
+#endif
+                   ) continue;
                
                sock = this->data;
 
@@ -2870,8 +2877,11 @@ rad_listen_t *listener_find_byipaddr(const fr_ipaddr_t *ipaddr, int port)
                 *      FIXME: For TCP, ignore the *secondary*
                 *      listeners associated with the main socket.
                 */
-               if ((this->type != RAD_LISTEN_AUTH) &&
-                   (this->type != RAD_LISTEN_ACCT)) continue;
+               if ((this->type != RAD_LISTEN_AUTH)
+#ifdef WITH_ACCOUNTING
+                   && (this->type != RAD_LISTEN_ACCT)
+#endif
+                   ) continue;
                
                sock = this->data;