Permalink
Browse files

Fix 'comparison is always false' / 'SIZEOF_SHORT undeclared' in dcc.c

 Patch by: michaelortmann

* Fix 'comparison is always false' / 'SIZEOF_SHORT undeclared' in dcc.c
* forgot src/mod/module.h
  • Loading branch information...
michaelortmann authored and vanosg committed Oct 12, 2018
1 parent 2d1fcc4 commit 5566319df30cfea6afc29a684421e6f8408c9b7b
Showing with 6 additions and 10 deletions.
  1. +1 −5 src/dcc.c
  2. +1 −1 src/mod/module.h
  3. +2 −2 src/mod/transfer.mod/transfer.c
  4. +1 −1 src/net.c
  5. +1 −1 src/proto.h
View
@@ -1250,7 +1250,7 @@ static int detect_telnet_flood(char *floodhost)
static void dcc_telnet(int idx, char *buf, int i)
{
unsigned short port;
uint16_t port;
int j = 0, sock;
if (dcc_total + 1 > max_dcc && increase_socks_max()) {
@@ -1273,11 +1273,7 @@ static void dcc_telnet(int idx, char *buf, int i)
/* Buffer data received on this socket. */
sockoptions(sock, EGG_OPTION_SET, SOCK_BUFFER);
#if (SIZEOF_SHORT == 2)
if (port < 1024) {
#else
if (port < 1024 || port > 65535) {
#endif
putlog(LOG_BOTS, "*", DCC_BADSRC, iptostr(&dcc[i].sockname.addr.sa), port);
killsock(sock);
lostdcc(i);
View
@@ -187,7 +187,7 @@
#define egg_list_append ((int (*) ( struct list_type **, struct list_type *))global[74])
#define egg_list_contains ((int (*) (struct list_type *, struct list_type *))global[75])
/* 76 - 79 */
#define answer ((int (*) (int, sockname_t *, unsigned short *, int))global[76])
#define answer ((int (*) (int, sockname_t *, uint16_t *, int))global[76])
#define getvhost ((void (*) (sockname_t *, int))global[77])
/* was neterror() */
#ifdef TLS
@@ -869,7 +869,7 @@ static void dcc_fork_send(int idx, char *x, int y)
static void dcc_get_pending(int idx, char *buf, int len)
{
unsigned short port;
uint16_t port;
int i;
i = answer(dcc[idx].sock, &dcc[idx].sockname, &port, 1);
@@ -885,7 +885,7 @@ static void dcc_get_pending(int idx, char *buf, int len)
#endif
dcc[idx].sock = i;
dcc[idx].addr = 0;
dcc[idx].port = (int) port;
dcc[idx].port = port;
if (dcc[idx].sock == -1) {
dprintf(DP_HELP, TRANSFER_NOTICE_BAD_CONN, dcc[idx].nick, strerror(errno));
putlog(LOG_FILES, "*", TRANSFER_LOG_BAD_CONN, dcc[idx].u.xfer->origname,
View
@@ -637,7 +637,7 @@ int open_listen(int *port)
* If port is not NULL, it points to an integer to hold the port number
* of the caller.
*/
int answer(int sock, sockname_t *caller, unsigned short *port, int binary)
int answer(int sock, sockname_t *caller, uint16_t *port, int binary)
{
int new_sock;
caller->addrlen = sizeof(caller->addr);
View
@@ -279,7 +279,7 @@ int setsockname(sockname_t *, char *, int, int);
int open_address_listen(sockname_t *);
int open_telnet_raw(int, sockname_t *);
int open_telnet(int, char *, int);
int answer(int, sockname_t *, unsigned short *, int);
int answer(int, sockname_t *, uint16_t *, int);
int getdccaddr(sockname_t *, char *, size_t);
int getdccfamilyaddr(sockname_t *, char *, size_t, int);
void tputs(int, char *, unsigned int);

0 comments on commit 5566319

Please sign in to comment.