[ovs-dev,05/23] nx-match: Serialize match on IP TTL even when outputting OXM.
diff mbox

Message ID 1444450544-11845-6-git-send-email-blp@nicira.com
State Accepted
Headers show

Commit Message

Ben Pfaff Oct. 10, 2015, 4:15 a.m. UTC
The 'oxm' parameter to nxm_put_ip() indicates whether NXM or OXM code
points should be used in cases where both exist.  It shouldn't cause
matches to be dropped entirely, since that changes the meaning, but that's
what was done here for matches on the IP (v4 or v6) TTL.  This commit
fixes the problem.

Signed-off-by: Ben Pfaff <blp@nicira.com>
---
 lib/nx-match.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Justin Pettit Oct. 15, 2015, 8:59 p.m. UTC | #1
> On Oct 9, 2015, at 9:15 PM, Ben Pfaff <blp@nicira.com> wrote:
> 
> The 'oxm' parameter to nxm_put_ip() indicates whether NXM or OXM code
> points should be used in cases where both exist.  It shouldn't cause
> matches to be dropped entirely, since that changes the meaning, but that's
> what was done here for matches on the IP (v4 or v6) TTL.  This commit
> fixes the problem.
> 
> Signed-off-by: Ben Pfaff <blp@nicira.com>

Acked-by: Justin Pettit <jpettit@nicira.com>

--Justin
Ben Pfaff Oct. 16, 2015, 4:22 a.m. UTC | #2
On Thu, Oct 15, 2015 at 01:59:35PM -0700, Justin Pettit wrote:
> > On Oct 9, 2015, at 9:15 PM, Ben Pfaff <blp@nicira.com> wrote:
> > 
> > The 'oxm' parameter to nxm_put_ip() indicates whether NXM or OXM code
> > points should be used in cases where both exist.  It shouldn't cause
> > matches to be dropped entirely, since that changes the meaning, but that's
> > what was done here for matches on the IP (v4 or v6) TTL.  This commit
> > fixes the problem.
> > 
> > Signed-off-by: Ben Pfaff <blp@nicira.com>
> 
> Acked-by: Justin Pettit <jpettit@nicira.com>

Thanks, applied to master, branch-2.4, and branch-2.3.

Patch
diff mbox

diff --git a/lib/nx-match.c b/lib/nx-match.c
index eef2c54..90636bc 100644
--- a/lib/nx-match.c
+++ b/lib/nx-match.c
@@ -817,7 +817,7 @@  nxm_put_ip(struct ofpbuf *b, const struct match *match, enum ofp_version oxm)
                   flow->nw_tos & IP_ECN_MASK);
     }
 
-    if (!oxm && match->wc.masks.nw_ttl) {
+    if (match->wc.masks.nw_ttl) {
         nxm_put_8(b, MFF_IP_TTL, oxm, flow->nw_ttl);
     }