authd: fix API boo boo
This commit is contained in:
parent
6da256dc93
commit
34f16c467d
2 changed files with 3 additions and 15 deletions
|
@ -56,6 +56,6 @@ void del_blacklist(const char *host);
|
||||||
void del_blacklist_all(void);
|
void del_blacklist_all(void);
|
||||||
bool set_authd_timeout(const char *key, int timeout);
|
bool set_authd_timeout(const char *key, int timeout);
|
||||||
void ident_check_enable(bool enabled);
|
void ident_check_enable(bool enabled);
|
||||||
bool create_opm_listener(struct rb_sockaddr_storage *addr);
|
bool create_opm_listener(const char *ip, uint16_t port);
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
|
16
ircd/authd.c
16
ircd/authd.c
|
@ -564,20 +564,8 @@ ident_check_enable(bool enabled)
|
||||||
|
|
||||||
/* Create an OPM listener */
|
/* Create an OPM listener */
|
||||||
bool
|
bool
|
||||||
create_opm_listener(struct rb_sockaddr_storage *addr)
|
create_opm_listener(const char *ip, uint16_t port)
|
||||||
{
|
{
|
||||||
char addrbuf[HOSTIPLEN];
|
rb_helper_write(authd_helper, "O opm_listener %s %hu", ip, port);
|
||||||
|
|
||||||
if(!rb_inet_ntop_sock((struct sockaddr *)addr, addrbuf, sizeof(addrbuf)))
|
|
||||||
return false;
|
|
||||||
|
|
||||||
if(addrbuf[0] == ':')
|
|
||||||
{
|
|
||||||
/* Reformat for authd sending */
|
|
||||||
memmove(addrbuf + 1, addrbuf, sizeof(addrbuf) - 1);
|
|
||||||
addrbuf[0] = '0';
|
|
||||||
}
|
|
||||||
|
|
||||||
rb_helper_write(authd_helper, "O opm_listener %s %hu", addrbuf, ntohs(GET_SS_PORT(addr)));
|
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue