[Olsr-cvs] olsrd-current/src/cfgparser oparse.y,1.41,1.42

Bernd Petrovitsch (spam-protected)
Wed Dec 12 22:50:42 CET 2007


Update of /cvsroot/olsrd/olsrd-current/src/cfgparser
In directory sc8-pr-cvs3.sourceforge.net:/tmp/cvs-serv13443/src/cfgparser

Modified Files:
	oparse.y 
Log Message:
* allow IPv6 HNA addresses only in IPv6 mode. The same for IPv4.

Index: oparse.y
===================================================================
RCS file: /cvsroot/olsrd/olsrd-current/src/cfgparser/oparse.y,v
retrieving revision 1.41
retrieving revision 1.42
diff -C2 -d -r1.41 -r1.42
*** oparse.y	29 Nov 2007 22:21:26 -0000	1.41
--- oparse.y	12 Dec 2007 21:50:40 -0000	1.42
***************
*** 128,131 ****
--- 128,136 ----
    PARSER_DEBUG_PRINTF("HNA IPv6 entry: %s/%d\n", ipaddr_arg->string, prefixlen_arg->integer);
  
+   if (olsr_cnf->ip_version != AF_INET6) {
+     fprintf(stderr, "IPv6 addresses can only be used if \"IpVersion\" == 6\n");
+     return 1;
+   }
+ 
    if(inet_pton(AF_INET6, ipaddr_arg->string, &ipaddr) <= 0) {
      fprintf(stderr, "ihna6entry: Failed converting IP address %s\n", ipaddr_arg->string);
***************
*** 717,720 ****
--- 722,730 ----
    PARSER_DEBUG_PRINTF("HNA IPv4 entry: %s/%s\n", $1->string, $2->string);
  
+   if (olsr_cnf->ip_version != AF_INET) {
+     fprintf(stderr, "IPv4 addresses can only be used if \"IpVersion\" == 4\n");
+     YYABORT;
+   }
+ 
    if (inet_pton(AF_INET, $1->string, &ipaddr.v4) <= 0) {
      fprintf(stderr, "ihna4entry: Failed converting IP address %s\n", $1->string);





More information about the Olsr-cvs mailing list