adopt parser and sanity check aswell
authorMarkus Kittenberger <Markus.Kittenberger@gmx.at>
Sat, 9 Jan 2010 12:32:13 +0000 (13:32 +0100)
committerMarkus Kittenberger <Markus.Kittenberger@gmx.at>
Sat, 9 Jan 2010 12:32:13 +0000 (13:32 +0100)
src/cfgparser/olsrd_conf.c
src/cfgparser/oparse.y

index 93f1bf7..93ce69b 100644 (file)
@@ -268,6 +268,7 @@ int olsrd_sanity_check_interface_cnf(struct if_config_options * io, struct olsrd
       return -1;
     }
   }
+  return 0;
 }
 
 
index a6f2e5d..42db4b2 100644 (file)
@@ -285,7 +285,7 @@ stmt:       idebug
 block:      TOK_HNA4 hna4body
           | TOK_HNA6 hna6body
           | TOK_IPCCON ipcbody
-          | ifdblock ifbody
+          | ifdblock ifdbody
           | ifblock ifbody
           | plblock plbody
 ;
@@ -331,6 +331,20 @@ ifnicks:   | ifnicks ifnick
 ifbody:     TOK_OPEN ifstmts TOK_CLOSE
 ;
 
+ifdbody:     TOK_OPEN ifstmts TOK_CLOSE
+{
+  struct olsr_if *in = olsr_cnf->interfaces;
+  printf("\nInterface Defaults");
+  /*remove Interface Defaults from Interface list as they are no interface!*/
+  olsr_cnf->interfaces = in->next;
+  ifs_in_curr_cfg=0;
+  /*free interface but keep its config intact?*/
+  free(in->cnfi);
+  free(in);
+
+}
+;
+
 ifstmts:   | ifstmts ifstmt
 ;
 
@@ -390,6 +404,8 @@ ifdblock: TOK_INTERFACE_DEFAULTS
   in->next = olsr_cnf->interfaces;
   olsr_cnf->interfaces = in;
   ifs_in_curr_cfg=1;
+  
+  fflush(stdout);
 }
 ;