X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=ofproto%2Fofproto-dpif-sflow.c;h=cb1f8308552e597543743a385c7882ef1a8cdd9d;hb=cfc50ae514f805dcd9c14589f21158185424daf6;hp=ff07e70cfff042aa64c81435cf779fcc0e48b476;hpb=e731d71bf47b8370e4bfa87827113eedd20b7398;p=sliver-openvswitch.git diff --git a/ofproto/ofproto-dpif-sflow.c b/ofproto/ofproto-dpif-sflow.c index ff07e70cf..cb1f83085 100644 --- a/ofproto/ofproto-dpif-sflow.c +++ b/ofproto/ofproto-dpif-sflow.c @@ -370,7 +370,6 @@ dpif_sflow_unref(struct dpif_sflow *ds) OVS_EXCLUDED(mutex) dpif_sflow_del_port__(ds, dsp); } hmap_destroy(&ds->ports); - ovs_refcount_destroy(&ds->ref_cnt); free(ds); } } @@ -603,12 +602,12 @@ dpif_sflow_received(struct dpif_sflow *ds, struct ofpbuf *packet, header->header_protocol = SFLHEADER_ETHERNET_ISO8023; /* 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 = packet->size + 4; + header->frame_length = ofpbuf_size(packet) + 4; /* Ethernet FCS stripped off. */ header->stripped = 4; - header->header_length = MIN(packet->size, + header->header_length = MIN(ofpbuf_size(packet), sampler->sFlowFsMaximumHeaderSize); - header->header_bytes = packet->data; + header->header_bytes = ofpbuf_data(packet); /* Add extended switch element. */ memset(&switchElem, 0, sizeof(switchElem));