Return an error if the ip6_interface_first_address decides to return NULL.
Change-Id: Iea0184382b8fbe2af81a781c3671687a1fbb5b32
Signed-off-by: Andrew Yourtchenko <ayourtch@gmail.com>
/* Fill in the correct source now */
ip6_address_t *a = ip6_interface_first_address (im, sw_if_index);
+ if (!a)
+ {
+ vlib_buffer_free (vm, &bi0, 1);
+ return SEND_PING_NO_SRC_ADDRESS;
+ }
h0->ip6.src_address = a[0];
/* Fill in icmp fields */
SEND_PING_ALLOC_FAIL,
SEND_PING_NO_INTERFACE,
SEND_PING_NO_TABLE,
+ SEND_PING_NO_SRC_ADDRESS,
} send_ip46_ping_result_t;
/*