along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: net_packet.c,v 1.1.2.28 2003/05/06 21:13:17 guus Exp $
+ $Id: net_packet.c,v 1.1.2.29 2003/05/06 23:14:45 guus Exp $
*/
#include "config.h"
int keylifetime = 0;
int keyexpires = 0;
EVP_CIPHER_CTX packet_ctx;
-char lzo_wrkmem[MAXSIZE];
+char lzo_wrkmem[LZO1X_999_MEM_COMPRESS > LZO1X_1_MEM_COMPRESS ? LZO1X_999_MEM_COMPRESS : LZO1X_1_MEM_COMPRESS];
#define MAX_SEQNO 1073741824
lzo1x_1_compress(source, len, dest, &lzolen, lzo_wrkmem);
return lzolen;
} else if(level < 10) {
- unsigned long destlen;
+ unsigned long destlen = MAXSIZE;
if(compress2(dest, &destlen, source, len, level) == Z_OK)
return destlen;
else
else
return -1;
} else {
- unsigned long destlen;
+ unsigned long destlen = MAXSIZE;
if(uncompress(dest, &destlen, source, len) == Z_OK)
return destlen;
else
int nextpkt = 0;
vpn_packet_t *outpkt = pkt[0];
int outlen, outpad;
- long int complen = MTU + 12;
char hmac[EVP_MAX_MD_SIZE];
int i;
} else if (inpkt->seqno <= n->received_seqno) {
if(inpkt->seqno <= n->received_seqno - sizeof(n->late) * 8 || !(n->late[(inpkt->seqno / 8) % sizeof(n->late)] & (1 << inpkt->seqno % 8))) {
syslog(LOG_WARNING, _("Got late or replayed packet from %s (%s), seqno %d, last received %d"),
- n->name, n->hostname, inpkt->seqno, n->received_seqno, n->late[(inpkt->seqno / 8) % sizeof(n->late)]);
+ n->name, n->hostname, inpkt->seqno, n->received_seqno);
} else
for(i = n->received_seqno + 1; i < inpkt->seqno; i++)
n->late[(inpkt->seqno / 8) % sizeof(n->late)] |= 1 << i % 8;
vpn_packet_t *outpkt;
int origlen;
int outlen, outpad;
- long int complen = MTU + 12;
vpn_packet_t *copy;
static int priority = 0;
int origpriority;
along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: tincd.c,v 1.10.4.66 2003/01/17 00:43:58 guus Exp $
+ $Id: tincd.c,v 1.10.4.67 2003/05/06 23:14:45 guus Exp $
*/
#include "config.h"
#include <openssl/pem.h>
#include <openssl/evp.h>
+#include <lzo1x.h>
+
#include <utils.h>
#include <xalloc.h>
if(show_help)
usage(0);
+ if(kill_tincd)
+ exit(kill_other(kill_tincd));
+
#ifndef LOG_PERROR
openlog("tinc", LOG_CONS, LOG_DAEMON); /* Catch all syslog() calls issued before detaching */
#else
exit(keygen(generate_keys));
}
- if(kill_tincd)
- exit(kill_other(kill_tincd));
-
if(read_server_config())
exit(1);
+ if(lzo_init() != LZO_E_OK) {
+ syslog(LOG_ERR, _("Error initializing LZO compressor!"));
+ exit(1);
+ }
+
if(detach())
exit(0);
-
+
for(;;) {
if(!setup_network_connections()) {
main_loop();