aboutsummaryrefslogtreecommitdiffstats
path: root/src/vnet
diff options
context:
space:
mode:
authorDamjan Marion <damarion@cisco.com>2018-01-15 17:57:00 +0100
committerDave Barach <openvpp@barachs.net>2018-01-17 14:38:24 +0000
commitfaf9a5a01ea8b20f1282db22c5b6f70880187f3f (patch)
tree80a25e47fb2dd4cce6d06aac587a406b98e80283 /src/vnet
parentd3046598b0954f20031852ad55bcf2d4900c01bf (diff)
Fix checksum offload sssue caused by overwriten lX_hdr_offset
This happens when 2 packets belonging to 2 different interfaces hit dual loop in the ethernet-input. Packets go to slow path which doesn't set l2 hdr offset correctly for l3 packets. Change-Id: I61d87c079db0b2e21f8af6f6b600bff14030535d Signed-off-by: Damjan Marion <damarion@cisco.com>
Diffstat (limited to 'src/vnet')
-rwxr-xr-xsrc/vnet/ethernet/node.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/src/vnet/ethernet/node.c b/src/vnet/ethernet/node.c
index 3760877dc79..a2e7524a5b2 100755
--- a/src/vnet/ethernet/node.c
+++ b/src/vnet/ethernet/node.c
@@ -229,6 +229,8 @@ determine_next_node (ethernet_main_t * em,
u32 is_l20,
u32 type0, vlib_buffer_t * b0, u8 * error0, u8 * next0)
{
+ u32 eth_start = vnet_buffer (b0)->l2_hdr_offset;
+ vnet_buffer (b0)->l2.l2_len = b0->current_data - eth_start;
if (PREDICT_FALSE (*error0 != ETHERNET_ERROR_NONE))
{
// some error occurred
@@ -238,8 +240,6 @@ determine_next_node (ethernet_main_t * em,
{
*next0 = em->l2_next;
// record the L2 len and reset the buffer so the L2 header is preserved
- u32 eth_start = vnet_buffer (b0)->l2_hdr_offset;
- vnet_buffer (b0)->l2.l2_len = b0->current_data - eth_start;
ASSERT (vnet_buffer (b0)->l2.l2_len ==
ethernet_buffer_header_size (b0));
vlib_buffer_advance (b0, -ethernet_buffer_header_size (b0));