From c62caaa3f4132eba085c8ba15577b62195642711 Mon Sep 17 00:00:00 2001 From: Neil McKee Date: Wed, 5 May 2010 13:24:03 -0700 Subject: [PATCH] sflow: Include Ethernet FCS in frame_length to comply with sFlow spec. --- ofproto/ofproto-sflow.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/ofproto/ofproto-sflow.c b/ofproto/ofproto-sflow.c index 85f9f9ff..5488724e 100644 --- a/ofproto/ofproto-sflow.c +++ b/ofproto/ofproto-sflow.c @@ -519,8 +519,11 @@ ofproto_sflow_received(struct ofproto_sflow *os, struct odp_msg *msg) hdrElem.tag = SFLFLOW_HEADER; header = &hdrElem.flowType.header; header->header_protocol = SFLHEADER_ETHERNET_ISO8023; - header->frame_length = payload.size; - header->stripped = 4; /* Ethernet FCS stripped off. */ + /* The frame_length should include the Ethernet FCS (4 bytes), + but it has already been stripped, so we need to add 4 here. */ + header->frame_length = payload.size + 4; + /* Ethernet FCS stripped off. */ + header->stripped = 4; header->header_length = MIN(payload.size, sampler->sFlowFsMaximumHeaderSize); header->header_bytes = payload.data; -- 2.30.2