ofproto: Send OFPT_PORT_STATUS messages to primary slave controllers.
authorBen Pfaff <blp@nicira.com>
Wed, 24 Nov 2010 20:50:52 +0000 (12:50 -0800)
committerBen Pfaff <blp@nicira.com>
Wed, 24 Nov 2010 20:50:52 +0000 (12:50 -0800)
Requested-by: Jeremy Stribling <strib@nicira.com>
CC: Jeremy Stribling <strib@nicira.com>
include/openflow/nicira-ext.h
ofproto/ofproto.c

index d87915e213a29196996d2ae5a63a1e4999f4c5c4..1a59d3b03114e53b2297d5d6081ce853389d3ac0 100644 (file)
@@ -205,8 +205,8 @@ OFP_ASSERT(sizeof(struct nxt_tun_id_cookie) == 24);
  *      OpenFlow features.  In particular attempts to modify the flow table
  *      will be rejected with an OFPBRC_EPERM error.
  *
- *      Slave controllers also do not receive asynchronous messages
- *      (OFPT_PACKET_IN, OFPT_FLOW_REMOVED, OFPT_PORT_STATUS).
+ *      Slave controllers do not receive OFPT_PACKET_IN or OFPT_FLOW_REMOVED
+ *      messages, but they do receive OFPT_PORT_STATUS messages.
  */
 struct nx_role_request {
     struct nicira_header nxh;
index c2b38b2b0d08aea2e0c04ae9cd99dd17458a0c32..9a4702e9f2427dd0e0d46e27be4d450e2616fd99 100644 (file)
@@ -1515,7 +1515,10 @@ send_port_status(struct ofproto *p, const struct ofport *ofport,
         struct ofp_port_status *ops;
         struct ofpbuf *b;
 
-        if (!ofconn_receives_async_msgs(ofconn)) {
+        /* Primary controllers, even slaves, should always get port status
+           updates.  Otherwise obey ofconn_receives_async_msgs(). */
+        if (ofconn->type != OFCONN_PRIMARY
+            && !ofconn_receives_async_msgs(ofconn)) {
             continue;
         }