Skip to content

Commit

Permalink
netflow: Fix interpretation of flow_seq.
Browse files Browse the repository at this point in the history
'flow_seq" field in NetFlow v5 header should represent a number of NetFlow
flow records exported while it is representing the number of NetFlow
packets exported in the current code. This patch fixes this problem.

Signed-off-by: Motonori Shindo <motonori@shin.do>
Signed-off-by: Ben Pfaff <blp@nicira.com>
  • Loading branch information
mshindo authored and blp committed Nov 4, 2014
1 parent b7a5158 commit 67a17f0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ofproto/netflow.c
Expand Up @@ -121,14 +121,14 @@ gen_netflow_rec(struct netflow *nf, struct netflow_flow *nf_flow,
nf_hdr->sysuptime = htonl(time_msec() - nf->boot_time);
nf_hdr->unix_secs = htonl(now.tv_sec);
nf_hdr->unix_nsecs = htonl(now.tv_nsec);
nf_hdr->flow_seq = htonl(nf->netflow_cnt++);
nf_hdr->engine_type = nf->engine_type;
nf_hdr->engine_id = nf->engine_id;
nf_hdr->sampling_interval = htons(0);
}

nf_hdr = ofpbuf_data(&nf->packet);
nf_hdr->count = htons(ntohs(nf_hdr->count) + 1);
nf_hdr->flow_seq = htonl(nf->netflow_cnt++);

nf_rec = ofpbuf_put_zeros(&nf->packet, sizeof *nf_rec);
nf_rec->src_addr = nf_flow->nw_src;
Expand Down

0 comments on commit 67a17f0

Please sign in to comment.