ARP/NDP does not send solicitation when no source address is available
[vpp.git] / vnet / vnet / ip / ip4_forward.c
index a50664c..08a1785 100644 (file)
@@ -103,6 +103,14 @@ find_ip4_fib_by_table_index_or_id (ip4_main_t * im,
   fib_index = table_index_or_id;
   if (! (flags & IP4_ROUTE_FLAG_FIB_INDEX))
     {
+      if (table_index_or_id == ~0) {
+        table_index_or_id = 0;
+        while ((p = hash_get (im->fib_index_by_table_id, table_index_or_id))) {
+          table_index_or_id++;
+        }
+        return create_fib_with_table_id (im, table_index_or_id);
+      }
+
       p = hash_get (im->fib_index_by_table_id, table_index_or_id);
       if (! p)
        return create_fib_with_table_id (im, table_index_or_id);
@@ -336,6 +344,8 @@ ip4_add_del_route_next_hop (ip4_main_t * im,
                {
                  /* Next hop is not known, so create indirect adj */
                  ip_adjacency_t add_adj;
+                 memset (&add_adj, 0, sizeof(add_adj));
+                 add_adj.n_adj = 1;
                  add_adj.lookup_next_index = IP_LOOKUP_NEXT_INDIRECT;
                  add_adj.indirect.next_hop.ip4.as_u32 = next_hop->as_u32;
                  add_adj.explicit_fib_index = explicit_fib_index;
@@ -624,6 +634,12 @@ void ip4_delete_matching_routes (ip4_main_t * im,
   ip4_maybe_remap_adjacencies (im, table_index_or_table_id, flags);
 }
 
+void
+ip4_forward_next_trace (vlib_main_t * vm,
+                        vlib_node_runtime_t * node,
+                        vlib_frame_t * frame,
+                        vlib_rx_or_tx_t which_adj_index);
+
 always_inline uword
 ip4_lookup_inline (vlib_main_t * vm,
                   vlib_node_runtime_t * node,
@@ -969,6 +985,9 @@ ip4_lookup_inline (vlib_main_t * vm,
       vlib_put_next_frame (vm, node, next, n_left_to_next);
     }
 
+  if (node->flags & VLIB_NODE_FLAG_TRACE)
+    ip4_forward_next_trace(vm, node, frame, VLIB_TX);
+
   return frame->n_vectors;
 }
 
@@ -1265,6 +1284,83 @@ ip4_sw_interface_admin_up_down (vnet_main_t * vnm,
  
 VNET_SW_INTERFACE_ADMIN_UP_DOWN_FUNCTION (ip4_sw_interface_admin_up_down);
 
+/* Built-in ip4 unicast rx feature path definition */
+VNET_IP4_UNICAST_FEATURE_INIT (ip4_inacl, static) = {
+  .node_name = "ip4-inacl", 
+  .runs_before = {"ip4-source-check-via-rx", 0}, 
+  .feature_index = &ip4_main.ip4_unicast_rx_feature_check_access,
+};
+
+VNET_IP4_UNICAST_FEATURE_INIT (ip4_source_check_1, static) = {
+  .node_name = "ip4-source-check-via-rx",
+  .runs_before = {"ip4-source-check-via-any", 0},
+  .feature_index = 
+  &ip4_main.ip4_unicast_rx_feature_source_reachable_via_rx,
+};
+
+VNET_IP4_UNICAST_FEATURE_INIT (ip4_source_check_2, static) = {
+  .node_name = "ip4-source-check-via-any",
+  .runs_before = {"ipsec-input-ip4", 0},
+  .feature_index = 
+  &ip4_main.ip4_unicast_rx_feature_source_reachable_via_any,
+};
+
+VNET_IP4_UNICAST_FEATURE_INIT (ip4_ipsec, static) = {
+  .node_name = "ipsec-input-ip4",
+  .runs_before = {"vpath-input-ip4", 0},
+  .feature_index = &ip4_main.ip4_unicast_rx_feature_ipsec,
+};
+
+VNET_IP4_UNICAST_FEATURE_INIT (ip4_vpath, static) = {
+  .node_name = "vpath-input-ip4",
+  .runs_before = {"ip4-lookup", 0},
+  .feature_index = &ip4_main.ip4_unicast_rx_feature_vpath,
+};
+
+VNET_IP4_UNICAST_FEATURE_INIT (ip4_lookup, static) = {
+  .node_name = "ip4-lookup",
+  .runs_before = {0}, /* not before any other features */
+  .feature_index = &ip4_main.ip4_unicast_rx_feature_lookup,
+};
+
+/* Built-in ip4 multicast rx feature path definition */
+VNET_IP4_MULTICAST_FEATURE_INIT (ip4_vpath_mc, static) = {
+  .node_name = "vpath-input-ip4",
+  .runs_before = {"ip4-lookup-multicast", 0},
+  .feature_index = &ip4_main.ip4_multicast_rx_feature_vpath,
+};
+
+VNET_IP4_MULTICAST_FEATURE_INIT (ip4_lookup_mc, static) = {
+  .node_name = "ip4-lookup-multicast",
+  .runs_before = {0}, /* not before any other features */
+  .feature_index = &ip4_main.ip4_multicast_rx_feature_lookup,
+};
+
+static char * feature_start_nodes[] = 
+  { "ip4-input", "ip4-input-no-checksum"};
+
+static clib_error_t *
+ip4_feature_init (vlib_main_t * vm, ip4_main_t * im)
+{
+  ip_lookup_main_t * lm = &im->lookup_main;
+  clib_error_t * error;
+  vnet_cast_t cast;
+
+  for (cast = 0; cast < VNET_N_CAST; cast++)
+    {
+      ip_config_main_t * cm = &lm->rx_config_mains[cast];
+      vnet_config_main_t * vcm = &cm->config_main;
+
+      if ((error = ip_feature_init_cast (vm, cm, vcm, 
+                                         feature_start_nodes,
+                                         ARRAY_LEN(feature_start_nodes),
+                                         cast,
+                                         1 /* is_ip4 */)))
+        return error;
+    }
+  return 0;
+}
+
 static clib_error_t *
 ip4_sw_interface_add_del (vnet_main_t * vnm,
                          u32 sw_if_index,
@@ -1274,57 +1370,31 @@ ip4_sw_interface_add_del (vnet_main_t * vnm,
   ip4_main_t * im = &ip4_main;
   ip_lookup_main_t * lm = &im->lookup_main;
   u32 ci, cast;
+  u32 feature_index;
 
   for (cast = 0; cast < VNET_N_CAST; cast++)
     {
       ip_config_main_t * cm = &lm->rx_config_mains[cast];
       vnet_config_main_t * vcm = &cm->config_main;
 
-      if (! vcm->node_index_by_feature_index)
-       {
-         if (cast == VNET_UNICAST)
-           {
-             static char * start_nodes[] = { "ip4-input", "ip4-input-no-checksum", };
-             static char * feature_nodes[] = {
-               [IP4_RX_FEATURE_CHECK_ACCESS] = "ip4-inacl",
-               [IP4_RX_FEATURE_SOURCE_CHECK_REACHABLE_VIA_RX] = "ip4-source-check-via-rx",
-               [IP4_RX_FEATURE_SOURCE_CHECK_REACHABLE_VIA_ANY] = "ip4-source-check-via-any",
-               [IP4_RX_FEATURE_IPSEC] = "ipsec-input-ip4",
-               [IP4_RX_FEATURE_VPATH] = "vpath-input-ip4",
-               [IP4_RX_FEATURE_LOOKUP] = "ip4-lookup",
-             };
-
-             vnet_config_init (vm, vcm,
-                               start_nodes, ARRAY_LEN (start_nodes),
-                               feature_nodes, ARRAY_LEN (feature_nodes));
-           }
-         else
-           {
-             static char * start_nodes[] = { "ip4-input", "ip4-input-no-checksum", };
-             static char * feature_nodes[] = {
-               [IP4_RX_FEATURE_VPATH] = "vpath-input-ip4",
-               [IP4_RX_FEATURE_LOOKUP] = "ip4-lookup-multicast",
-             };
-
-             vnet_config_init (vm, vcm,
-                               start_nodes, ARRAY_LEN (start_nodes),
-                               feature_nodes, ARRAY_LEN (feature_nodes));
-           }
-       }
-
       vec_validate_init_empty (cm->config_index_by_sw_if_index, sw_if_index, ~0);
       ci = cm->config_index_by_sw_if_index[sw_if_index];
 
+      if (cast == VNET_UNICAST)
+        feature_index = im->ip4_unicast_rx_feature_lookup;
+      else
+        feature_index = im->ip4_multicast_rx_feature_lookup;
+
       if (is_add)
        ci = vnet_config_add_feature (vm, vcm,
                                      ci,
-                                     IP4_RX_FEATURE_LOOKUP,
+                                      feature_index,
                                      /* config data */ 0,
                                      /* # bytes of config data */ 0);
       else
        ci = vnet_config_del_feature (vm, vcm,
                                      ci,
-                                     IP4_RX_FEATURE_LOOKUP,
+                                      feature_index,
                                      /* config data */ 0,
                                      /* # bytes of config data */ 0);
 
@@ -1336,16 +1406,21 @@ ip4_sw_interface_add_del (vnet_main_t * vnm,
 
 VNET_SW_INTERFACE_ADD_DEL_FUNCTION (ip4_sw_interface_add_del);
 
+static u8 * format_ip4_lookup_trace (u8 * s, va_list * args);
 
 VLIB_REGISTER_NODE (ip4_lookup_node) = {
   .function = ip4_lookup,
   .name = "ip4-lookup",
   .vector_size = sizeof (u32),
 
-  .n_next_nodes = IP_LOOKUP_N_NEXT,
+  .format_trace = format_ip4_lookup_trace,
+
+  .n_next_nodes = IP4_LOOKUP_N_NEXT,
   .next_nodes = IP4_LOOKUP_NEXT_NODES,
 };
 
+VLIB_NODE_FUNCTION_MULTIARCH (ip4_lookup_node, ip4_lookup)
+
 static uword
 ip4_indirect (vlib_main_t * vm,
                vlib_node_runtime_t * node,
@@ -1360,11 +1435,14 @@ VLIB_REGISTER_NODE (ip4_indirect_node) = {
   .function = ip4_indirect,
   .name = "ip4-indirect",
   .vector_size = sizeof (u32),
+  .sibling_of = "ip4-lookup",
+  .format_trace = format_ip4_lookup_trace,
 
-  .n_next_nodes = IP_LOOKUP_N_NEXT,
-  .next_nodes = IP4_LOOKUP_NEXT_NODES,
+  .n_next_nodes = 0,
 };
 
+VLIB_NODE_FUNCTION_MULTIARCH (ip4_indirect_node, ip4_indirect)
+
 
 /* Global IP4 main. */
 ip4_main_t ip4_main;
@@ -1423,6 +1501,8 @@ ip4_lookup_init (vlib_main_t * vm)
                               "ip4 arp");
   }
 
+  ip4_feature_init (vm, im);
+
   return 0;
 }
 
@@ -1439,33 +1519,52 @@ typedef struct {
 } ip4_forward_next_trace_t;
 
 static u8 * format_ip4_forward_next_trace (u8 * s, va_list * args)
+{
+  CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
+  CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
+  ip4_forward_next_trace_t * t = va_arg (*args, ip4_forward_next_trace_t *);
+  uword indent = format_get_indent (s);
+  s = format (s, "%U%U",
+                format_white_space, indent,
+                format_ip4_header, t->packet_data);
+  return s;
+}
+
+static u8 * format_ip4_lookup_trace (u8 * s, va_list * args)
 {
   CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
   CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
   ip4_forward_next_trace_t * t = va_arg (*args, ip4_forward_next_trace_t *);
   vnet_main_t * vnm = vnet_get_main();
   ip4_main_t * im = &ip4_main;
-  ip_adjacency_t * adj;
   uword indent = format_get_indent (s);
 
-  adj = ip_get_adjacency (&im->lookup_main, t->adj_index);
   s = format (s, "fib %d adj-idx %d : %U flow hash: 0x%08x",
-             t->fib_index, t->adj_index, format_ip_adjacency,
-             vnm, &im->lookup_main, t->adj_index, t->flow_hash);
-  switch (adj->lookup_next_index)
-    {
-    case IP_LOOKUP_NEXT_REWRITE:
-      s = format (s, "\n%U%U",
-                 format_white_space, indent,
-                 format_ip_adjacency_packet_data,
-                 vnm, &im->lookup_main, t->adj_index,
-                 t->packet_data, sizeof (t->packet_data));
-      break;
+              t->fib_index, t->adj_index, format_ip_adjacency,
+              vnm, &im->lookup_main, t->adj_index, t->flow_hash);
+  s = format (s, "\n%U%U",
+              format_white_space, indent,
+              format_ip4_header, t->packet_data);
+  return s;
+}
 
-    default:
-      break;
-    }
+static u8 * format_ip4_rewrite_trace (u8 * s, va_list * args)
+{
+  CLIB_UNUSED (vlib_main_t * vm) = va_arg (*args, vlib_main_t *);
+  CLIB_UNUSED (vlib_node_t * node) = va_arg (*args, vlib_node_t *);
+  ip4_forward_next_trace_t * t = va_arg (*args, ip4_forward_next_trace_t *);
+  vnet_main_t * vnm = vnet_get_main();
+  ip4_main_t * im = &ip4_main;
+  uword indent = format_get_indent (s);
 
+  s = format (s, "tx_sw_if_index %d adj-idx %d : %U flow hash: 0x%08x",
+              t->fib_index, t->adj_index, format_ip_adjacency,
+              vnm, &im->lookup_main, t->adj_index, t->flow_hash);
+  s = format (s, "\n%U%U",
+              format_white_space, indent,
+              format_ip_adjacency_packet_data,
+              vnm, &im->lookup_main, t->adj_index,
+              t->packet_data, sizeof (t->packet_data));
   return s;
 }
 
@@ -1503,8 +1602,11 @@ ip4_forward_next_trace (vlib_main_t * vm,
          t0 = vlib_add_trace (vm, node, b0, sizeof (t0[0]));
          t0->adj_index = vnet_buffer (b0)->ip.adj_index[which_adj_index];
          t0->flow_hash = vnet_buffer (b0)->ip.flow_hash;
-         t0->fib_index = vec_elt (im->fib_index_by_sw_if_index, 
-                             vnet_buffer(b0)->sw_if_index[VLIB_RX]);
+         t0->fib_index = (vnet_buffer(b0)->sw_if_index[VLIB_TX] != (u32)~0) ?
+             vnet_buffer(b0)->sw_if_index[VLIB_TX] :
+             vec_elt (im->fib_index_by_sw_if_index,
+                      vnet_buffer(b0)->sw_if_index[VLIB_RX]);
+
          clib_memcpy (t0->packet_data,
                  vlib_buffer_get_current (b0),
                  sizeof (t0->packet_data));
@@ -1514,8 +1616,10 @@ ip4_forward_next_trace (vlib_main_t * vm,
          t1 = vlib_add_trace (vm, node, b1, sizeof (t1[0]));
          t1->adj_index = vnet_buffer (b1)->ip.adj_index[which_adj_index];
          t1->flow_hash = vnet_buffer (b1)->ip.flow_hash;
-         t1->fib_index = vec_elt (im->fib_index_by_sw_if_index, 
-                             vnet_buffer(b1)->sw_if_index[VLIB_RX]);
+         t1->fib_index = (vnet_buffer(b1)->sw_if_index[VLIB_TX] != (u32)~0) ?
+             vnet_buffer(b1)->sw_if_index[VLIB_TX] :
+             vec_elt (im->fib_index_by_sw_if_index,
+                      vnet_buffer(b1)->sw_if_index[VLIB_RX]);
          clib_memcpy (t1->packet_data,
                  vlib_buffer_get_current (b1),
                  sizeof (t1->packet_data));
@@ -1539,8 +1643,10 @@ ip4_forward_next_trace (vlib_main_t * vm,
          t0 = vlib_add_trace (vm, node, b0, sizeof (t0[0]));
          t0->adj_index = vnet_buffer (b0)->ip.adj_index[which_adj_index];
          t0->flow_hash = vnet_buffer (b0)->ip.flow_hash;
-         t0->fib_index = vec_elt (im->fib_index_by_sw_if_index, 
-                             vnet_buffer(b0)->sw_if_index[VLIB_RX]);
+         t0->fib_index = (vnet_buffer(b0)->sw_if_index[VLIB_TX] != (u32)~0) ?
+             vnet_buffer(b0)->sw_if_index[VLIB_TX] :
+             vec_elt (im->fib_index_by_sw_if_index,
+                      vnet_buffer(b0)->sw_if_index[VLIB_RX]);
          clib_memcpy (t0->packet_data,
                  vlib_buffer_get_current (b0),
                  sizeof (t0->packet_data));
@@ -1604,6 +1710,8 @@ VLIB_REGISTER_NODE (ip4_drop_node,static) = {
   },
 };
 
+VLIB_NODE_FUNCTION_MULTIARCH (ip4_drop_node, ip4_drop)
+
 VLIB_REGISTER_NODE (ip4_punt_node,static) = {
   .function = ip4_punt,
   .name = "ip4-punt",
@@ -1617,6 +1725,8 @@ VLIB_REGISTER_NODE (ip4_punt_node,static) = {
   },
 };
 
+VLIB_NODE_FUNCTION_MULTIARCH (ip4_punt_node, ip4_punt)
+
 VLIB_REGISTER_NODE (ip4_miss_node,static) = {
   .function = ip4_miss,
   .name = "ip4-miss",
@@ -1630,6 +1740,8 @@ VLIB_REGISTER_NODE (ip4_miss_node,static) = {
   },
 };
 
+VLIB_NODE_FUNCTION_MULTIARCH (ip4_miss_node, ip4_miss)
+
 /* Compute TCP/UDP/ICMP4 checksum in software. */
 u16
 ip4_tcp_udp_compute_checksum (vlib_main_t * vm, vlib_buffer_t * p0,
@@ -1765,8 +1877,10 @@ ip4_local (vlib_main_t * vm,
          leaf0 = ip4_fib_mtrie_lookup_step (mtrie0, leaf0, &ip0->src_address, 0);
          leaf1 = ip4_fib_mtrie_lookup_step (mtrie1, leaf1, &ip1->src_address, 0);
 
-         proto0 = ip0->protocol;
-         proto1 = ip1->protocol;
+         /* Treat IP frag packets as "experimental" protocol for now
+            until support of IP frag reassembly is implemented */
+         proto0 = ip4_is_fragment(ip0) ? 0xfe : ip0->protocol;
+         proto1 = ip4_is_fragment(ip1) ? 0xfe : ip1->protocol;
          is_udp0 = proto0 == IP_PROTOCOL_UDP;
          is_udp1 = proto1 == IP_PROTOCOL_UDP;
          is_tcp_udp0 = is_udp0 || proto0 == IP_PROTOCOL_TCP;
@@ -1958,7 +2072,9 @@ ip4_local (vlib_main_t * vm,
 
          leaf0 = ip4_fib_mtrie_lookup_step (mtrie0, leaf0, &ip0->src_address, 0);
 
-         proto0 = ip0->protocol;
+         /* Treat IP frag packets as "experimental" protocol for now
+            until support of IP frag reassembly is implemented */
+         proto0 = ip4_is_fragment(ip0) ? 0xfe : ip0->protocol;
          is_udp0 = proto0 == IP_PROTOCOL_UDP;
          is_tcp_udp0 = is_udp0 || proto0 == IP_PROTOCOL_TCP;
 
@@ -2068,6 +2184,8 @@ VLIB_REGISTER_NODE (ip4_local_node,static) = {
   },
 };
 
+VLIB_NODE_FUNCTION_MULTIARCH (ip4_local_node, ip4_local)
+
 void ip4_register_protocol (u32 protocol, u32 node_index)
 {
   vlib_main_t * vm = vlib_get_main();
@@ -2255,7 +2373,12 @@ ip4_arp (vlib_main_t * vm,
            clib_memcpy (h0->ip4_over_ethernet[0].ethernet, hw_if0->hw_address,
                    sizeof (h0->ip4_over_ethernet[0].ethernet));
 
-           ip4_src_address_for_packet (im, p0, &h0->ip4_over_ethernet[0].ip4, sw_if_index0);
+           if (ip4_src_address_for_packet (im, p0, &h0->ip4_over_ethernet[0].ip4, sw_if_index0)) {
+               //No source address available
+               p0->error = node->errors[IP4_ARP_ERROR_NO_SOURCE_ADDRESS];
+               vlib_buffer_free(vm, &bi0, 1);
+               continue;
+           }
 
            /* Copy in destination address we are requesting. */
            h0->ip4_over_ethernet[1].ip4.data_u32 = ip0->dst_address.data_u32;
@@ -2282,6 +2405,7 @@ static char * ip4_arp_error_strings[] = {
   [IP4_ARP_ERROR_NON_ARP_ADJ] = "ARPs to non-ARP adjacencies",
   [IP4_ARP_ERROR_REPLICATE_DROP] = "ARP replication completed",
   [IP4_ARP_ERROR_REPLICATE_FAIL] = "ARP replication failed",
+  [IP4_ARP_ERROR_NO_SOURCE_ADDRESS] = "no source address for ARP request",
 };
 
 VLIB_REGISTER_NODE (ip4_arp_node) = {
@@ -2523,6 +2647,15 @@ ip4_rewrite_inline (vlib_main_t * vm,
           /* Worth pipelining. No guarantee that adj0,1 are hot... */
          rw_len0 = adj0[0].rewrite_header.data_bytes;
          rw_len1 = adj1[0].rewrite_header.data_bytes;
+
+          /* Check MTU of outgoing interface. */
+          error0 = (vlib_buffer_length_in_chain (vm, p0) > adj0[0].rewrite_header.max_l3_packet_bytes
+                    ? IP4_ERROR_MTU_EXCEEDED
+                    : error0);
+          error1 = (vlib_buffer_length_in_chain (vm, p1) > adj1[0].rewrite_header.max_l3_packet_bytes
+                    ? IP4_ERROR_MTU_EXCEEDED
+                    : error1);
+
          next0 = (error0 == IP4_ERROR_NONE) 
             ? adj0[0].rewrite_header.next_index : 0;
 
@@ -2552,14 +2685,6 @@ ip4_rewrite_inline (vlib_main_t * vm,
                    /* packet increment */ 0,
                    /* byte increment */ rw_len1-sizeof(ethernet_header_t));
 
-         /* Check MTU of outgoing interface. */
-         error0 = (vlib_buffer_length_in_chain (vm, p0) > adj0[0].rewrite_header.max_l3_packet_bytes
-                   ? IP4_ERROR_MTU_EXCEEDED
-                   : error0);
-         error1 = (vlib_buffer_length_in_chain (vm, p1) > adj1[0].rewrite_header.max_l3_packet_bytes
-                   ? IP4_ERROR_MTU_EXCEEDED
-                   : error1);
-
          p0->current_data -= rw_len0;
          p1->current_data -= rw_len1;
 
@@ -2726,7 +2851,7 @@ VLIB_REGISTER_NODE (ip4_rewrite_node) = {
   .name = "ip4-rewrite-transit",
   .vector_size = sizeof (u32),
 
-  .format_trace = format_ip4_forward_next_trace,
+  .format_trace = format_ip4_rewrite_trace,
 
   .n_next_nodes = 2,
   .next_nodes = {
@@ -2735,22 +2860,22 @@ VLIB_REGISTER_NODE (ip4_rewrite_node) = {
   },
 };
 
-VLIB_REGISTER_NODE (ip4_rewrite_local_node,static) = {
+VLIB_NODE_FUNCTION_MULTIARCH (ip4_rewrite_node, ip4_rewrite_transit)
+
+VLIB_REGISTER_NODE (ip4_rewrite_local_node) = {
   .function = ip4_rewrite_local,
   .name = "ip4-rewrite-local",
   .vector_size = sizeof (u32),
 
   .sibling_of = "ip4-rewrite-transit",
 
-  .format_trace = format_ip4_forward_next_trace,
+  .format_trace = format_ip4_rewrite_trace,
 
-  .n_next_nodes = 2,
-  .next_nodes = {
-    [IP4_REWRITE_NEXT_DROP] = "error-drop",
-    [IP4_REWRITE_NEXT_ARP] = "ip4-arp",
-  },
+  .n_next_nodes = 0,
 };
 
+VLIB_NODE_FUNCTION_MULTIARCH (ip4_rewrite_local_node, ip4_rewrite_local)
+
 static clib_error_t *
 add_del_interface_table (vlib_main_t * vm,
                         unformat_input_t * input,
@@ -3012,6 +3137,9 @@ ip4_lookup_multicast (vlib_main_t * vm,
       vlib_put_next_frame (vm, node, next, n_left_to_next);
     }
 
+  if (node->flags & VLIB_NODE_FLAG_TRACE)
+      ip4_forward_next_trace(vm, node, frame, VLIB_TX);
+
   return frame->n_vectors;
 }
 
@@ -3019,11 +3147,14 @@ VLIB_REGISTER_NODE (ip4_lookup_multicast_node,static) = {
   .function = ip4_lookup_multicast,
   .name = "ip4-lookup-multicast",
   .vector_size = sizeof (u32),
+  .sibling_of = "ip4-lookup",
+  .format_trace = format_ip4_lookup_trace,
 
-  .n_next_nodes = IP_LOOKUP_N_NEXT,
-  .next_nodes = IP4_LOOKUP_NEXT_NODES,
+  .n_next_nodes = 0,
 };
 
+VLIB_NODE_FUNCTION_MULTIARCH (ip4_lookup_multicast_node, ip4_lookup_multicast)
+
 VLIB_REGISTER_NODE (ip4_multicast_node,static) = {
   .function = ip4_drop,
   .name = "ip4-multicast",