aboutsummaryrefslogtreecommitdiff
path: root/ofproto/ofproto-dpif.c
diff options
context:
space:
mode:
Diffstat (limited to 'ofproto/ofproto-dpif.c')
-rw-r--r--ofproto/ofproto-dpif.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c
index e206f431..60f81755 100644
--- a/ofproto/ofproto-dpif.c
+++ b/ofproto/ofproto-dpif.c
@@ -4634,8 +4634,11 @@ do_xlate_actions(const union ofp_action *in, size_t n_in,
break;
case OFPUTIL_OFPAT_SET_NW_TOS:
- ctx->flow.nw_tos &= ~IP_DSCP_MASK;
- ctx->flow.nw_tos |= ia->nw_tos.nw_tos & IP_DSCP_MASK;
+ /* OpenFlow 1.0 only supports IPv4. */
+ if (ctx->flow.dl_type == htons(ETH_TYPE_IP)) {
+ ctx->flow.nw_tos &= ~IP_DSCP_MASK;
+ ctx->flow.nw_tos |= ia->nw_tos.nw_tos & IP_DSCP_MASK;
+ }
break;
case OFPUTIL_OFPAT_SET_TP_SRC: