Restore punt/inject after FIB2.0
[vpp.git] / vnet / vnet / unix / tuntap.c
index 13520d2..4eab391 100644 (file)
@@ -389,7 +389,7 @@ tuntap_rx (vlib_main_t * vm,
           next_index = VNET_DEVICE_INPUT_NEXT_DROP;
       }
 
-    vnet_feature_device_input_redirect_x1 (node, tm->hw_if_index, &next_index, b, 0);
+    vnet_feature_start_device_input_x1 (tm->sw_if_index, &next_index, b, 0);
 
     vlib_set_next_frame_buffer (vm, node, next_index, bi);
 
@@ -753,6 +753,12 @@ tuntap_ip4_add_del_interface_address (ip4_main_t * im,
   snprintf (ifr.ifr_name, sizeof(ifr.ifr_name), 
             "%s:%d", tm->tun_name, (int)(ap - tm->subifs));
 
+  /* the tuntap punt/inject is enabled for IPv4 RX so long as
+   * any vpp interface has an IPv4 address.
+   * this is also ref counted.
+   */
+  ip4_sw_interface_enable_disable (tm->sw_if_index, !is_delete);
+
   if (! is_delete)
     {
       struct sockaddr_in * sin;
@@ -856,6 +862,12 @@ tuntap_ip6_add_del_interface_address (ip6_main_t * im,
   snprintf (ifr.ifr_name, sizeof(ifr.ifr_name), 
             "%s:%d", tm->tun_name, (int)(ap - tm->subifs));
 
+  /* the tuntap punt/inject is enabled for IPv6 RX so long as
+   * any vpp interface has an IPv6 address.
+   * this is also ref counted.
+   */
+  ip6_sw_interface_enable_disable (tm->sw_if_index, !is_delete);
+
   if (! is_delete)
     {
       int sockfd = socket (AF_INET6, SOCK_STREAM, 0);