Send the features request before the set config to be OpenFlow-compliant.
authorJustin Pettit <jpettit@nicira.com>
Sat, 3 May 2008 00:43:16 +0000 (17:43 -0700)
committerJustin Pettit <jpettit@nicira.com>
Sat, 3 May 2008 00:43:39 +0000 (17:43 -0700)
controller/controller.c

index b345b67645cf2c38062b68c64d2f1d1cccd89362..8b69686bc08fc498ca3ad965a11caafb9f1a1bbf 100644 (file)
@@ -288,6 +288,15 @@ send_features_request(struct switch_ *this)
         struct ofp_header *ofr;
         struct ofp_switch_config *osc;
 
+        /* Send OFPT_FEATURES_REQUEST. */
+        b = buffer_new(0);
+        ofr = buffer_put_uninit(b, sizeof *ofr);
+        memset(ofr, 0, sizeof *ofr);
+        ofr->type = OFPT_FEATURES_REQUEST;
+        ofr->version = OFP_VERSION;
+        ofr->length = htons(sizeof *ofr);
+        queue_tx(this, b);
+
         /* Send OFPT_SET_CONFIG. */
         b = buffer_new(0);
         osc = buffer_put_uninit(b, sizeof *osc);
@@ -299,15 +308,6 @@ send_features_request(struct switch_ *this)
         osc->miss_send_len = htons(OFP_DEFAULT_MISS_SEND_LEN);
         queue_tx(this, b);
 
-        /* Send OFPT_FEATURES_REQUEST. */
-        b = buffer_new(0);
-        ofr = buffer_put_uninit(b, sizeof *ofr);
-        memset(ofr, 0, sizeof *ofr);
-        ofr->type = OFPT_FEATURES_REQUEST;
-        ofr->version = OFP_VERSION;
-        ofr->length = htons(sizeof *ofr);
-        queue_tx(this, b);
-
         this->last_features_request = now;
     }
 }