From: Neil McKee Date: Wed, 5 May 2010 20:24:03 +0000 (-0700) Subject: sflow: Include Ethernet FCS in frame_length to comply with sFlow spec. X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=c62caaa3f4132eba085c8ba15577b62195642711;p=openvswitch sflow: Include Ethernet FCS in frame_length to comply with sFlow spec. --- 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;