From 797235a6aacccdb1503374439e91eca245b48294 Mon Sep 17 00:00:00 2001 From: Neale Ranns Date: Mon, 9 Jan 2017 14:33:38 +0100 Subject: Fix ARP on unnumbered interfaces (VPP-583) Change-Id: Iea1e2c31c016c3bb6344f73173d082a2c548ffee Signed-off-by: Neale Ranns --- src/vnet/ethernet/arp.c | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/vnet/ethernet') diff --git a/src/vnet/ethernet/arp.c b/src/vnet/ethernet/arp.c index b388e778ac8..0298541bb46 100644 --- a/src/vnet/ethernet/arp.c +++ b/src/vnet/ethernet/arp.c @@ -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) -- cgit 1.2.3-korg