X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=blobdiff_plain;f=ofproto%2Fofproto.c;h=bb2bf5a4ae2873c3447d5b949c4334f28336af14;hb=a4e2e1f28976fd17435a7748c233286188778344;hp=341d403d08974e3f40a39b9676591c87ecaa941b;hpb=26233bb4615608fd45d89a5abe2e62f4b3d776f7;p=openvswitch diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 341d403d..bb2bf5a4 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -1277,6 +1277,15 @@ ofproto_port_del(struct ofproto *ofproto, uint16_t odp_port) return error; } +/* Checks if 'ofproto' thinks 'odp_port' should be included in floods. Returns + * true if 'odp_port' exists and should be included, false otherwise. */ +bool +ofproto_port_is_floodable(struct ofproto *ofproto, uint16_t odp_port) +{ + struct ofport *ofport = get_port(ofproto, odp_port); + return ofport && !(ofport->opp.config & OFPPC_NO_FLOOD); +} + int ofproto_send_packet(struct ofproto *p, const struct flow *flow, const union ofp_action *actions, size_t n_actions, @@ -2577,6 +2586,7 @@ xlate_output_action__(struct action_xlate_ctx *ctx, case OFPP_FLOOD: flood_packets(ctx->ofproto, ctx->flow.in_port, OFPPC_NO_FLOOD, &ctx->nf_output_iface, ctx->out); + break; case OFPP_ALL: flood_packets(ctx->ofproto, ctx->flow.in_port, 0, &ctx->nf_output_iface, ctx->out); @@ -2760,6 +2770,7 @@ do_xlate_actions(const union ofp_action *in, size_t n_in, oa = odp_actions_add(ctx->out, ODPAT_SET_DL_TCI); oa->dl_tci.tci = ia->vlan_vid.vlan_vid & htons(VLAN_VID_MASK); oa->dl_tci.mask = htons(VLAN_VID_MASK); + ctx->flow.dl_vlan = ia->vlan_vid.vlan_vid; break; case OFPAT_SET_VLAN_PCP: @@ -2767,6 +2778,7 @@ do_xlate_actions(const union ofp_action *in, size_t n_in, oa->dl_tci.tci = htons((ia->vlan_pcp.vlan_pcp << VLAN_PCP_SHIFT) & VLAN_PCP_MASK); oa->dl_tci.mask = htons(VLAN_PCP_MASK); + ctx->flow.dl_vlan_pcp = ia->vlan_pcp.vlan_pcp; break; case OFPAT_STRIP_VLAN: