Skip to content

Commit

Permalink
bundles: Reject bundle add with bad flags.
Browse files Browse the repository at this point in the history
OpenFlow 1.4 states that the switch must reject a bundle add message
whose flags are different from the ones in the bundle.  Do it.

Signed-off-by: Jarno Rajahalme <[email protected]>
Acked-by: Ben Pfaff <[email protected]>
  • Loading branch information
Jarno Rajahalme committed Dec 22, 2014
1 parent be6f639 commit 7b334c5
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions ofproto/bundles.c
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
/*
* Copyright (c) 2013, 2014 Alexandru Copot <[email protected]>, with support from IXIA.
* Copyright (c) 2013, 2014 Daniel Baluta <[email protected]>
* Copyright (c) 2014 Nicira, Inc.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
Expand Down Expand Up @@ -237,11 +238,12 @@ ofp_bundle_add_message(struct ofconn *ofconn, struct ofputil_bundle_add_msg *bad

bundles = ofconn_get_bundles(ofconn);
hmap_insert(bundles, &bundle->node, bundle_hash(badd->bundle_id));
}

if (bundle->state == BS_CLOSED) {
} else if (bundle->state == BS_CLOSED) {
ofp_bundle_remove(ofconn, bundle);
return OFPERR_OFPBFC_BUNDLE_CLOSED;
} else if (badd->flags != bundle->flags) {
ofp_bundle_remove(ofconn, bundle);
return OFPERR_OFPBFC_BAD_FLAGS;
}

bmsg = xmalloc(sizeof *bmsg);
Expand Down

0 comments on commit 7b334c5

Please sign in to comment.