[Olsr-cvs] olsrd-current/lib/secure/src olsrd_secure.c,1.17,1.18
Andreas T�nnesen
(spam-protected)
Sat Jan 7 09:17:47 CET 2006
Update of /cvsroot/olsrd/olsrd-current/lib/secure/src
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv16043/secure/src
Modified Files:
olsrd_secure.c
Log Message:
Adapted plugins to the cleanup of external variables in olsrd
Index: olsrd_secure.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/secure/src/olsrd_secure.c,v
retrieving revision 1.17
retrieving revision 1.18
diff -C2 -d -r1.17 -r1.18
*** olsrd_secure.c 19 Nov 2005 08:37:23 -0000 1.17
--- olsrd_secure.c 7 Jan 2006 08:17:44 -0000 1.18
***************
*** 274,283 ****
{
/* IPv4 sender address */
! memcpy(&from_addr, &((struct sockaddr_in *)&from)->sin_addr.s_addr, ipsize);
}
else
{
/* IPv6 sender address */
! memcpy(&from_addr, &((struct sockaddr_in6 *)&from)->sin6_addr, ipsize);
}
--- 274,283 ----
{
/* IPv4 sender address */
! memcpy(&from_addr, &((struct sockaddr_in *)&from)->sin_addr.s_addr, olsr_cnf->ipsize);
}
else
{
/* IPv6 sender address */
! memcpy(&from_addr, &((struct sockaddr_in6 *)&from)->sin6_addr, olsr_cnf->ipsize);
}
***************
*** 415,419 ****
msg->olsr_vtime = 0;
msg->olsr_msgsize = htons(sizeof(struct s_olsrmsg));
! memcpy(&msg->originator, &main_addr, ipsize);
msg->ttl = 1;
msg->hopcnt = 0;
--- 415,419 ----
msg->olsr_vtime = 0;
msg->olsr_msgsize = htons(sizeof(struct s_olsrmsg));
! memcpy(&msg->originator, &olsr_cnf->main_addr, olsr_cnf->ipsize);
msg->ttl = 1;
msg->hopcnt = 0;
***************
*** 673,677 ****
cmsg.olsr_vtime = 0;
cmsg.olsr_msgsize = htons(sizeof(struct challengemsg));
! memcpy(&cmsg.originator, &main_addr, ipsize);
cmsg.ttl = 1;
cmsg.hopcnt = 0;
--- 673,677 ----
cmsg.olsr_vtime = 0;
cmsg.olsr_msgsize = htons(sizeof(struct challengemsg));
! memcpy(&cmsg.originator, &olsr_cnf->main_addr, olsr_cnf->ipsize);
cmsg.ttl = 1;
cmsg.hopcnt = 0;
***************
*** 679,683 ****
/* Fill subheader */
! memcpy(&cmsg.destination, new_host, ipsize);
cmsg.challenge = htonl(challenge);
--- 679,683 ----
/* Fill subheader */
! memcpy(&cmsg.destination, new_host, olsr_cnf->ipsize);
cmsg.challenge = htonl(challenge);
***************
*** 712,716 ****
entry->challenge = challenge;
! memcpy(&entry->addr, new_host, ipsize);
/* update validtime - not validated */
--- 712,716 ----
entry->challenge = challenge;
! memcpy(&entry->addr, new_host, olsr_cnf->ipsize);
/* update validtime - not validated */
***************
*** 786,794 ****
memcpy(checksum_cache, &entry->challenge, 4);
/* Then the local IP */
! memcpy(&checksum_cache[sizeof(olsr_u32_t)], &msg->originator, ipsize);
/* Create the hash */
CHECKSUM(checksum_cache,
! sizeof(olsr_u32_t) + ipsize,
sha1_hash);
--- 786,794 ----
memcpy(checksum_cache, &entry->challenge, 4);
/* Then the local IP */
! memcpy(&checksum_cache[sizeof(olsr_u32_t)], &msg->originator, olsr_cnf->ipsize);
/* Create the hash */
CHECKSUM(checksum_cache,
! sizeof(olsr_u32_t) + olsr_cnf->ipsize,
sha1_hash);
***************
*** 881,889 ****
memcpy(checksum_cache, &entry->challenge, 4);
/* Then the local IP */
! memcpy(&checksum_cache[sizeof(olsr_u32_t)], &msg->originator, ipsize);
/* Create the hash */
CHECKSUM(checksum_cache,
! sizeof(olsr_u32_t) + ipsize,
sha1_hash);
--- 881,889 ----
memcpy(checksum_cache, &entry->challenge, 4);
/* Then the local IP */
! memcpy(&checksum_cache[sizeof(olsr_u32_t)], &msg->originator, olsr_cnf->ipsize);
/* Create the hash */
CHECKSUM(checksum_cache,
! sizeof(olsr_u32_t) + olsr_cnf->ipsize,
sha1_hash);
***************
*** 940,944 ****
{
entry = malloc(sizeof(struct stamp));
! memcpy(&entry->addr, &msg->originator, ipsize);
hash = olsr_hashing((union olsr_ip_addr *)&msg->originator);
--- 940,944 ----
{
entry = malloc(sizeof(struct stamp));
! memcpy(&entry->addr, &msg->originator, olsr_cnf->ipsize);
hash = olsr_hashing((union olsr_ip_addr *)&msg->originator);
***************
*** 1033,1037 ****
crmsg.olsr_vtime = 0;
crmsg.olsr_msgsize = htons(sizeof(struct c_respmsg));
! memcpy(&crmsg.originator, &main_addr, ipsize);
crmsg.ttl = 1;
crmsg.hopcnt = 0;
--- 1033,1037 ----
crmsg.olsr_vtime = 0;
crmsg.olsr_msgsize = htons(sizeof(struct c_respmsg));
! memcpy(&crmsg.originator, &olsr_cnf->main_addr, olsr_cnf->ipsize);
crmsg.ttl = 1;
crmsg.hopcnt = 0;
***************
*** 1043,1047 ****
/* Fill subheader */
! memcpy(&crmsg.destination, to, ipsize);
crmsg.challenge = htonl(challenge);
--- 1043,1047 ----
/* Fill subheader */
! memcpy(&crmsg.destination, to, olsr_cnf->ipsize);
crmsg.challenge = htonl(challenge);
***************
*** 1052,1060 ****
memcpy(checksum_cache, &chal_in, 4);
/* Then the local IP */
! memcpy(&checksum_cache[sizeof(olsr_u32_t)], from, ipsize);
/* Create the hash */
CHECKSUM(checksum_cache,
! sizeof(olsr_u32_t) + ipsize,
crmsg.res_sig);
--- 1052,1060 ----
memcpy(checksum_cache, &chal_in, 4);
/* Then the local IP */
! memcpy(&checksum_cache[sizeof(olsr_u32_t)], from, olsr_cnf->ipsize);
/* Create the hash */
CHECKSUM(checksum_cache,
! sizeof(olsr_u32_t) + olsr_cnf->ipsize,
crmsg.res_sig);
***************
*** 1107,1111 ****
rrmsg.olsr_vtime = 0;
rrmsg.olsr_msgsize = htons(sizeof(struct r_respmsg));
! memcpy(&rrmsg.originator, &main_addr, ipsize);
rrmsg.ttl = 1;
rrmsg.hopcnt = 0;
--- 1107,1111 ----
rrmsg.olsr_vtime = 0;
rrmsg.olsr_msgsize = htons(sizeof(struct r_respmsg));
! memcpy(&rrmsg.originator, &olsr_cnf->main_addr, olsr_cnf->ipsize);
rrmsg.ttl = 1;
rrmsg.hopcnt = 0;
***************
*** 1117,1121 ****
/* Fill subheader */
! memcpy(&rrmsg.destination, to, ipsize);
/* Create digest of received challenge + IP */
--- 1117,1121 ----
/* Fill subheader */
! memcpy(&rrmsg.destination, to, olsr_cnf->ipsize);
/* Create digest of received challenge + IP */
***************
*** 1125,1133 ****
memcpy(checksum_cache, &chal_in, 4);
/* Then the local IP */
! memcpy(&checksum_cache[sizeof(olsr_u32_t)], from, ipsize);
/* Create the hash */
CHECKSUM(checksum_cache,
! sizeof(olsr_u32_t) + ipsize,
rrmsg.res_sig);
--- 1125,1133 ----
memcpy(checksum_cache, &chal_in, 4);
/* Then the local IP */
! memcpy(&checksum_cache[sizeof(olsr_u32_t)], from, olsr_cnf->ipsize);
/* Create the hash */
CHECKSUM(checksum_cache,
! sizeof(olsr_u32_t) + olsr_cnf->ipsize,
rrmsg.res_sig);
***************
*** 1172,1176 ****
entry = entry->next)
{
! if(memcmp(&entry->addr, adr, ipsize) == 0)
{
olsr_printf(3, "[ENC]Match for %s\n", olsr_ip_to_string(adr));
--- 1172,1176 ----
entry = entry->next)
{
! if(memcmp(&entry->addr, adr, olsr_cnf->ipsize) == 0)
{
olsr_printf(3, "[ENC]Match for %s\n", olsr_ip_to_string(adr));
More information about the Olsr-cvs
mailing list