tcp: avoid fr segments less than mss if possible
[vpp.git] / src / vnet / l2 / l2_arp_term.c
index 982fd9f..eed9b7a 100644 (file)
 #include <vnet/l2/feat_bitmap.h>
 
 #include <vnet/ip/ip4_packet.h>
+#include <vnet/ip/ip6_packet.h>
+#include <vnet/ip/icmp6.h>
+#include <vnet/ip/ip6.h>
+#include <vnet/ip/ip.api_enum.h>
+#include <vnet/ip/format.h>
 #include <vnet/ethernet/arp_packet.h>
 
 static const u8 vrrp_prefix[] = { 0x00, 0x00, 0x5E, 0x00, 0x01 };
@@ -285,6 +290,9 @@ arp_term_l2bd (vlib_main_t * vm,
          ethertype0 = clib_net_to_host_u16 (*(u16 *) (l3h0 - 2));
          arp0 = (ethernet_arp_header_t *) l3h0;
 
+         if (p0->flags & VNET_BUFFER_F_LOCALLY_ORIGINATED)
+           goto next_l2_feature;
+
          if (ethertype0 != ETHERNET_TYPE_ARP)
            goto check_ip6_nd;
 
@@ -328,8 +336,8 @@ arp_term_l2bd (vlib_main_t * vm,
              || ethernet_address_cast (arp0->ip4_over_ethernet[0].mac.bytes))
            {
              /* VRRP virtual MAC may be different to SMAC in ARP reply */
-             if (!ethernet_mac_address_equal
-                 (arp0->ip4_over_ethernet[0].mac.bytes, vrrp_prefix))
+             if (clib_memcmp (arp0->ip4_over_ethernet[0].mac.bytes,
+                              vrrp_prefix, sizeof (vrrp_prefix)) != 0)
                {
                  error0 = ETHERNET_ARP_ERROR_l2_address_mismatch;
                  goto drop;
@@ -377,7 +385,7 @@ arp_term_l2bd (vlib_main_t * vm,
          /* For BVI, need to use l2-fwd node to send ARP reply as
             l2-output node cannot output packet to BVI properly */
          cfg0 = vec_elt_at_index (l2im->configs, sw_if_index0);
-         if (PREDICT_FALSE (cfg0->bvi))
+         if (PREDICT_FALSE (l2_input_is_bvi (cfg0)))
            {
              vnet_buffer (p0)->l2.feature_bitmap |= L2INPUT_FEAT_FWD;
              vnet_buffer (p0)->sw_if_index[VLIB_RX] = 0;
@@ -441,7 +449,6 @@ arp_term_l2bd (vlib_main_t * vm,
   return frame->n_vectors;
 }
 
-/* *INDENT-OFF* */
 VLIB_REGISTER_NODE (arp_term_l2bd_node, static) = {
   .function = arp_term_l2bd,
   .name = "arp-term-l2bd",
@@ -456,7 +463,6 @@ VLIB_REGISTER_NODE (arp_term_l2bd_node, static) = {
   .format_buffer = format_ethernet_arp_header,
   .format_trace = format_arp_term_input_trace,
 };
-/* *INDENT-ON* */
 
 clib_error_t *
 arp_term_init (vlib_main_t * vm)