diff --git a/include/h.h b/include/h.h index fd1efc25d..8c527ca41 100644 --- a/include/h.h +++ b/include/h.h @@ -203,7 +203,7 @@ extern void reset_help(); extern MODVAR char *debugmode, *configfile, *sbrk0; extern char *getfield(char *); -extern void get_sockhost(aClient *, char *); +extern void set_sockhost(aClient *, char *); #ifndef _WIN32 extern char *strerror(int); #else diff --git a/src/modules/m_server.c b/src/modules/m_server.c index 3c2e76be2..b26bdaf69 100644 --- a/src/modules/m_server.c +++ b/src/modules/m_server.c @@ -161,7 +161,7 @@ ConfigItem_ban *bconf; * Perhaps a bit late to do it here, but does anyone care? */ if (cptr->local->hostp && cptr->local->hostp->h_name) - get_sockhost(cptr, cptr->local->hostp->h_name); + set_sockhost(cptr, cptr->local->hostp->h_name); if (link_out) *link_out = NULL; diff --git a/src/s_bsd.c b/src/s_bsd.c index 1de092d05..99af8750a 100644 --- a/src/s_bsd.c +++ b/src/s_bsd.c @@ -1156,7 +1156,7 @@ add_con_refuse: report_error("Failed to accept new client %s (could not get ip): %s", acptr); goto add_con_refuse; } - get_sockhost(acptr, s); + set_sockhost(acptr, s); acptr->ip = strdup(s); /* Tag loopback connections as FLAGS_LOCAL */ @@ -1652,7 +1652,7 @@ int connect_server(ConfigItem_link *aconf, aClient *by, struct hostent *hp) SetOutgoing(cptr); IRCstats.unknown++; list_add(&cptr->lclient_node, &unknown_list); - get_sockhost(cptr, aconf->outgoing.hostname); + set_sockhost(cptr, aconf->outgoing.hostname); add_client_to_list(cptr); if (aconf->outgoing.options & CONNECT_SSL) @@ -1697,7 +1697,7 @@ static struct SOCKADDR *connect_inet(ConfigItem_link *aconf, aClient *cptr, int } mysk.SIN_PORT = 0; - get_sockhost(cptr, aconf->outgoing.hostname); + set_sockhost(cptr, aconf->outgoing.hostname); if (!aconf->outgoing.bind_ip && iConf.link_bindip) bindip = iConf.link_bindip; diff --git a/src/s_conf.c b/src/s_conf.c index b6dfe22e1..fc48ddfa9 100644 --- a/src/s_conf.c +++ b/src/s_conf.c @@ -2783,7 +2783,7 @@ int AllowClient(aClient *cptr, struct hostent *hp, char *sockhost, char *usernam strlcpy(uhost, fullname, sizeof(uhost)); else strlcpy(uhost, sockhost, sizeof(uhost)); - get_sockhost(cptr, uhost); + set_sockhost(cptr, uhost); #ifdef INET6 is_ipv4 = IN6_IS_ADDR_V4MAPPED(&cptr->local->ip); #endif /* INET6 */ diff --git a/src/s_misc.c b/src/s_misc.c index 2a1cacece..02cbacee4 100644 --- a/src/s_misc.c +++ b/src/s_misc.c @@ -379,10 +379,9 @@ char *get_client_host(aClient *cptr) } /* - * Form sockhost such that if the host is of form user@host, only the host - * portion is copied. + * Set sockhost to 'host'. Skip the user@ part of 'host' if necessary. */ -void get_sockhost(aClient *cptr, char *host) +void set_sockhost(aClient *cptr, char *host) { char *s; if ((s = (char *)index(host, '@')))