Fix some compiler and cppcheck warnings.
This commit is contained in:
parent
809dfd2f5b
commit
2bda2aa885
2 changed files with 5 additions and 11 deletions
|
@ -56,7 +56,6 @@
|
||||||
#include "xalloc.h"
|
#include "xalloc.h"
|
||||||
|
|
||||||
int keylifetime = 0;
|
int keylifetime = 0;
|
||||||
static int keyexpires = 0;
|
|
||||||
#ifdef HAVE_LZO
|
#ifdef HAVE_LZO
|
||||||
static char lzo_wrkmem[LZO1X_999_MEM_COMPRESS > LZO1X_1_MEM_COMPRESS ? LZO1X_999_MEM_COMPRESS : LZO1X_1_MEM_COMPRESS];
|
static char lzo_wrkmem[LZO1X_999_MEM_COMPRESS > LZO1X_1_MEM_COMPRESS ? LZO1X_999_MEM_COMPRESS : LZO1X_1_MEM_COMPRESS];
|
||||||
#endif
|
#endif
|
||||||
|
@ -255,7 +254,6 @@ static void receive_udppacket(node_t *n, vpn_packet_t *inpkt) {
|
||||||
int nextpkt = 0;
|
int nextpkt = 0;
|
||||||
vpn_packet_t *outpkt = pkt[0];
|
vpn_packet_t *outpkt = pkt[0];
|
||||||
size_t outlen;
|
size_t outlen;
|
||||||
int i;
|
|
||||||
|
|
||||||
if(!cipher_active(&n->incipher)) {
|
if(!cipher_active(&n->incipher)) {
|
||||||
ifdebug(TRAFFIC) logger(LOG_DEBUG, "Got packet from %s (%s) but he hasn't got our key yet",
|
ifdebug(TRAFFIC) logger(LOG_DEBUG, "Got packet from %s (%s) but he hasn't got our key yet",
|
||||||
|
@ -318,7 +316,7 @@ static void receive_udppacket(node_t *n, vpn_packet_t *inpkt) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
for(i = n->received_seqno + 1; i < inpkt->seqno; i++)
|
for(int i = n->received_seqno + 1; i < inpkt->seqno; i++)
|
||||||
n->late[(i / 8) % replaywin] |= 1 << i % 8;
|
n->late[(i / 8) % replaywin] |= 1 << i % 8;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@ -378,12 +376,12 @@ static void send_udppacket(node_t *n, vpn_packet_t *origpkt) {
|
||||||
vpn_packet_t *inpkt = origpkt;
|
vpn_packet_t *inpkt = origpkt;
|
||||||
int nextpkt = 0;
|
int nextpkt = 0;
|
||||||
vpn_packet_t *outpkt;
|
vpn_packet_t *outpkt;
|
||||||
int origlen;
|
int origlen = origpkt->len;
|
||||||
size_t outlen;
|
size_t outlen;
|
||||||
#if defined(SOL_IP) && defined(IP_TOS)
|
#if defined(SOL_IP) && defined(IP_TOS)
|
||||||
static int priority = 0;
|
static int priority = 0;
|
||||||
|
int origpriority = origpkt->priority;
|
||||||
#endif
|
#endif
|
||||||
int origpriority;
|
|
||||||
int sock;
|
int sock;
|
||||||
|
|
||||||
if(!n->status.reachable) {
|
if(!n->status.reachable) {
|
||||||
|
@ -423,9 +421,6 @@ static void send_udppacket(node_t *n, vpn_packet_t *origpkt) {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
origlen = inpkt->len;
|
|
||||||
origpriority = inpkt->priority;
|
|
||||||
|
|
||||||
/* Compress the packet */
|
/* Compress the packet */
|
||||||
|
|
||||||
if(n->outcompression) {
|
if(n->outcompression) {
|
||||||
|
|
|
@ -150,7 +150,6 @@ FILE *ask_and_open(const char *filename, const char *what, const char *mode) {
|
||||||
char *directory;
|
char *directory;
|
||||||
char buf[PATH_MAX];
|
char buf[PATH_MAX];
|
||||||
char buf2[PATH_MAX];
|
char buf2[PATH_MAX];
|
||||||
size_t len;
|
|
||||||
|
|
||||||
/* Check stdin and stdout */
|
/* Check stdin and stdout */
|
||||||
if(isatty(0) && isatty(1)) {
|
if(isatty(0) && isatty(1)) {
|
||||||
|
@ -165,7 +164,7 @@ FILE *ask_and_open(const char *filename, const char *what, const char *mode) {
|
||||||
return NULL;
|
return NULL;
|
||||||
}
|
}
|
||||||
|
|
||||||
len = strlen(buf);
|
size_t len = strlen(buf);
|
||||||
if(len)
|
if(len)
|
||||||
buf[--len] = 0;
|
buf[--len] = 0;
|
||||||
|
|
||||||
|
@ -488,7 +487,7 @@ int main(int argc, char *argv[], char *envp[]) {
|
||||||
fprintf(stderr, "Could not open control socket cookie file %s: %s\n", controlcookiename, strerror(errno));
|
fprintf(stderr, "Could not open control socket cookie file %s: %s\n", controlcookiename, strerror(errno));
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
if(fscanf(f, "%1024s %128s %d", controlcookie, port, &pid) != 3) {
|
if(fscanf(f, "%1024s %128s %20d", controlcookie, port, &pid) != 3) {
|
||||||
fprintf(stderr, "Could not parse control socket cookie file %s\n", controlcookiename);
|
fprintf(stderr, "Could not parse control socket cookie file %s\n", controlcookiename);
|
||||||
return 1;
|
return 1;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue