ofproto: Fix ofproto_send_packet() treatment of vlan_tci parameter.
authorBen Pfaff <blp@nicira.com>
Wed, 4 May 2011 22:44:51 +0000 (15:44 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 16 May 2011 20:40:46 +0000 (13:40 -0700)
ofproto_send_packet() seems very confused about whether vlan_tci is in
host or network byte order.  But the callers always pass 0 anyway, so we
might as well remove it.

ofproto/ofproto.c
ofproto/ofproto.h

index 4ed2914..38b86f7 100644 (file)
@@ -942,24 +942,17 @@ ofproto_port_is_floodable(struct ofproto *ofproto, uint16_t odp_port)
     return ofport && !(ofport->opp.config & OFPPC_NO_FLOOD);
 }
 
-/* Sends 'packet' out of port 'port_no' within 'p'.  If 'vlan_tci' is zero the
- * packet will not have any 802.1Q hader; if it is nonzero, then the packet
- * will be sent with the VLAN TCI specified by 'vlan_tci & ~VLAN_CFI'.
+/* Sends 'packet' out of port 'port_no' within 'p'.
  *
  * Returns 0 if successful, otherwise a positive errno value. */
 int
 ofproto_send_packet(struct ofproto *ofproto,
-                    uint32_t port_no, uint16_t vlan_tci,
-                    const struct ofpbuf *packet)
+                    uint32_t port_no, const struct ofpbuf *packet)
 {
     struct ofpbuf odp_actions;
     int error;
 
     ofpbuf_init(&odp_actions, 32);
-    if (vlan_tci != 0) {
-        nl_msg_put_u32(&odp_actions, ODP_ACTION_ATTR_SET_DL_TCI,
-                       ntohs(vlan_tci & ~VLAN_CFI));
-    }
     nl_msg_put_u32(&odp_actions, ODP_ACTION_ATTR_OUTPUT, port_no);
     error = dpif_execute(ofproto->dpif, odp_actions.data, odp_actions.size,
                          packet);
@@ -1227,7 +1220,7 @@ ofport_run(struct ofproto *ofproto, struct ofport *ofport)
             ccm = eth_compose(&packet, eth_addr_ccm, ofport->opp.hw_addr,
                               ETH_TYPE_CFM,  sizeof *ccm);
             cfm_compose_ccm(ofport->cfm, ccm);
-            ofproto_send_packet(ofproto, ofport->odp_port, 0, &packet);
+            ofproto_send_packet(ofproto, ofport->odp_port, &packet);
             ofpbuf_uninit(&packet);
         }
     }
@@ -3794,7 +3787,7 @@ handle_miss_upcall(struct ofproto *p, struct dpif_upcall *upcall)
     /* Check with in-band control to see if this packet should be sent
      * to the local port regardless of the flow table. */
     if (connmgr_msg_in_hook(p->connmgr, &flow, upcall->packet)) {
-        ofproto_send_packet(p, ODPP_LOCAL, 0, upcall->packet);
+        ofproto_send_packet(p, ODPP_LOCAL, upcall->packet);
     }
 
     facet = facet_lookup_valid(p, &flow);
index 9a56bee..d4c3bf8 100644 (file)
@@ -142,7 +142,7 @@ void ofproto_get_snoops(const struct ofproto *, struct sset *);
 void ofproto_get_all_flows(struct ofproto *p, struct ds *);
 
 /* Functions for use by ofproto implementation modules, not by clients. */
-int ofproto_send_packet(struct ofproto *, uint32_t port_no, uint16_t vlan_tci,
+int ofproto_send_packet(struct ofproto *, uint32_t port_no,
                         const struct ofpbuf *);
 void ofproto_add_flow(struct ofproto *, const struct cls_rule *,
                       const union ofp_action *, size_t n_actions);