- clib_warning ("no resolving interface for %U", format_ip46_address,
- &rmt->ip, (rmt->is_ip4 == 0) + 1);
- return -1;
+ /* Find a FIB path to the destination */
+ clib_memcpy_fast (&prefix.fp_addr, &rmt->ip, sizeof (rmt->ip));
+ prefix.fp_proto = rmt->is_ip4 ? FIB_PROTOCOL_IP4 : FIB_PROTOCOL_IP6;
+ prefix.fp_len = rmt->is_ip4 ? 32 : 128;
+
+ ASSERT (rmt->fib_index != ENDPOINT_INVALID_INDEX);
+ fei = fib_table_lookup (rmt->fib_index, &prefix);
+
+ /* Couldn't find route to destination. Bail out. */
+ if (fei == FIB_NODE_INDEX_INVALID)
+ return clib_error_return (0, "no route to %U", format_ip46_address,
+ &rmt->ip, (rmt->is_ip4 == 0) + 1);
+
+ sw_if_index = fib_entry_get_resolving_interface (fei);
+ if (sw_if_index == ENDPOINT_INVALID_INDEX)
+ return clib_error_return (0, "no resolving interface for %U",
+ format_ip46_address, &rmt->ip,
+ (rmt->is_ip4 == 0) + 1);