* Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307
* USA
*
- * $Id: listener.c 3354 2007-04-03 09:21:31Z nenolod $
+ * $Id: listener.c 3460 2007-05-18 20:31:33Z jilles $
*/
#include "stdinc.h"
#include "memory.h"
#include "s_auth.h"
#include "reject.h"
+#include "s_conf.h"
+#include "hostmask.h"
#ifndef INADDR_NONE
#define INADDR_NONE ((unsigned int) 0xffffffff)
* any client list yet.
*/
static void
-add_connection(listener_t *listener, int fd, struct sockaddr *sai)
+add_connection(listener_t *listener, int fd, struct sockaddr *sai, int exempt)
{
struct Client *new_client;
s_assert(NULL != listener);
strlcpy(new_client->host, new_client->sockhost, sizeof(new_client->host));
-#ifdef IPV6
- if(new_client->localClient->ip.ss_family == AF_INET6 && ConfigFileEntry.dot_in_ip6_addr == 1)
- {
- strlcat(new_client->host, ".", sizeof(new_client->host));
- }
-#endif
-
new_client->localClient->fd = fd;
new_client->localClient->listener = listener;
++listener->ref_count;
- if(check_reject(new_client))
- return;
+ if(!exempt)
+ {
+ if(check_reject(new_client))
+ return;
+ if(add_unknown_ip(new_client))
+ return;
+ }
+
start_auth(new_client);
}
/* Do an initial check we aren't connecting too fast or with too many
* from this IP... */
- if((aconf = conf_connect_allowed((struct sockaddr *)&sai, sai.ss_family)) != NULL)
+ aconf = find_dline((struct sockaddr *) &sai, sai.ss_family);
+ /* check it wasn't an exempt */
+ if (aconf != NULL && (aconf->status & CONF_EXEMPTDLINE) == 0)
{
ServerStats->is_ref++;
}
ServerStats->is_ac++;
- add_connection(listener, fd, (struct sockaddr *)&sai);
+ add_connection(listener, fd, (struct sockaddr *)&sai, aconf ? 1 : 0);
/* Re-register a new IO request for the next accept .. */
comm_setselect(listener->fd, FDLIST_SERVICE, COMM_SELECT_READ,