+ if(pid)
+ {
+ free(scriptname);
+ return 0;
+ }
+
+ /* Child here */
+
+ env = xmalloc(sizeof(environment) + 1 * sizeof(char*));
+ memcpy(&(env[1]), environment, sizeof(environment));
+ asprintf(&(env[0]), "IFNAME=%s", interface_name);
+ execle(scriptname, NULL, env);
+ /* No return on success */
+
+ if(errno != ENOENT) /* Ignore if the file does not exist */
+ syslog(LOG_WARNING, _("Error executing `%s': %m"), scriptname);
+
+ /* No need to free things */
+ exit(0);
+}
+
+int xsend(conn_list_t *cl, vpn_packet_t *inpkt)
+{
+ vpn_packet_t outpkt;
+ int outlen, outpad;
+ EVP_CIPHER_CTX ctx;
+cp
+ outpkt.len = inpkt->len;
+
+ /* Encrypt the packet */
+
+ EVP_EncryptInit(&ctx, cl->cipher_pkttype, cl->cipher_pktkey, cl->cipher_pktkey + cl->cipher_pkttype->key_len);
+ EVP_EncryptUpdate(&ctx, outpkt.data, &outlen, inpkt->data, inpkt->len);
+ EVP_EncryptFinal(&ctx, outpkt.data + outlen, &outpad);
+ outlen += outpad + 2;
+
+/* Bypass
+ outlen = outpkt.len + 2;
+ memcpy(&outpkt, inpkt, outlen);
+*/
+
+ if(debug_lvl >= DEBUG_TRAFFIC)
+ syslog(LOG_ERR, _("Sending packet of %d bytes to %s (%s)"),
+ outlen, cl->name, cl->hostname);
+
+ total_socket_out += outlen;