projects
/
openvswitch
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
netflow: Populate NetFlow output interface field.
[openvswitch]
/
secchan
/
netflow.c
diff --git
a/secchan/netflow.c
b/secchan/netflow.c
index 0162c45ab16249342d17b01930593ac725a5f3b9..282fd834270e6706f4d96ba47eb13580e0723ff2 100644
(file)
--- a/
secchan/netflow.c
+++ b/
secchan/netflow.c
@@
-196,11
+196,10
@@
netflow_expire(struct netflow *nf, const struct ofexpired *expired)
if (nf->add_id_to_iface) {
uint16_t iface = (nf->engine_id & 0x7f) << 9;
nf_rec->input = htons(iface | (expired->flow.in_port & 0x1ff));
if (nf->add_id_to_iface) {
uint16_t iface = (nf->engine_id & 0x7f) << 9;
nf_rec->input = htons(iface | (expired->flow.in_port & 0x1ff));
- nf_rec->output = htons(iface);
- printf("input: %x\n", ntohs(nf_rec->input));
+ nf_rec->output = htons(iface | (expired->output_iface & 0x1ff));
} else {
nf_rec->input = htons(expired->flow.in_port);
} else {
nf_rec->input = htons(expired->flow.in_port);
- nf_rec->output = htons(
0
);
+ nf_rec->output = htons(
expired->output_iface
);
}
nf_rec->packet_count = htonl(MIN(expired->packet_count, UINT32_MAX));
nf_rec->byte_count = htonl(MIN(expired->byte_count, UINT32_MAX));
}
nf_rec->packet_count = htonl(MIN(expired->packet_count, UINT32_MAX));
nf_rec->byte_count = htonl(MIN(expired->byte_count, UINT32_MAX));
@@
-222,9
+221,8
@@
netflow_expire(struct netflow *nf, const struct ofexpired *expired)
nf_rec->ip_proto = expired->flow.nw_proto;
nf_rec->ip_tos = expired->ip_tos;
nf_rec->ip_proto = expired->flow.nw_proto;
nf_rec->ip_tos = expired->ip_tos;
- /* NetFlow messages are limited to 30 records. A length of 1400
- * bytes guarantees that the limit is not exceeded. */
- if (nf->packet.size >= 1400) {
+ /* NetFlow messages are limited to 30 records. */
+ if (ntohs(nf_hdr->count) >= 30) {
netflow_run(nf);
}
}
netflow_run(nf);
}
}