[ovs-dev] [PATCH 4/8] bundles: Reject bundle add with bad flags.

Jarno Rajahalme jrajahalme at nicira.com
Mon Dec 8 22:01:30 UTC 2014


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 <jrajahalme at 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.mihai.c at gmail.com>, with support from IXIA.
  * Copyright (c) 2013, 2014 Daniel Baluta <dbaluta at 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




More information about the dev mailing list