misc: check return values from vlib_buffer_copy(...)
[vpp.git] / src / vnet / ip6-nd / ip6_ra.c
index c8e16d0..af82a06 100644 (file)
@@ -1219,6 +1219,9 @@ check_send_rs (vlib_main_t * vm, ip6_ra_t * radv_info, f64 current_time,
   next_index = ip6_rewrite_mcast_node.index;
 
   c0 = vlib_buffer_copy (vm, p0);
+  if (c0 == NULL)
+    return radv_info->keep_sending_rs;
+
   ci0 = vlib_get_buffer_index (vm, c0);
 
   f = vlib_get_frame_to_node (vm, next_index);
@@ -1947,34 +1950,28 @@ ip6_ra_cmd (vlib_main_t * vm,
                         unformat_ip6_address, &ip6_addr, &addr_len))
        {
          add_radv_info = 0;
-         break;
        }
       else if (unformat (line_input, "ra-managed-config-flag"))
        {
          managed = 1;
-         break;
        }
       else if (unformat (line_input, "ra-other-config-flag"))
        {
          other = 1;
-         break;
        }
       else if (unformat (line_input, "ra-suppress") ||
               unformat (line_input, "ra-surpress"))
        {
          suppress = 1;
-         break;
        }
       else if (unformat (line_input, "ra-suppress-link-layer") ||
               unformat (line_input, "ra-surpress-link-layer"))
        {
          suppress_ll_option = 1;
-         break;
        }
       else if (unformat (line_input, "ra-send-unicast"))
        {
          send_unicast = 1;
-         break;
        }
       else if (unformat (line_input, "ra-lifetime"))
        {
@@ -1984,7 +1981,6 @@ ip6_ra_cmd (vlib_main_t * vm,
              goto done;
            }
          use_lifetime = 1;
-         break;
        }
       else if (unformat (line_input, "ra-initial"))
        {
@@ -1994,7 +1990,6 @@ ip6_ra_cmd (vlib_main_t * vm,
              error = unformat_parse_error (line_input);
              goto done;
            }
-         break;
        }
       else if (unformat (line_input, "ra-interval"))
        {
@@ -2006,12 +2001,10 @@ ip6_ra_cmd (vlib_main_t * vm,
 
          if (!unformat (line_input, "%d", &ra_min_interval))
            ra_min_interval = 0;
-         break;
        }
       else if (unformat (line_input, "ra-cease"))
        {
          cease = 1;
-         break;
        }
       else
        {