+ /* Update our copy of the origin's packet key */
+
+ if(from->key)
+ free(from->key);
+
+ from->key = xstrdup(key);
+ keylength /= 2;
+ hex2bin(from->key, from->key, keylength);
+ from->key[keylength] = '\0';
+
+ from->status.validkey = 1;
+ from->status.waitingforkey = 0;
+
+ flush_queue(from);
+cp
+ return 0;
+}
+
+int send_tcppacket(connection_t *c, vpn_packet_t *packet)
+{
+ int x;
+cp
+ /* Evil hack. */
+
+ x = send_request(c, "%d %hd", PACKET, packet->len);
+
+ if(x)
+ return x;
+cp
+ return send_meta(c, packet->data, packet->len);
+}
+
+int tcppacket_h(connection_t *c)
+{
+ short int len;
+cp
+ if(sscanf(c->buffer, "%*d %hd", &len) != 1)
+ {
+ syslog(LOG_ERR, _("Got bad %s from %s (%s)"), "PACKET", c->name, c->hostname);
+ return -1;
+ }
+
+ /* Set reqlen to len, this will tell receive_meta() that a tcppacket is coming. */
+
+ c->tcplen = len;