[Olsr-cvs] olsrd-current/src process_package.c,1.43,1.44
Bernd Petrovitsch
(spam-protected)
Fri Nov 9 01:11:03 CET 2007
Update of /cvsroot/olsrd/olsrd-current/src
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv32179/src
Modified Files:
process_package.c
Log Message:
* killed gotos
Index: process_package.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/process_package.c,v
retrieving revision 1.43
retrieving revision 1.44
diff -C2 -d -r1.43 -r1.44
*** process_package.c 8 Nov 2007 22:47:41 -0000 1.43
--- process_package.c 9 Nov 2007 00:11:01 -0000 1.44
***************
*** 235,255 ****
struct tc_entry *tc_last;
! if(!olsr_check_dup_table_proc(&message->originator,
! message->packet_seq_number))
! {
! goto forward;
! }
!
! OLSR_PRINTF(3, "Processing TC from %s, seq 0x%04x\n",
! olsr_ip_to_string(&buf, &message->originator), message->ansn);
! /*
! * If the sender interface (NB: not originator) of this message
! * is not in the symmetric 1-hop neighborhood of this node, the
! * message MUST be discarded.
! */
! if(check_neighbor_link(from_addr) != SYM_LINK)
! {
OLSR_PRINTF(2, "Received TC from NON SYM neighbor %s\n",
olsr_ip_to_string(&buf, from_addr));
--- 235,250 ----
struct tc_entry *tc_last;
! if (olsr_check_dup_table_proc(&message->originator,
! message->packet_seq_number)) {
! OLSR_PRINTF(3, "Processing TC from %s, seq 0x%04x\n",
! olsr_ip_to_string(&buf, &message->originator), message->ansn);
! /*
! * If the sender interface (NB: not originator) of this message
! * is not in the symmetric 1-hop neighborhood of this node, the
! * message MUST be discarded.
! */
! if (check_neighbor_link(from_addr) != SYM_LINK) {
OLSR_PRINTF(2, "Received TC from NON SYM neighbor %s\n",
olsr_ip_to_string(&buf, from_addr));
***************
*** 258,295 ****
}
! if(olsr_cnf->debug_level > 2)
! {
mpr = message->multipoint_relay_selector_address;
OLSR_PRINTF(3, "mpr_selector_list:[");
! while(mpr!=NULL)
! {
OLSR_PRINTF(3, "%s:", olsr_ip_to_string(&buf, &mpr->address));
mpr=mpr->next;
! }
OLSR_PRINTF(3, "]\n");
}
! tc_last = olsr_lookup_tc_entry(&message->originator);
! if(tc_last != NULL)
! {
/* Update entry */
/* Delete destinations with lower ANSN */
! if(olsr_tc_delete_mprs(tc_last, message))
changes_topology = OLSR_TRUE;
!
/* Update destinations */
! if(olsr_tc_update_mprs(tc_last, message))
changes_topology = OLSR_TRUE;
! }
!
! else
! {
/*if message is empty then skip it */
! if(message->multipoint_relay_selector_address != NULL)
! {
/* New entry */
tc_last = olsr_add_tc_entry(&message->originator);
--- 253,284 ----
}
! if (olsr_cnf->debug_level > 2) {
mpr = message->multipoint_relay_selector_address;
OLSR_PRINTF(3, "mpr_selector_list:[");
! while (mpr != NULL) {
OLSR_PRINTF(3, "%s:", olsr_ip_to_string(&buf, &mpr->address));
mpr=mpr->next;
! }
OLSR_PRINTF(3, "]\n");
}
! tc_last = olsr_lookup_tc_entry(&message->originator);
! if(tc_last != NULL) {
/* Update entry */
/* Delete destinations with lower ANSN */
! if(olsr_tc_delete_mprs(tc_last, message)) {
changes_topology = OLSR_TRUE;
! }
/* Update destinations */
! if(olsr_tc_update_mprs(tc_last, message)) {
changes_topology = OLSR_TRUE;
! }
! } else {
/*if message is empty then skip it */
! if (message->multipoint_relay_selector_address != NULL) {
/* New entry */
tc_last = olsr_add_tc_entry(&message->originator);
***************
*** 299,308 ****
changes_topology = OLSR_TRUE;
! }
! else
! {
! OLSR_PRINTF(3, "Dropping empty TC from %s\n",
! olsr_ip_to_string(&buf, &message->originator));
! }
}
--- 288,295 ----
changes_topology = OLSR_TRUE;
! } else {
! OLSR_PRINTF(3, "Dropping empty TC from %s\n",
! olsr_ip_to_string(&buf, &message->originator));
! }
}
***************
*** 310,314 ****
//olsr_process_changes();
! forward:
olsr_forward_message(m,
--- 297,301 ----
//olsr_process_changes();
! }
olsr_forward_message(m,
***************
*** 319,324 ****
olsr_free_tc_packet(message);
-
- return;
}
--- 306,309 ----
***************
*** 348,356 ****
}
-
-
-
-
-
/**
*Process a received(and parsed) MID message
--- 333,336 ----
***************
*** 375,403 ****
mid_chgestruct(&message, m);
! if(!olsr_validate_address(&message.mid_origaddr))
! {
! olsr_free_mid_packet(&message);
! return;
! }
! if(!olsr_check_dup_table_proc(&message.mid_origaddr,
! message.mid_seqno))
! {
! goto forward;
! }
#ifdef DEBUG
! OLSR_PRINTF(5, "Processing MID from %s...\n", olsr_ip_to_string(&buf, &message.mid_origaddr));
#endif
! tmp_adr = message.mid_addr;
! /*
! * If the sender interface (NB: not originator) of this message
! * is not in the symmetric 1-hop neighborhood of this node, the
! * message MUST be discarded.
! */
! if(check_neighbor_link(from_addr) != SYM_LINK)
! {
#ifndef NODEBUG
struct ipaddr_str buf;
--- 355,378 ----
mid_chgestruct(&message, m);
! if (!olsr_validate_address(&message.mid_origaddr)) {
! olsr_free_mid_packet(&message);
! return;
! }
! if (olsr_check_dup_table_proc(&message.mid_origaddr,
! message.mid_seqno)) {
#ifdef DEBUG
! OLSR_PRINTF(5, "Processing MID from %s...\n", olsr_ip_to_string(&buf, &message.mid_origaddr));
#endif
! tmp_adr = message.mid_addr;
! /*
! * If the sender interface (NB: not originator) of this message
! * is not in the symmetric 1-hop neighborhood of this node, the
! * message MUST be discarded.
! */
! if(check_neighbor_link(from_addr) != SYM_LINK) {
#ifndef NODEBUG
struct ipaddr_str buf;
***************
*** 408,433 ****
}
! /* Update the timeout of the MID */
! olsr_update_mid_table(&message.mid_origaddr, (float)message.vtime);
! while(tmp_adr)
! {
! if(!mid_lookup_main_addr(&tmp_adr->alias_addr))
! {
#ifndef NODEBUG
! struct ipaddr_str buf;
#endif
! OLSR_PRINTF(1, "MID new: (%s, ", olsr_ip_to_string(&buf, &message.mid_origaddr));
! OLSR_PRINTF(1, "%s)\n", olsr_ip_to_string(&buf, &tmp_adr->alias_addr));
! insert_mid_alias(&message.mid_origaddr, &tmp_adr->alias_addr, (float)message.vtime);
! }
!
!
tmp_adr = tmp_adr->next;
}
! olsr_prune_aliases(&message.mid_origaddr, message.mid_addr);
- forward:
olsr_forward_message(m,
&message.mid_origaddr,
--- 383,404 ----
}
! /* Update the timeout of the MID */
! olsr_update_mid_table(&message.mid_origaddr, (float)message.vtime);
! while (tmp_adr) {
! if (!mid_lookup_main_addr(&tmp_adr->alias_addr)){
#ifndef NODEBUG
! struct ipaddr_str buf;
#endif
! OLSR_PRINTF(1, "MID new: (%s, ", olsr_ip_to_string(&buf, &message.mid_origaddr));
! OLSR_PRINTF(1, "%s)\n", olsr_ip_to_string(&buf, &tmp_adr->alias_addr));
! insert_mid_alias(&message.mid_origaddr, &tmp_adr->alias_addr, (float)message.vtime);
! }
tmp_adr = tmp_adr->next;
}
! olsr_prune_aliases(&message.mid_origaddr, message.mid_addr);
! }
olsr_forward_message(m,
&message.mid_origaddr,
***************
*** 436,447 ****
from_addr);
olsr_free_mid_packet(&message);
-
- return;
}
-
-
-
/**
*Process incoming HNA message.
--- 407,413 ----
***************
*** 467,491 ****
hna_chgestruct(&message, m);
! if(!olsr_validate_address(&message.originator))
! {
! olsr_free_hna_packet(&message);
! return;
! }
! if(!olsr_check_dup_table_proc(&message.originator,
! message.packet_seq_number))
! {
! goto forward;
! }
! hna_tmp = message.hna_net;
! /*
! * If the sender interface (NB: not originator) of this message
! * is not in the symmetric 1-hop neighborhood of this node, the
! * message MUST be discarded.
! */
! if(check_neighbor_link(from_addr) != SYM_LINK)
! {
#ifndef NODEBUG
struct ipaddr_str buf;
--- 433,452 ----
hna_chgestruct(&message, m);
! if(!olsr_validate_address(&message.originator)) {
! olsr_free_hna_packet(&message);
! return;
! }
! if (olsr_check_dup_table_proc(&message.originator,
! message.packet_seq_number)) {
! hna_tmp = message.hna_net;
! /*
! * If the sender interface (NB: not originator) of this message
! * is not in the symmetric 1-hop neighborhood of this node, the
! * message MUST be discarded.
! */
! if(check_neighbor_link(from_addr) != SYM_LINK) {
#ifndef NODEBUG
struct ipaddr_str buf;
***************
*** 496,512 ****
}
! while(hna_tmp)
! {
/* Don't add an HNA entry that we are advertising ourselves. */
if (!find_local_hna4_entry(&hna_tmp->net, hna_tmp->netmask.v4) &&
! !find_local_hna6_entry(&hna_tmp->net, hna_tmp->netmask.v6))
! {
! olsr_update_hna_entry(&message.originator, &hna_tmp->net, &hna_tmp->netmask, (float)message.vtime);
! }
hna_tmp = hna_tmp->next;
}
- forward:
olsr_forward_message(m,
&message.originator,
--- 457,471 ----
}
! while (hna_tmp) {
/* Don't add an HNA entry that we are advertising ourselves. */
if (!find_local_hna4_entry(&hna_tmp->net, hna_tmp->netmask.v4) &&
! !find_local_hna6_entry(&hna_tmp->net, hna_tmp->netmask.v6)) {
! olsr_update_hna_entry(&message.originator, &hna_tmp->net, &hna_tmp->netmask, (float)message.vtime);
! }
hna_tmp = hna_tmp->next;
}
+ }
olsr_forward_message(m,
&message.originator,
***************
*** 515,528 ****
from_addr);
olsr_free_hna_packet(&message);
-
- return;
}
-
-
-
-
-
-
/**
*Processes an list of neighbors from an incoming HELLO message.
--- 474,479 ----
More information about the Olsr-cvs
mailing list