ofpbuf: Abstract 'l2' pointer and document usage conventions.
[sliver-openvswitch.git] / ofproto / ofproto-dpif.c
index ee97707..9ec0237 100644 (file)
@@ -1768,7 +1768,7 @@ send_bpdu_cb(struct ofpbuf *pkt, int port_num, void *ofproto_)
         VLOG_WARN_RL(&rl, "%s: cannot send BPDU on unknown port %d",
                      ofproto->up.name, port_num);
     } else {
-        struct eth_header *eth = pkt->l2;
+        struct eth_header *eth = ofpbuf_l2(pkt);
 
         netdev_get_etheraddr(ofport->up.netdev, eth->eth_src);
         if (eth_addr_is_zero(eth->eth_src)) {
@@ -2419,9 +2419,9 @@ bundle_send_learning_packets(struct ofbundle *bundle)
             learning_packet = bond_compose_learning_packet(bundle->bond,
                                                            e->mac, e->vlan,
                                                            &port_void);
-            /* Temporarily use l2 as a private pointer (see below). */
-            ovs_assert(learning_packet->l2 == ofpbuf_data(learning_packet));
-            learning_packet->l2 = port_void;
+            /* Temporarily use 'frame' as a private pointer (see below). */
+            ovs_assert(learning_packet->frame == ofpbuf_data(learning_packet));
+            learning_packet->frame = port_void;
             list_push_back(&packets, &learning_packet->list_node);
         }
     }
@@ -2430,10 +2430,10 @@ bundle_send_learning_packets(struct ofbundle *bundle)
     error = n_packets = n_errors = 0;
     LIST_FOR_EACH (learning_packet, list_node, &packets) {
         int ret;
-        void *port_void = learning_packet->l2;
+        void *port_void = learning_packet->frame;
 
-        /* Restore l2. */
-        learning_packet->l2 = ofpbuf_data(learning_packet);
+        /* Restore 'frame'. */
+        learning_packet->frame = ofpbuf_data(learning_packet);
         ret = ofproto_dpif_send_packet(port_void, learning_packet);
         if (ret) {
             error = ret;