Switch on gateway output at all debug levels for easier testing
authorHenning Rogge <hrogge@googlemail.com>
Wed, 6 Jan 2010 20:34:28 +0000 (21:34 +0100)
committerHenning Rogge <hrogge@googlemail.com>
Wed, 6 Jan 2010 20:34:28 +0000 (21:34 +0100)
src/hna_set.c
src/olsr.c

index aeef43d..97317da 100644 (file)
@@ -438,17 +438,16 @@ olsr_input_hna(union olsr_message *m, struct interface *in_if __attribute__ ((un
     if (olsr_cnf->smart_gateway_active && olsr_is_smart_gateway(&net, &mask)) {
       olsr_set_gateway(&originator, &mask);
     }
-    else {
-      prefixlen = olsr_netmask_to_prefix(&mask);
-      if (olsr_cnf->smart_gateway_active && prefixlen <= MAXIMUM_GATEWAY_PREFIX_LENGTH) {
-        continue;
-      }
 
-      entry = ip_prefix_list_find(olsr_cnf->hna_entries, &net, prefixlen);
-      if (entry == NULL) {
-        /* only update if it's not from us */
-        olsr_update_hna_entry(&originator, &net, prefixlen, vtime);
-      }
+    prefixlen = olsr_netmask_to_prefix(&mask);
+    if (olsr_cnf->smart_gateway_active && prefixlen > 0 && prefixlen <= MAXIMUM_GATEWAY_PREFIX_LENGTH) {
+      continue;
+    }
+
+    entry = ip_prefix_list_find(olsr_cnf->hna_entries, &net, prefixlen);
+    if (entry == NULL) {
+      /* only update if it's not from us */
+      olsr_update_hna_entry(&originator, &net, prefixlen, vtime);
     }
   }
 #else
index 5b5d8f1..4b154c1 100644 (file)
@@ -202,7 +202,6 @@ olsr_process_changes(void)
   if (olsr_cnf->debug_level > 0) {
     if (olsr_cnf->debug_level > 2) {
       olsr_print_mid_set();
-      olsr_print_gateway();
 
       if (olsr_cnf->debug_level > 3) {
         if (olsr_cnf->debug_level > 8) {
@@ -216,6 +215,9 @@ olsr_process_changes(void)
     olsr_print_neighbor_table();
     olsr_print_two_hop_neighbor_table();
     olsr_print_tc_table();
+
+    // TODO push this to debug level 3 or 4
+    olsr_print_gateway();
 #endif
   }