Fix ARP on unnumbered interfaces (VPP-583) 54/4654/2
authorNeale Ranns <neale.ranns@cisco.com>
Mon, 9 Jan 2017 13:33:38 +0000 (14:33 +0100)
committerNeale Ranns <nranns@cisco.com>
Thu, 12 Jan 2017 12:42:02 +0000 (12:42 +0000)
Change-Id: Iea1e2c31c016c3bb6344f73173d082a2c548ffee
Signed-off-by: Neale Ranns <neale.ranns@cisco.com>
src/vnet/ethernet/arp.c

index b388e77..0298541 100644 (file)
@@ -1043,12 +1043,25 @@ arp_input (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
          src_flags = fib_entry_get_flags (src_fei);
 
          if (!((FIB_ENTRY_FLAG_ATTACHED & src_flags) ||
-               (FIB_ENTRY_FLAG_CONNECTED & src_flags)) ||
-             sw_if_index0 != fib_entry_get_resolving_interface (src_fei))
+               (FIB_ENTRY_FLAG_CONNECTED & src_flags)))
            {
+             /*
+              * The packet was sent from an address that is not connected nor attached
+              * i.e. it is not from an address that is covered by a link's sub-net,
+              * nor is it a already learned host resp.
+              */
              error0 = ETHERNET_ARP_ERROR_l3_src_address_not_local;
              goto drop2;
            }
+         if (sw_if_index0 != fib_entry_get_resolving_interface (src_fei))
+           {
+             /*
+              * The interface the ARP was received on is not the interface
+              * on which the covering prefix is configured. Maybe this is a case
+              * for unnumbered.
+              */
+             is_unnum0 = 1;
+           }
 
          /* Reject requests/replies with our local interface address. */
          if (FIB_ENTRY_FLAG_LOCAL & src_flags)