X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=lib%2Fnx-match.c;h=51b6dc64568b10b4ee44951b852c9494ac00ac20;hb=a39c3ff9f586d3416976d3c3bd095fa81d73efa0;hp=6efc94df316d18d2245f9efa561198bc2335b8fc;hpb=bd85dac14ed7fa42d5804592fd4e903826d9e899;p=sliver-openvswitch.git diff --git a/lib/nx-match.c b/lib/nx-match.c index 6efc94df3..51b6dc645 100644 --- a/lib/nx-match.c +++ b/lib/nx-match.c @@ -1,5 +1,5 @@ /* - * Copyright (c) 2010, 2011, 2012 Nicira, Inc. + * Copyright (c) 2010, 2011, 2012, 2013 Nicira, Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. @@ -517,8 +517,11 @@ nxm_put_ip(struct ofpbuf *b, const struct match *match, nxm_put_frag(b, match); if (match->wc.masks.nw_tos & IP_DSCP_MASK) { - nxm_put_8(b, oxm ? OXM_OF_IP_DSCP : NXM_OF_IP_TOS, - flow->nw_tos & IP_DSCP_MASK); + if (oxm) { + nxm_put_8(b, OXM_OF_IP_DSCP, flow->nw_tos >> 2); + } else { + nxm_put_8(b, NXM_OF_IP_TOS, flow->nw_tos & IP_DSCP_MASK); + } } if (match->wc.masks.nw_tos & IP_ECN_MASK) { @@ -573,7 +576,7 @@ nx_put_raw(struct ofpbuf *b, bool oxm, const struct match *match, int match_len; int i; - BUILD_ASSERT_DECL(FLOW_WC_SEQ == 19); + BUILD_ASSERT_DECL(FLOW_WC_SEQ == 20); /* Metadata. */ if (match->wc.masks.in_port) { @@ -687,7 +690,13 @@ nx_put_raw(struct ofpbuf *b, bool oxm, const struct match *match, /* Tunnel ID. */ nxm_put_64m(b, oxm ? OXM_OF_TUNNEL_ID : NXM_NX_TUN_ID, - flow->tunnel.tun_id, match->wc.masks.tunnel.tun_id); + flow->tunnel.tun_id, match->wc.masks.tunnel.tun_id); + + /* Other tunnel metadata. */ + nxm_put_32m(b, NXM_NX_TUN_IPV4_SRC, + flow->tunnel.ip_src, match->wc.masks.tunnel.ip_src); + nxm_put_32m(b, NXM_NX_TUN_IPV4_DST, + flow->tunnel.ip_dst, match->wc.masks.tunnel.ip_dst); /* Registers. */ for (i = 0; i < FLOW_N_REGS; i++) {