authd: add address families to provider processing.
ircd knows about them so let's not reinvent checking for address types and stuff.
This commit is contained in:
parent
9b5b2dedc0
commit
f169fc8842
2 changed files with 10 additions and 5 deletions
|
@ -184,7 +184,9 @@ void notice_client(struct auth_client *auth, const char *notice)
|
|||
}
|
||||
|
||||
/* Begin authenticating user */
|
||||
void start_auth(const char *cid, const char *l_ip, const char *l_port, const char *c_ip, const char *c_port)
|
||||
static void start_auth(const char *cid, const char *l_ip, const char *l_port,
|
||||
const char *l_family, const char *c_ip, const char *c_port,
|
||||
const char *c_family)
|
||||
{
|
||||
rb_dlink_node *ptr;
|
||||
struct auth_provider *provider;
|
||||
|
@ -203,9 +205,11 @@ void start_auth(const char *cid, const char *l_ip, const char *l_port, const cha
|
|||
|
||||
rb_strlcpy(auth->l_ip, l_ip, sizeof(auth->l_ip));
|
||||
auth->l_port = (uint16_t)atoi(l_port); /* Safe cast, port shouldn't exceed 16 bits */
|
||||
auth->l_family = atoi(l_family);
|
||||
|
||||
rb_strlcpy(auth->c_ip, c_ip, sizeof(auth->c_ip));
|
||||
auth->c_port = (uint16_t)atoi(c_port);
|
||||
auth->c_family = atoi(c_family);
|
||||
|
||||
RB_DLINK_FOREACH(ptr, auth_providers.head)
|
||||
{
|
||||
|
@ -228,8 +232,8 @@ void start_auth(const char *cid, const char *l_ip, const char *l_port, const cha
|
|||
/* Callback for the initiation */
|
||||
void handle_new_connection(int parc, char *parv[])
|
||||
{
|
||||
if(parc < 5)
|
||||
if(parc < 7)
|
||||
return;
|
||||
|
||||
start_auth(parv[1], parv[2], parv[3], parv[4], parv[5]);
|
||||
start_auth(parv[1], parv[2], parv[3], parv[4], parv[5], parv[6], parv[7]);
|
||||
}
|
||||
|
|
|
@ -24,7 +24,7 @@
|
|||
#include "stdinc.h"
|
||||
|
||||
/* Arbitrary limit */
|
||||
#define MAX_CLIENTS 1024
|
||||
#define MAX_CLIENTS 4096
|
||||
|
||||
/* Registered providers */
|
||||
typedef enum
|
||||
|
@ -41,9 +41,11 @@ struct auth_client
|
|||
|
||||
char l_ip[HOSTIPLEN + 1]; /* Listener IP address */
|
||||
uint16_t l_port; /* Listener port */
|
||||
int l_family; /* AF_INET or AF_INET6 */
|
||||
|
||||
char c_ip[HOSTIPLEN + 1]; /* Client IP address */
|
||||
uint16_t c_port; /* Client port */
|
||||
int c_family; /* AF_INET or AF_INET6 */
|
||||
|
||||
char hostname[IRCD_RES_HOSTLEN + 1]; /* Used for DNS lookup */
|
||||
char username[USERLEN + 1]; /* Used for ident lookup */
|
||||
|
@ -89,7 +91,6 @@ void accept_client(struct auth_client *auth, provider_t provider);
|
|||
|
||||
void notice_client(struct auth_client *auth, const char *notice);
|
||||
|
||||
void start_auth(const char *cid, const char *l_ip, const char *l_port, const char *c_ip, const char *c_port);
|
||||
void handle_new_connection(int parc, char *parv[]);
|
||||
|
||||
/* Provider is operating on this auth_client (set this if you have async work to do) */
|
||||
|
|
Loading…
Reference in a new issue