From: Romain Lenglet <romain.leng...@berabera.info>

Set the OFPFW_NW_TOS bit in the wildcards of a flow definition when no
nw_tos attribute is specified, so it doesn't always set nw_tos=0 for
the flow in that case.
---
 src/nox/lib/core.py |    1 +
 src/nox/lib/util.py |    6 ++++++
 2 files changed, 7 insertions(+), 0 deletions(-)

diff --git a/src/nox/lib/core.py b/src/nox/lib/core.py
index ad61bfc..4df011b 100644
--- a/src/nox/lib/core.py
+++ b/src/nox/lib/core.py
@@ -42,6 +42,7 @@ NW_SRC_N_WILD = "nw_src_n_wild"
 NW_DST     = "nw_dst"
 NW_DST_N_WILD = "nw_dst_n_wild"
 NW_PROTO   = "nw_proto"
+NW_TOS     = "nw_tos"
 TP_SRC     = "tp_src"
 TP_DST     = "tp_dst"
 GROUP_SRC  = "group_src"
diff --git a/src/nox/lib/util.py b/src/nox/lib/util.py
index 0da4b7b..076d419 100644
--- a/src/nox/lib/util.py
+++ b/src/nox/lib/util.py
@@ -339,6 +339,12 @@ def set_match(attrs):
     else:
         wildcards = wildcards | openflow.OFPFW_NW_PROTO
 
+    if attrs.has_key(core.NW_TOS):
+        m.nw_tos = attrs[core.NW_TOS]
+        num_entries += 1
+    else:
+        wildcards = wildcards | openflow.OFPFW_NW_TOS
+
     if attrs.has_key(core.TP_SRC):
         m.tp_src = htons(attrs[core.TP_SRC])
         num_entries += 1
-- 
1.7.1


_______________________________________________
nox-dev mailing list
nox-dev@noxrepo.org
http://noxrepo.org/mailman/listinfo/nox-dev_noxrepo.org

Reply via email to