From 9219e45404792b2e0a55e799f8353c63073dce4a Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Wed, 4 May 2011 15:44:51 -0700 Subject: [PATCH] ofproto: Fix ofproto_send_packet() treatment of vlan_tci parameter. 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 | 15 ++++----------- ofproto/ofproto.h | 2 +- 2 files changed, 5 insertions(+), 12 deletions(-) diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 4ed29143..38b86f71 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -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); diff --git a/ofproto/ofproto.h b/ofproto/ofproto.h index 9a56beec..d4c3bf8b 100644 --- a/ofproto/ofproto.h +++ b/ofproto/ofproto.h @@ -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); -- 2.30.2