[Olsr-cvs] olsrd-current/lib/httpinfo/src admin_interface.c, 1.13, 1.14

Bernd Petrovitsch (spam-protected)
Thu Nov 29 02:38:38 CET 2007


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

Modified Files:
	admin_interface.c 
Log Message:
* fixed another corner

Index: admin_interface.c
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/lib/httpinfo/src/admin_interface.c,v
retrieving revision 1.13
retrieving revision 1.14
diff -C2 -d -r1.13 -r1.14
*** admin_interface.c	29 Nov 2007 00:49:41 -0000	1.13
--- admin_interface.c	29 Nov 2007 01:38:36 -0000	1.14
***************
*** 185,189 ****
  process_param(char *key, char *value)
  {
!   static olsr_u32_t curr_hna_net;
    static olsr_bool curr_hna_ok = OLSR_FALSE;
  
--- 185,189 ----
  process_param(char *key, char *value)
  {
!   static union olsr_ip_addr curr_hna_net;
    static olsr_bool curr_hna_ok = OLSR_FALSE;
  
***************
*** 307,313 ****
    if(!strcmp(key, "hna_new_net"))
      {
!       struct in_addr in;
! 
!       if(inet_aton(value, &in) == 0)
  	{
  	  fprintf(stderr, "Failed converting new HNA net %s\n", value);
--- 307,311 ----
    if(!strcmp(key, "hna_new_net"))
      {
!       if(inet_pton(olsr_cnf->ipsize, value, &curr_hna_net.v4) == 0)
  	{
  	  fprintf(stderr, "Failed converting new HNA net %s\n", value);
***************
*** 315,319 ****
  	}
        curr_hna_ok = OLSR_TRUE;
-       curr_hna_net = in.s_addr;
        return 1;
      }
--- 313,316 ----
***************
*** 322,325 ****
--- 319,323 ----
      {
        struct in_addr in;
+       olsr_u8_t prefixlen;
  
        if(!curr_hna_ok)
***************
*** 328,339 ****
        curr_hna_ok = OLSR_FALSE;
  
!       if(inet_aton(value, &in) == 0)
! 	{
! 	  fprintf(stderr, "Failed converting new HNA netmask %s\n", value);
! 	  return -1;
! 	}
!       add_local_hna4_entry((union olsr_ip_addr *)&curr_hna_net,
! 			   (union olsr_ip_addr *)&in.s_addr);
!       
        return 1;
      }
--- 326,339 ----
        curr_hna_ok = OLSR_FALSE;
  
!       if(inet_aton(value, &in) == 0) {
!         fprintf(stderr, "Failed converting new HNA netmask %s\n", value);
!         return -1;
!       }
!       prefixlen = netmask_to_prefix((olsr_u8_t *)&in, olsr_cnf->ipsize);
!       if(prefixlen == UCHAR_MAX) {
!         fprintf(stderr, "Failed converting new HNA netmask %s\n", value);
!         return -1;
!       }
!       ip_prefix_list_add(&olsr_cnf->hna_entries, &curr_hna_net, prefixlen);
        return 1;
      }
***************
*** 344,351 ****
        char ip_net[16], ip_mask[16];
        int seperator = 0;
  
!       while(key[7 + seperator] != '*')
  	seperator++;
! 
        strncpy(ip_net, &key[7], seperator);
        ip_net[seperator] = 0;
--- 344,352 ----
        char ip_net[16], ip_mask[16];
        int seperator = 0;
+       olsr_u8_t prefixlen;
  
!       while(key[7 + seperator] != '*') {
  	seperator++;
!       }
        strncpy(ip_net, &key[7], seperator);
        ip_net[seperator] = 0;
***************
*** 359,371 ****
  	}
  
!       if(inet_aton(ip_mask, &mask) == 0)
! 	{
! 	  fprintf(stderr, "Failed converting HNA netmask %s for deletion\n", ip_mask);
! 	  return -1;
! 	}
! 
!       remove_local_hna4_entry((union olsr_ip_addr *)&net.s_addr,
! 			      (union olsr_ip_addr *)&mask.s_addr);
! 
        return 1;
      }
--- 360,373 ----
  	}
  
!       if(inet_aton(ip_mask, &mask) == 0) {
!         fprintf(stderr, "Failed converting HNA netmask %s for deletion\n", ip_mask);
!         return -1;
!       }
!       prefixlen = netmask_to_prefix((olsr_u8_t *)&mask, olsr_cnf->ipsize);
!       if(prefixlen == UCHAR_MAX) {
!         fprintf(stderr, "Failed converting new HNA netmask %s\n", value);
!         return -1;
!       }
!       ip_prefix_list_add(&olsr_cnf->hna_entries, &curr_hna_net, prefixlen);
        return 1;
      }





More information about the Olsr-cvs mailing list