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 <jrajaha...@nicira.com>
---
 ofproto/bundles.c |    8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/ofproto/bundles.c b/ofproto/bundles.c
index ddc74c6..a6637d9 100644
--- a/ofproto/bundles.c
+++ b/ofproto/bundles.c
@@ -1,6 +1,7 @@
 /*
  * Copyright (c) 2013, 2014 Alexandru Copot <alex.miha...@gmail.com>, with 
support from IXIA.
  * Copyright (c) 2013, 2014 Daniel Baluta <dbal...@ixiacom.com>
+ * 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.
@@ -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);
-- 
1.7.10.4

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to