On Dec 27, 2012, at 7:23 , ext Simon Horman wrote:
> diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c
> index 6468cac..c631c0a 100644
> --- a/lib/ofp-actions.c
> +++ b/lib/ofp-actions.c
> @@ -1052,7 +1088,8 @@ exit:
> }
>
> static enum ofperr
> -ofpact_check__(const struct ofpact *a, const struct flow *flow, int
> max_ports)
> +ofpact_check__(const struct ofpact *a, const struct flow *flow, int
> max_ports,
> + ovs_be16 *dl_type)
> {
> const struct ofpact_enqueue *enqueue;
>
> @@ -1094,8 +1131,11 @@ ofpact_check__(const struct ofpact *a, const struct
> flow *flow, int max_ports)
> case OFPACT_REG_MOVE:
> return nxm_reg_move_check(ofpact_get_REG_MOVE(a), flow);
>
> - case OFPACT_REG_LOAD:
> - return nxm_reg_load_check(ofpact_get_REG_LOAD(a), flow);
> + case OFPACT_REG_LOAD: {
> + struct flow updated_flow = *flow;
> + updated_flow.dl_type = *dl_type;
> + return nxm_reg_load_check(ofpact_get_REG_LOAD(a), &updated_flow);
> + }
>
Maybe copy & update flow only if (*dl_type != flow->dl_type) ?
> case OFPACT_DEC_TTL:
> case OFPACT_SET_TUNNEL:
> @@ -1118,6 +1158,14 @@ ofpact_check__(const struct ofpact *a, const struct
> flow *flow, int max_ports)
> case OFPACT_EXIT:
> return 0;
>
> + case OFPACT_PUSH_MPLS:
> + *dl_type = ofpact_get_PUSH_MPLS(a)->ethertype;
> + return 0;
> +
> + case OFPACT_POP_MPLS:
> + *dl_type = ofpact_get_POP_MPLS(a)->ethertype;
> + return 0;
> +
> case OFPACT_CLEAR_ACTIONS:
> case OFPACT_WRITE_METADATA:
> case OFPACT_GOTO_TABLE:
> @@ -1136,9 +1184,11 @@ ofpacts_check(const struct ofpact ofpacts[], size_t
> ofpacts_len,
> const struct flow *flow, int max_ports)
> {
> const struct ofpact *a;
> + ovs_be16 dl_type = flow->dl_type;
>
> OFPACT_FOR_EACH (a, ofpacts, ofpacts_len) {
> - enum ofperr error = ofpact_check__(a, flow, max_ports);
> + enum ofperr error = ofpact_check__(a, flow, max_ports,
> + &dl_type);
> if (error) {
> return error;
> }
_______________________________________________
dev mailing list
[email protected]
http://openvswitch.org/mailman/listinfo/dev