summaryrefslogtreecommitdiff
path: root/ofproto/ofproto.c
diff options
context:
space:
mode:
authorJarno Rajahalme <jarno@ovn.org>2016-09-13 14:46:16 -0700
committerJarno Rajahalme <jarno@ovn.org>2016-09-13 14:47:22 -0700
commit51bb26fae190519451b1e95569d7425bef7fec84 (patch)
tree5a3a1450f7e2f4a310c7b2a94a5cb2e42c6728a4 /ofproto/ofproto.c
parent68030e16f6b8f91c5e3da676797d4c3dcc498b2d (diff)
downloadopenvswitch-51bb26fae190519451b1e95569d7425bef7fec84.tar.gz
ofproto: Add a fixed bundle idle timeout of 10 seconds.
Timing out idle bundles frees memory that would effectively be leaked if a long standing OpenFlow connection would fail to commit or discard a bundle. OpenFlow specification mandates the timeout to be at least one second, if the switch implements such a timeout. This patch makes the bundle idle timeout to be 10 seconds. We do not limit the number of messages in a bundle, so it does not make sense to limit the number of bundles either, especially now that idle bundles are timed out. Signed-off-by: Jarno Rajahalme <jarno@ovn.org> Acked-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ofproto/ofproto.c')
-rw-r--r--ofproto/ofproto.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index f4f4fd684..cfc4d4121 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -7277,7 +7277,7 @@ do_bundle_commit(struct ofconn *ofconn, uint32_t id, uint16_t flags)
if (error) {
/* Send error referring to the original message. */
if (error) {
- ofconn_send_error(ofconn, be->ofp_msg, error);
+ ofconn_send_error(ofconn, &be->ofp_msg, error);
error = OFPERR_OFPBFC_MSG_FAILED;
}
@@ -7304,7 +7304,7 @@ do_bundle_commit(struct ofconn *ofconn, uint32_t id, uint16_t flags)
port_mod_finish(ofconn, &be->opm.pm, be->opm.port);
} else {
struct openflow_mod_requester req = { ofconn,
- be->ofp_msg };
+ &be->ofp_msg };
if (be->type == OFPTYPE_FLOW_MOD) {
/* Bump the lookup version to the one of the current
* message. This makes all the changes in the bundle
@@ -7362,8 +7362,8 @@ handle_bundle_control(struct ofconn *ofconn, const struct ofp_header *oh)
reply.bundle_id = bctrl.bundle_id;
switch (bctrl.type) {
- case OFPBCT_OPEN_REQUEST:
- error = ofp_bundle_open(ofconn, bctrl.bundle_id, bctrl.flags);
+ case OFPBCT_OPEN_REQUEST:
+ error = ofp_bundle_open(ofconn, bctrl.bundle_id, bctrl.flags, oh);
reply.type = OFPBCT_OPEN_REPLY;
break;
case OFPBCT_CLOSE_REQUEST:
@@ -7441,7 +7441,7 @@ handle_bundle_add(struct ofconn *ofconn, const struct ofp_header *oh)
if (!error) {
error = ofp_bundle_add_message(ofconn, badd.bundle_id, badd.flags,
- bmsg);
+ bmsg, oh);
}
if (error) {