summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJustin Pettit <jpettit@nicira.com>2009-10-28 17:15:57 -0700
committerJustin Pettit <jpettit@nicira.com>2009-10-28 17:15:57 -0700
commit3d3d15a0e6e9104f6c29e3ab21f4ea7189dccbab (patch)
tree490c8c9d78c0f7524c9f054d3d4592676ca829e3
parent14a34fe401551c7839306e3cf7a22c5bf83b52a5 (diff)
downloadopenvswitch-3d3d15a0e6e9104f6c29e3ab21f4ea7189dccbab.tar.gz
openflow: Fix endian issues in flow expiration messages
A few of the fields in the OpenFlow flow expiration message were being sent in host-byte order. This properly converts them to network. Thanks to David Erickson for catching this!
-rw-r--r--secchan/ofproto.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/secchan/ofproto.c b/secchan/ofproto.c
index 62a37bf42..7fb0c646f 100644
--- a/secchan/ofproto.c
+++ b/secchan/ofproto.c
@@ -3206,9 +3206,9 @@ compose_flow_exp(const struct rule *rule, long long int now, uint8_t reason)
flow_to_match(&rule->cr.flow, rule->cr.wc.wildcards, &ofe->match);
ofe->priority = htons(rule->cr.priority);
ofe->reason = reason;
- ofe->duration = (now - rule->created) / 1000;
- ofe->packet_count = rule->packet_count;
- ofe->byte_count = rule->byte_count;
+ ofe->duration = htonl((now - rule->created) / 1000);
+ ofe->packet_count = htonll(rule->packet_count);
+ ofe->byte_count = htonll(rule->byte_count);
return buf;
}