1
0
mirror of https://github.com/unrealircd/unrealircd.git synced 2026-07-08 23:03:12 +02:00

Various fixes

This commit is contained in:
codemastr
2003-01-14 21:25:04 +00:00
parent fed61efcdb
commit 3095782cfd
4 changed files with 15 additions and 10 deletions
+1
View File
@@ -1766,3 +1766,4 @@ seen. gmtime warning still there
- Fixed bug #0000601 reported by cate where specifying just a :port number for set::scan::endpoint
caused a seg fault.
- Added some patches by Syzop to fix a variety of different bugs
- Added some bugfixes for IPv6 and others by Syzop
+2
View File
@@ -95,6 +95,7 @@ static inline int match2(char *mask, char *name)
cm = *m;
if (cm == '\\') /* don't do ? checking if a \ */
{
cm = *(++m); /* just skip this char, no ? checking */
}
else if (cm == '?') /* if it's a ? */
@@ -139,6 +140,7 @@ static inline int match2(char *mask, char *name)
if (cm == '\\') /* next char will not be a wildcard. */
{ /* skip wild checking, don't continue */
cm = lc(*(++m));
n++;
}
/* Complicated to read, but to save CPU time. Every ounce counts. */
if (lc(*n) != cm) /* if the current chars don't equal, */
+11 -7
View File
@@ -1155,6 +1155,7 @@ struct hostent *get_res(char *lp,long id)
bcopy((char *)&rptr->cinfo, lp, sizeof(Link));
}
#else
/* WIN32 */
he = rptr->he;
if (he && he->h_name && ((struct IN_ADDR *)he->h_addr)->S_ADDR &&
rptr->locked < 2)
@@ -1367,13 +1368,8 @@ static void update_list(ResRQ *rptr, aCache *cachep)
/*
* Do the same again for IP#'s.
*/
#ifdef INET6
for (s = (char *)HE(rptr)->h_addr.S_ADDR;
((struct IN_ADDR *)s)->S_ADDR; s += sizeof(struct IN_ADDR))
#else
for (s = (char *)&HE(rptr)->h_addr.S_ADDR;
((struct IN_ADDR *)s)->S_ADDR; s += sizeof(struct IN_ADDR))
#endif
WHOSTENTP(((struct IN_ADDR *)s)->S_ADDR); s += sizeof(struct IN_ADDR))
{
#ifdef INET6
for (i = 0; (t = HE(cp)->h_addr_list[i]); i++)
@@ -1403,10 +1399,18 @@ static void update_list(ResRQ *rptr, aCache *cachep)
base = (char **)MyRealloc((char *)ab,
(addrcount + 1) * sizeof(*ab));
HE(cp)->h_addr_list = base;
ab = (struct IN_ADDR **)HE(cp)->h_addr_list; /* Update after realloc -- Syzop */
#ifdef DEBUGMODE
#ifdef INET6
Debug((DEBUG_DNS, "u_l:add IP %s hal %x ac %d",
inet_ntop(((struct IN_ADDR *)s), mydummy,
MYDUMMY_SIZE),
HE(cp)->h_addr_list, addrcount));
#else
Debug((DEBUG_DNS, "u_l:add IP %x hal %x ac %d",
ntohl(((struct IN_ADDR *)s)->S_ADDR),
HE(cp)->h_addr_list, addrcount));
#endif
#endif
for (; addrcount; addrcount--)
{
@@ -1556,7 +1560,7 @@ static aCache *make_cache(ResRQ *rptr)
** shouldn't happen but it just might...
*/
#ifndef _WIN32
if (!rptr->he.h_name || !rptr->he.h_addr.S_ADDR)
if (!rptr->he.h_name || !WHOSTENTP(rptr->he.h_addr.S_ADDR) )
#else
if (!rptr->he->h_name || !((struct IN_ADDR *)rptr->he->h_addr)->S_ADDR)
#endif
+1 -3
View File
@@ -750,8 +750,6 @@ int check_client(aClient *cptr)
if ((i = AllowClient(cptr, hp, sockname)))
{
Debug((DEBUG_DNS, "ch_cl: access denied: %s[%s]",
cptr->name, sockname));
return i;
}
@@ -1856,7 +1854,7 @@ deadsocket:
)
length = read_packet(cptr, &read_set);
#ifdef USE_SSL
if ((cptr->ssl != NULL) &&
if ((length != FLUSH_BUFFER) && (cptr->ssl != NULL) &&
(IsSSLAcceptHandshake(cptr) || IsSSLConnectHandshake(cptr)) &&
FD_ISSET(cptr->fd, &read_set))
{