[Olsr-cvs] olsrd-current/lib/nameservice/src nameservice.c, 1.19, 1.20

Bernd Petrovitsch (spam-protected)
Fri Apr 20 12:33:10 CEST 2007


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

Modified Files:
	nameservice.c 
Log Message:
* compare the result of inet_pton() > 0 instead of == 1

Index: nameservice.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/nameservice/src/nameservice.c,v
retrieving revision 1.19
retrieving revision 1.20
diff -C2 -d -r1.19 -r1.20
*** nameservice.c	19 Apr 2007 22:21:34 -0000	1.19
--- nameservice.c	20 Apr 2007 10:33:08 -0000	1.20
***************
*** 188,192 ****
              my_forwarders = add_name_to_list(my_forwarders, "", NAME_FORWARDER, NULL);
              olsr_printf(1,"\nNAME PLUGIN: parameter dns-server: (main address)");
!         } else if (inet_pton(olsr_cnf->ip_version, value, &ip) == 1) {
              my_forwarders = add_name_to_list(my_forwarders, "", NAME_FORWARDER, &ip);
              olsr_printf(1,"\nNAME PLUGIN: parameter dns-server: (%s)", value);
--- 188,192 ----
              my_forwarders = add_name_to_list(my_forwarders, "", NAME_FORWARDER, NULL);
              olsr_printf(1,"\nNAME PLUGIN: parameter dns-server: (main address)");
!         } else if (inet_pton(olsr_cnf->ip_version, value, &ip) > 0) {
              my_forwarders = add_name_to_list(my_forwarders, "", NAME_FORWARDER, &ip);
              olsr_printf(1,"\nNAME PLUGIN: parameter dns-server: (%s)", value);
***************
*** 209,213 ****
  		union olsr_ip_addr ip;
  		
! 		if (inet_pton(olsr_cnf->ip_version, key, &ip) == 1) {
  			// the IP is validated later
              my_names = add_name_to_list(my_names, value, NAME_HOST, &ip);
--- 209,213 ----
  		union olsr_ip_addr ip;
  		
! 		if (inet_pton(olsr_cnf->ip_version, key, &ip) > 0) {
  			// the IP is validated later
              my_names = add_name_to_list(my_names, value, NAME_HOST, &ip);
***************
*** 1281,1285 ****
      
      //ip in service-line is allowed 
!     if (inet_pton(olsr_cnf->ip_version, hostname_or_ip, &olsr_ip) == 1) {
          if (allowed_ip(&olsr_ip)) {
              olsr_printf(2, "NAME PLUGIN: ip %s in service %s is OK\n", olsr_ip_to_string(&olsr_ip), service_line);
--- 1281,1285 ----
      
      //ip in service-line is allowed 
!     if (inet_pton(olsr_cnf->ip_version, hostname_or_ip, &olsr_ip) > 0) {
          if (allowed_ip(&olsr_ip)) {
              olsr_printf(2, "NAME PLUGIN: ip %s in service %s is OK\n", olsr_ip_to_string(&olsr_ip), service_line);





More information about the Olsr-cvs mailing list