misc: move to new pool_foreach macros
[vpp.git] / src / plugins / map / map.c
index a8288a5..938793c 100644 (file)
@@ -97,9 +97,6 @@ map_free_extras (u32 map_domain_index)
     return;
 
   de = vec_elt_at_index (mm->domain_extras, map_domain_index);
-  if (!de)
-    return;
-
   vec_free (de->tag);
 }
 
@@ -554,7 +551,7 @@ map_add_domain_command_fn (vlib_main_t * vm,
        num_m_args++;
       else if (unformat (line_input, "mtu %d", &mtu))
        num_m_args++;
-      else if (unformat (line_input, "tag %v", &tag))
+      else if (unformat (line_input, "tag %s", &tag))
        ;
       else
        {
@@ -576,6 +573,7 @@ map_add_domain_command_fn (vlib_main_t * vm,
                     mtu, flags, tag);
 
 done:
+  vec_free (tag);
   unformat_free (line_input);
 
   return error;
@@ -982,8 +980,8 @@ show_map_domain_command_fn (vlib_main_t * vm, unformat_input_t * input,
   if (!unformat_user (input, unformat_line_input, line_input))
     {
       /* *INDENT-OFF* */
-      pool_foreach(d, mm->domains,
-       ({vlib_cli_output(vm, "%U", format_map_domain, d, counters);}));
+      pool_foreach (d, mm->domains)
+        {vlib_cli_output(vm, "%U", format_map_domain, d, counters);}
       /* *INDENT-ON* */
       return 0;
     }
@@ -1011,8 +1009,8 @@ show_map_domain_command_fn (vlib_main_t * vm, unformat_input_t * input,
   if (map_domain_index == ~0)
     {
       /* *INDENT-OFF* */
-      pool_foreach(d, mm->domains,
-       ({vlib_cli_output(vm, "%U", format_map_domain, d, counters);}));
+      pool_foreach (d, mm->domains)
+        {vlib_cli_output(vm, "%U", format_map_domain, d, counters);}
       /* *INDENT-ON* */
     }
   else
@@ -1065,14 +1063,14 @@ show_map_stats_command_fn (vlib_main_t * vm, unformat_input_t * input,
     }
 
   /* *INDENT-OFF* */
-  pool_foreach(d, mm->domains, ({
+  pool_foreach (d, mm->domains)  {
     if (d->rules) {
       rulecount+= 0x1 << d->psid_length;
       rules += sizeof(ip6_address_t) * 0x1 << d->psid_length;
     }
     domains += sizeof(*d);
     domaincount++;
-  }));
+  }
   /* *INDENT-ON* */
 
   vlib_cli_output (vm, "MAP domains structure: %d\n", sizeof (map_domain_t));