{
termreq_t tmp;
cp
+ memset(&tmp, 0, sizeof(tmp));
tmp.type = TERMREQ;
tmp.vpn_ip = myself->vpn_ip;
{
termreq_t tmp;
cp
+ memset(&tmp, 0, sizeof(tmp));
tmp.type = PINGTIMEOUT;
tmp.vpn_ip = myself->vpn_ip;
{
del_host_t tmp;
cp
+ memset(&tmp, 0, sizeof(tmp));
tmp.type = DEL_HOST;
tmp.vpn_ip = new_host->vpn_ip;
{
add_host_t tmp;
cp
+ memset(&tmp, 0, sizeof(tmp));
tmp.type = ADD_HOST;
tmp.real_ip = new_host->real_ip;
tmp.vpn_ip = new_host->vpn_ip;
{
key_changed_t tmp;
cp
+ memset(&tmp, 0, sizeof(tmp));
tmp.type = KEY_CHANGED;
tmp.from = src->vpn_ip;
{
basic_info_t tmp;
cp
+ memset(&tmp, 0, sizeof(tmp));
tmp.type = BASIC_INFO;
tmp.protocol = PROT_CURRENT;
{
passphrase_t tmp;
cp
+ memset(&tmp, 0, sizeof(tmp));
tmp.type = PASSPHRASE;
encrypt_passphrase(&tmp);
public_key_t *tmp;
cp
tmp = (public_key_t*)xmalloc(strlen(my_public_key_base36)+sizeof(*tmp));
+ memset(tmp, 0, sizeof(*tmp));
tmp->type = PUBLIC_KEY;
tmp->len = strlen(my_public_key_base36);
strcpy(&tmp->key, my_public_key_base36);
calculate_t *tmp;
cp
tmp = xmalloc(strlen(k)+sizeof(*tmp));
+ memset(tmp, 0, sizeof(*tmp));
tmp->type = CALCULATE;
tmp->len = strlen(k);
strcpy(&tmp->key, k);
conn_list_t *fw;
cp
tmp = xmalloc(sizeof(*tmp));
+ memset(tmp, 0, sizeof(*tmp));
tmp->type = REQ_KEY;
tmp->to = to;
tmp->from = myself->vpn_ip;
conn_list_t *fw;
cp
tmp = xmalloc(sizeof(*tmp)+strlen(my_public_key_base36));
+ memset(tmp, 0, sizeof(*tmp));
tmp->type = ANS_KEY;
tmp->to = to;
tmp->from = myself->vpn_ip;
cl->status.active = 1;
syslog(LOG_NOTICE, "Connection with %s activated.", cl->hostname);
-
- /*
- === FIXME ===
- Now I'm going to cheat. The meta protocol is actually
- a stream of requests, that may come in in the same TCP
- packet. This is the only place that it will happen,
- though.
- I may change it in the future, if it appears that this
- is not retainable.
- */
- if(len > 1) /* An ADD_HOST follows */
- {
- if(request_handlers[d[1]] == NULL)
- syslog(LOG_ERR, "Unknown request %d.", d[1]);
- if(request_handlers[d[1]](cl, d + 1, len - 1) < 0)
- return -1;
- }
cp
return 0;
}
conn_list = ncn;
ncn->status.active = 1;
notify_others(ncn, cl, send_add_host);
-
- /*
- again, i'm cheating here. see the comment in ack_h.
- Naughty zarq! Now you see what cheating will get you... [GS]
- */
- if(len > sizeof(*tmp)) /* Another ADD_HOST follows */
- {
- if(request_handlers[d[sizeof(*tmp)]] == NULL)
- syslog(LOG_ERR, "Unknown request %d.", d[sizeof(*tmp)]);
- if(request_handlers[d[sizeof(*tmp)]](cl, d + sizeof(*tmp), len - sizeof(*tmp)) < 0)
- return -1;
- }
cp
return 0;
}
fw = lookup_conn(tmp->to);
if(!fw)
- {
- syslog(LOG_ERR, "Attempting to forward key request to " IP_ADDR_S ", which does not exist?",
- IP_ADDR_V(tmp->to));
- return -1;
- }
+ {
+ syslog(LOG_ERR, "Attempting to forward key request to " IP_ADDR_S ", which does not exist?",
+ IP_ADDR_V(tmp->to));
+ return -1;
+ }
if(debug_lvl > 3)
syslog(LOG_DEBUG, "Forwarding request for public key to " IP_ADDR_S,