Setting tag sliver-openvswitch-2.2.90-1
[sliver-openvswitch.git] / lib / rconn.c
index a5368d5..2c49ca8 100644 (file)
@@ -718,12 +718,11 @@ rconn_send__(struct rconn *rc, struct ofpbuf *b,
         copy_to_monitor(rc, b);
 
         if (counter) {
-            rconn_packet_counter_inc(counter, b->size);
+            rconn_packet_counter_inc(counter, ofpbuf_size(b));
         }
 
-        /* Use 'l2' as a private pointer while 'b' is in txq. */
-        ovs_assert(b->l2 == b->data);
-        b->l2 = counter;
+        /* Reuse 'frame' as a private pointer while 'b' is in txq. */
+        ofpbuf_set_frame(b, counter);
 
         list_push_back(&rc->txq, &b->list_node);
 
@@ -1107,19 +1106,19 @@ try_send(struct rconn *rc)
     OVS_REQUIRES(rc->mutex)
 {
     struct ofpbuf *msg = ofpbuf_from_list(rc->txq.next);
-    unsigned int n_bytes = msg->size;
-    struct rconn_packet_counter *counter = msg->l2;
+    unsigned int n_bytes = ofpbuf_size(msg);
+    struct rconn_packet_counter *counter = msg->frame;
     int retval;
 
     /* Eagerly remove 'msg' from the txq.  We can't remove it from the list
      * after sending, if sending is successful, because it is then owned by the
      * vconn, which might have freed it already. */
     list_remove(&msg->list_node);
-    msg->l2 = msg->data; /* Restore 'l2'. */
+    ofpbuf_set_frame(msg, NULL);
 
     retval = vconn_send(rc->vconn, msg);
     if (retval) {
-        msg->l2 = counter; /* 'l2' is a private pointer while msg is in txq. */
+        ofpbuf_set_frame(msg, counter);
         list_push_front(&rc->txq, &msg->list_node);
         if (retval != EAGAIN) {
             report_error(rc, retval);
@@ -1212,9 +1211,9 @@ flush_queue(struct rconn *rc)
     }
     while (!list_is_empty(&rc->txq)) {
         struct ofpbuf *b = ofpbuf_from_list(list_pop_front(&rc->txq));
-        struct rconn_packet_counter *counter = b->l2;
+        struct rconn_packet_counter *counter = b->frame;
         if (counter) {
-            rconn_packet_counter_dec(counter, b->size);
+            rconn_packet_counter_dec(counter, ofpbuf_size(b));
         }
         COVERAGE_INC(rconn_discarded);
         ofpbuf_delete(b);
@@ -1324,7 +1323,7 @@ is_admitted_msg(const struct ofpbuf *b)
     enum ofptype type;
     enum ofperr error;
 
-    error = ofptype_decode(&type, b->data);
+    error = ofptype_decode(&type, ofpbuf_data(b));
     if (error) {
         return false;
     }
@@ -1351,6 +1350,8 @@ is_admitted_msg(const struct ofpbuf *b)
     case OFPTYPE_GROUP_FEATURES_STATS_REPLY:
     case OFPTYPE_TABLE_FEATURES_STATS_REQUEST:
     case OFPTYPE_TABLE_FEATURES_STATS_REPLY:
+    case OFPTYPE_BUNDLE_CONTROL:
+    case OFPTYPE_BUNDLE_ADD_MESSAGE:
         return false;
 
     case OFPTYPE_PACKET_IN: