along with this program; if not, write to the Free Software
Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
- $Id: net_setup.c,v 1.1.2.1 2002/02/18 16:25:16 guus Exp $
+ $Id: net_setup.c,v 1.1.2.3 2002/02/20 19:25:09 guus Exp $
*/
#include "config.h"
else
myself->keylength = 1;
+ myself->connection->outcipher = EVP_bf_ofb();
+
myself->key = (char *)xmalloc(myself->keylength);
RAND_pseudo_bytes(myself->key, myself->keylength);
else
myself->digest = EVP_sha1();
+ myself->connection->outdigest = EVP_sha1();
+
if(get_config_int(lookup_config(myself->connection->config_tree, "MACLength"), &myself->maclength))
{
if(myself->digest)
else
myself->maclength = 4;
+ myself->connection->outmaclength = 0;
+
/* Compression */
if(get_config_int(lookup_config(myself->connection->config_tree, "Compression"), &myself->compression))
}
else
myself->compression = 0;
+
+ myself->connection->outcompression = 0;
cp
/* Done */
cp
/* Open sockets */
- hint.ai_family = (addressfamily == AF_UNSPEC)?AF_INET6:addressfamily;
+ hint.ai_family = addressfamily;
hint.ai_socktype = SOCK_STREAM;
hint.ai_protocol = IPPROTO_TCP;
hint.ai_flags = AI_PASSIVE;
return -1;
}
+ freeaddrinfo(ai);
+
+ hint.ai_family = addressfamily;
+ hint.ai_socktype = SOCK_DGRAM;
+ hint.ai_protocol = IPPROTO_UDP;
+ hint.ai_flags = AI_PASSIVE;
+
+ if(getaddrinfo(NULL, myport, &hint, &ai) || !ai)
+ {
+ syslog(LOG_ERR, _("System call `%s' failed: %s"), "getaddrinfo", strerror(errno));
+ return -1;
+ }
+
if((udp_socket = setup_vpn_in_socket((sockaddr_t *)ai->ai_addr)) < 0)
{
syslog(LOG_ERR, _("Unable to set up a listening UDP socket!"));