mirror of
https://github.com/bstansell/conserver.git
synced 2025-04-16 23:18:56 +00:00
fix compiler warning and allow ipv4 cidr notation to work when compiled with ipv6 support
This commit is contained in:
parent
15359cd1f3
commit
0d64aad812
@ -49,7 +49,6 @@
|
||||
# include <netdb.h>
|
||||
#endif
|
||||
|
||||
#if !USE_IPV6
|
||||
/* Compare an Internet address (IPv4 expected), with an address pattern
|
||||
* passed as a character string representing an address in the Internet
|
||||
* standard `.' notation, optionally followed by a slash and an integer
|
||||
@ -120,7 +119,6 @@ AddrCmp(struct in_addr *addr, char *pattern)
|
||||
pattern_addr & netmask, pattern_addr, netmask));
|
||||
return (hostaddr & netmask) != (pattern_addr & netmask);
|
||||
}
|
||||
#endif /* USE_IPV6 */
|
||||
|
||||
/* return the access type for a given host entry (ksb)
|
||||
*/
|
||||
@ -166,6 +164,13 @@ AccType(INADDR_STYPE *addr, char **peername)
|
||||
for (pACtmp = pACList; pACtmp != (ACCESS *)0; pACtmp = pACtmp->pACnext) {
|
||||
CONDDEBUG((1, "AccType(): who=%s, trust=%c", pACtmp->pcwho,
|
||||
pACtmp->ctrust));
|
||||
if (addr->ss_family == AF_INET && pACtmp->isCIDR != 0) {
|
||||
if (AddrCmp(&(((struct sockaddr_in *)addr)->sin_addr), pACtmp->pcwho) == 0) {
|
||||
ret = pACtmp->ctrust;
|
||||
goto common_ret;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
|
||||
if (strstr(ipaddr, pACtmp->pcwho) != NULL) {
|
||||
CONDDEBUG((1, "AccType(): match for ip=%s", ipaddr));
|
||||
|
@ -5102,7 +5102,7 @@ Spawn(GRPENT *pGE, int msfd)
|
||||
hints.ai_flags =
|
||||
AI_PASSIVE | AI_NUMERICHOST | AI_NUMERICSERV;
|
||||
snprintf(serv, sizeof(serv), "%hu",
|
||||
bindBasePort + portInc);
|
||||
(short)(bindBasePort + portInc));
|
||||
error = getaddrinfo(host, serv, &hints, &res);
|
||||
if (error)
|
||||
goto OUT;
|
||||
|
Loading…
x
Reference in New Issue
Block a user