[Olsr-cvs] olsrd-current/lib/nameservice/src nameservice.c, 1.37, 1.38

Bernd Petrovitsch (spam-protected)
Thu Nov 29 01:10:20 CET 2007


Update of /cvsroot/olsrd/olsrd-current/lib/nameservice/src
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv1006/lib/nameservice/src

Modified Files:
	nameservice.c 
Log Message:
Bug Fixes (of stupid and forgotten bugs) from Sven-Ola Tücke <(spam-protected)> from
http://download-master.berlin.freifunk.net/sven-ola/nylon/packages/olsrd/files/102-olsrd-cvs-fixes.patch



Index: nameservice.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/nameservice/src/nameservice.c,v
retrieving revision 1.37
retrieving revision 1.38
diff -C2 -d -r1.37 -r1.38
*** nameservice.c	16 Nov 2007 22:56:54 -0000	1.37
--- nameservice.c	29 Nov 2007 00:10:17 -0000	1.38
***************
*** 830,837 ****
  			if (!ipequal(&already_saved_name_entries->ip, &from_packet->ip))
  			{
  				OLSR_PRINTF(4, "NAME PLUGIN: updating ip %s -> %s (%s)\n",
  					olsr_ip_to_string(&strbuf, &already_saved_name_entries->ip),
! 					olsr_ip_to_string(&strbuf, &from_packet->ip),
! 					olsr_ip_to_string(&strbuf, &already_saved_name_entries->ip));
  				memcpy(&already_saved_name_entries->ip, &from_packet->ip, olsr_cnf->ipsize);
  				*this_table_changed = OLSR_TRUE;
--- 830,840 ----
  			if (!ipequal(&already_saved_name_entries->ip, &from_packet->ip))
  			{
+ #ifndef NODEBUG
+ 				struct ipaddr_str strbuf2, strbuf3;
+ #endif
  				OLSR_PRINTF(4, "NAME PLUGIN: updating ip %s -> %s (%s)\n",
  					olsr_ip_to_string(&strbuf, &already_saved_name_entries->ip),
! 					olsr_ip_to_string(&strbuf2, &from_packet->ip),
! 					olsr_ip_to_string(&strbuf3, &already_saved_name_entries->ip));
  				memcpy(&already_saved_name_entries->ip, &from_packet->ip, olsr_cnf->ipsize);
  				*this_table_changed = OLSR_TRUE;
***************
*** 1485,1489 ****
  	struct olsr_if *ifs;
  	union olsr_ip_addr ip;
! 	struct ipaddr_str strbuf;
  	struct tc_entry *tc;
  	struct tc_edge_entry *tc_edge;
--- 1488,1492 ----
  	struct olsr_if *ifs;
  	union olsr_ip_addr ip;
! 	struct ipaddr_str strbuf1, strbuf2;
  	struct tc_entry *tc;
  	struct tc_edge_entry *tc_edge;
***************
*** 1507,1517 ****
  			if (olsr_cnf->ip_version == AF_INET)
  			{
- 				struct ipaddr_str strbuf;
  				/*
  				 * Didn't find a good sample to grab a simple
  				 * olsr_ip_addr from a given interface. Sven-Ola
  				 */
! 				const char* p = olsr_ip_to_string(&strbuf, &olsr_cnf->main_addr);
! 				const char* q = ip4_to_string(&strbuf, ifs->interf->int_addr.sin_addr);
  				if (0 != strcmp(p, q))
  				{
--- 1510,1519 ----
  			if (olsr_cnf->ip_version == AF_INET)
  			{
  				/*
  				 * Didn't find a good sample to grab a simple
  				 * olsr_ip_addr from a given interface. Sven-Ola
  				 */
! 				const char* p = olsr_ip_to_string(&strbuf1, &olsr_cnf->main_addr);
! 				const char* q = ip4_to_string(&strbuf1, ifs->interf->int_addr.sin_addr);
  				if (0 != strcmp(p, q))
  				{
***************
*** 1521,1528 ****
  			else if (!(ipequal(&olsr_cnf->main_addr, (union olsr_ip_addr *)&ifs->interf->int6_addr.sin6_addr)))
  			{
- 				struct ipaddr_str strbuf;
  				fprintf(js, "Mid('%s','%s');\n",
! 					olsr_ip_to_string(&strbuf, &olsr_cnf->main_addr),
! 					olsr_ip_to_string(&strbuf, (union olsr_ip_addr *)&ifs->interf->int6_addr.sin6_addr));
  			}
  		}
--- 1523,1529 ----
  			else if (!(ipequal(&olsr_cnf->main_addr, (union olsr_ip_addr *)&ifs->interf->int6_addr.sin6_addr)))
  			{
  				fprintf(js, "Mid('%s','%s');\n",
! 					olsr_ip_to_string(&strbuf1, &olsr_cnf->main_addr),
! 					olsr_ip_to_string(&strbuf2, (union olsr_ip_addr *)&ifs->interf->int6_addr.sin6_addr));
  			}
  		}
***************
*** 1538,1543 ****
  			{
  				fprintf(js, "Mid('%s','%s');\n",
! 						olsr_ip_to_string(&strbuf, &entry->main_addr),
! 						olsr_ip_to_string(&strbuf, &alias->alias));
  				alias = alias->next_alias;
  			}
--- 1539,1544 ----
  			{
  				fprintf(js, "Mid('%s','%s');\n",
! 						olsr_ip_to_string(&strbuf1, &entry->main_addr),
! 						olsr_ip_to_string(&strbuf2, &alias->alias));
  				alias = alias->next_alias;
  			}
***************
*** 1546,1551 ****
  	}
  	lookup_defhna_latlon(&ip);
! 	fprintf(js, "Self('%s',%f,%f,%d,'%s','%s');\n", olsr_ip_to_string(&strbuf, &olsr_cnf->main_addr),
! 			my_lat, my_lon, get_isdefhna_latlon(), olsr_ip_to_string(&strbuf, &ip), my_names->name);
  	for (hash = 0; hash < HASHSIZE; hash++) 
  	{
--- 1547,1552 ----
  	}
  	lookup_defhna_latlon(&ip);
! 	fprintf(js, "Self('%s',%f,%f,%d,'%s','%s');\n", olsr_ip_to_string(&strbuf1, &olsr_cnf->main_addr),
! 			my_lat, my_lon, get_isdefhna_latlon(), olsr_ip_to_string(&strbuf2, &ip), my_names->name);
  	for (hash = 0; hash < HASHSIZE; hash++) 
  	{
***************
*** 1557,1562 ****
  			{
  				fprintf(js, "Node('%s',%s,'%s','%s');\n",
! 					olsr_ip_to_string(&strbuf, &entry->originator),
! 					name->name, olsr_ip_to_string(&strbuf, &name->ip),
  					lookup_name_latlon(&entry->originator));
  			}
--- 1558,1563 ----
  			{
  				fprintf(js, "Node('%s',%s,'%s','%s');\n",
! 					olsr_ip_to_string(&strbuf1, &entry->originator),
! 					name->name, olsr_ip_to_string(&strbuf2, &name->ip),
  					lookup_name_latlon(&entry->originator));
  			}
***************
*** 1566,1573 ****
  	OLSR_FOR_ALL_TC_ENTRIES(tc) {
  		OLSR_FOR_ALL_TC_EDGE_ENTRIES(tc, tc_edge) {
- 			struct ipaddr_str dstbuf, addrbuf;
  			fprintf(js, "Link('%s','%s',%f,%f,%f);\n", 
! 					olsr_ip_to_string(&dstbuf, &tc_edge->T_dest_addr),
! 					olsr_ip_to_string(&addrbuf, &tc->addr), 
  					tc_edge->link_quality,
  					tc_edge->inverse_link_quality,
--- 1567,1573 ----
  	OLSR_FOR_ALL_TC_ENTRIES(tc) {
  		OLSR_FOR_ALL_TC_EDGE_ENTRIES(tc, tc_edge) {
  			fprintf(js, "Link('%s','%s',%f,%f,%f);\n", 
! 					olsr_ip_to_string(&strbuf1, &tc_edge->T_dest_addr),
! 					olsr_ip_to_string(&strbuf2, &tc->addr), 
  					tc_edge->link_quality,
  					tc_edge->inverse_link_quality,





More information about the Olsr-cvs mailing list