Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 0 additions & 1 deletion src/dcc.c
Original file line number Diff line number Diff line change
Expand Up @@ -1283,7 +1283,6 @@ static void dcc_telnet(int idx, char *buf, int i)
return;
}

dcc[i].u.dns->ip = &dcc[i].sockname;
dcc[i].sock = sock;
dcc[i].port = port;
#ifdef TLS
Expand Down
9 changes: 3 additions & 6 deletions src/dns.c
Original file line number Diff line number Diff line change
Expand Up @@ -146,11 +146,11 @@ static void dns_dcchostbyip(sockname_t *ip, char *hostn, int ok, void *other)
(dcc[idx].u.dns->dns_type == RES_HOSTBYIP) && (
#ifdef IPV6
(ip->family == AF_INET6 &&
IN6_ARE_ADDR_EQUAL(&dcc[idx].u.dns->ip->addr.s6.sin6_addr,
IN6_ARE_ADDR_EQUAL(&dcc[idx].sockname.addr.s6.sin6_addr,
&ip->addr.s6.sin6_addr)) ||
(ip->family == AF_INET &&
#endif
(dcc[idx].u.dns->ip->addr.s4.sin_addr.s_addr ==
(dcc[idx].sockname.addr.s4.sin_addr.s_addr ==
ip->addr.s4.sin_addr.s_addr)))
#ifdef IPV6
)
Expand Down Expand Up @@ -180,10 +180,7 @@ static void dns_dccipbyhost(sockname_t *ip, char *hostn, int ok, void *other)
(dcc[idx].u.dns->dns_type == RES_IPBYHOST) &&
!strcasecmp(dcc[idx].u.dns->host, hostn)) {
if (ok) {
if (dcc[idx].u.dns->ip)
memcpy(dcc[idx].u.dns->ip, ip, sizeof(sockname_t));
else
memcpy(&dcc[idx].sockname, ip, sizeof(sockname_t));
memcpy(&dcc[idx].sockname, ip, sizeof(sockname_t));
dcc[idx].u.dns->dns_success(idx);
} else
dcc[idx].u.dns->dns_failure(idx);
Expand Down
4 changes: 3 additions & 1 deletion src/eggdrop.h
Original file line number Diff line number Diff line change
Expand Up @@ -445,7 +445,9 @@ struct dns_info {
char *cbuf; /* temporary buffer. Memory will be free'd
* as soon as dns_info is free'd */
char *cptr; /* temporary pointer */
sockname_t *ip; /* pointer to sockname with ipv4/6 address */
/* sockname with ipv4/6 address is dcc[i].sockname. we must not link that
* pointer here, because dcc array can be realloced
*/
int ibuf; /* temporary buffer for one integer */
char dns_type; /* lookup type, e.g. RES_HOSTBYIP */
struct dcc_table *type; /* type of the dcc table we are making the
Expand Down
1 change: 0 additions & 1 deletion src/mod/filesys.mod/filesys.c
Original file line number Diff line number Diff line change
Expand Up @@ -674,7 +674,6 @@ static void filesys_dcc_send(char *nick, char *from, struct userrec *u,
}
dcc[i].port = atoi(prt);
(void) setsockname(&dcc[i].sockname, ip, dcc[i].port, 0);
dcc[i].u.dns->ip = &dcc[i].sockname;
dcc[i].sock = -1;
#ifdef TLS
dcc[i].ssl = ssl;
Expand Down
1 change: 0 additions & 1 deletion src/mod/server.mod/server.c
Original file line number Diff line number Diff line change
Expand Up @@ -1923,7 +1923,6 @@ static int ctcp_DCC_CHAT(char *nick, char *from, char *handle,
#endif
dcc[i].port = atoi(prt);
(void) setsockname(&dcc[i].sockname, ip, dcc[i].port, 0);
dcc[i].u.dns->ip = &dcc[i].sockname;
dcc[i].sock = -1;
strcpy(dcc[i].nick, u->handle);
strcpy(dcc[i].host, from);
Expand Down
Loading