arp: handle ARP proxy after tunnelling 81/2981/4
authorDavid Hotham <david.hotham@metaswitch.com>
Tue, 20 Sep 2016 13:34:00 +0000 (13:34 +0000)
committerDamjan Marion <dmarion.lists@gmail.com>
Tue, 27 Sep 2016 22:28:07 +0000 (22:28 +0000)
Only rewind the buffer back to the start of the ethernet header,
rather than all the way.  We don't want to undo earlier
decapsulation.

Change-Id: I5f4b183eb3e8df690695ce3a97e55f3b0579a266
Signed-off-by: David Hotham <david.hotham@metaswitch.com>
vnet/vnet/ethernet/arp.c

index d08764a..541355f 100644 (file)
@@ -1088,12 +1088,13 @@ arp_input (vlib_main_t * vm, vlib_node_runtime_t * node, vlib_frame_t * frame)
                    /*
                     * Rewind buffer, direct code above not to
                     * think too hard about it.
                    /*
                     * Rewind buffer, direct code above not to
                     * think too hard about it.
-                    * $$$ is the answer ever anything other than
-                    * vlib_buffer_reset(..)?
                     */
                    if_addr0 = &proxy_src;
                    is_unnum0 = 0;
                     */
                    if_addr0 = &proxy_src;
                    is_unnum0 = 0;
-                   vlib_buffer_reset (p0);
+                   i32 ethernet_start =
+                     vnet_buffer (p0)->ethernet.start_of_ethernet_header;
+                   i32 rewind = p0->current_data - ethernet_start;
+                   vlib_buffer_advance (p0, -rewind);
                    n_proxy_arp_replies_sent++;
                    goto send_reply;
                  }
                    n_proxy_arp_replies_sent++;
                    goto send_reply;
                  }