Changing the IP table for an interface is an error if the interface already has an...
[vpp.git] / src / vnet / ip / ip6_neighbor.c
index 7229591..91ff224 100644 (file)
@@ -24,6 +24,7 @@
 #include <vnet/adj/adj_mcast.h>
 #include <vnet/fib/fib_table.h>
 #include <vnet/fib/ip6_fib.h>
+#include <vnet/mfib/ip6_mfib.h>
 
 /**
  * @file
@@ -2923,7 +2924,10 @@ ip6_neighbor_cmd (vlib_main_t * vm, unformat_input_t * main_input,
       else if (unformat (line_input, "ra-lifetime"))
        {
          if (!unformat (line_input, "%d", &ra_lifetime))
-           return (error = unformat_parse_error (line_input));
+           {
+             error = unformat_parse_error (line_input);
+             goto done;
+           }
          use_lifetime = 1;
          break;
        }
@@ -2931,13 +2935,19 @@ ip6_neighbor_cmd (vlib_main_t * vm, unformat_input_t * main_input,
        {
          if (!unformat
              (line_input, "%d %d", &ra_initial_count, &ra_initial_interval))
-           return (error = unformat_parse_error (line_input));
+           {
+             error = unformat_parse_error (line_input);
+             goto done;
+           }
          break;
        }
       else if (unformat (line_input, "ra-interval"))
        {
          if (!unformat (line_input, "%d", &ra_max_interval))
-           return (error = unformat_parse_error (line_input));
+           {
+             error = unformat_parse_error (line_input);
+             goto done;
+           }
 
          if (!unformat (line_input, "%d", &ra_min_interval))
            ra_min_interval = 0;
@@ -2949,7 +2959,10 @@ ip6_neighbor_cmd (vlib_main_t * vm, unformat_input_t * main_input,
          break;
        }
       else
-       return (unformat_parse_error (line_input));
+       {
+         error = unformat_parse_error (line_input);
+         goto done;
+       }
     }
 
   if (add_radv_info)
@@ -3006,7 +3019,10 @@ ip6_neighbor_cmd (vlib_main_t * vm, unformat_input_t * main_input,
          else if (unformat (line_input, "no-onlink"))
            no_onlink = 1;
          else
-           return (unformat_parse_error (line_input));
+           {
+             error = unformat_parse_error (line_input);
+             goto done;
+           }
        }
 
       ip6_neighbor_ra_prefix (vm, sw_if_index,
@@ -3018,9 +3034,9 @@ ip6_neighbor_cmd (vlib_main_t * vm, unformat_input_t * main_input,
                              off_link, no_autoconfig, no_onlink, is_no);
     }
 
+done:
   unformat_free (line_input);
 
-done:
   return error;
 }
 
@@ -3268,6 +3284,7 @@ disable_ip6_interface (vlib_main_t * vm, u32 sw_if_index)
 
          ip6_neighbor_sw_interface_add_del (vnm, sw_if_index,
                                             0 /* is_add */ );
+         ip6_mfib_interface_enable_disable (sw_if_index, 0);
        }
     }
   return error;
@@ -3354,6 +3371,8 @@ enable_ip6_interface (vlib_main_t * vm, u32 sw_if_index)
                      link_local_address.as_u8[8] &= 0xfd;
                    }
 
+                 ip6_mfib_interface_enable_disable (sw_if_index, 1);
+
                  /* essentially "enables" ipv6 on this interface */
                  error = ip6_add_del_interface_address (vm, sw_if_index,
                                                         &link_local_address,