[ovs-dev] [PATCH 07/31] ofp-parse: Allow "packet_type(0, 0)" to be abbreviated "eth".

Ben Pfaff blp at ovn.org
Mon Jun 12 22:28:32 UTC 2017


Signed-off-by: Ben Pfaff <blp at ovn.org>
---
 lib/meta-flow.xml | 2 ++
 lib/ofp-parse.c   | 2 ++
 2 files changed, 4 insertions(+)

diff --git a/lib/meta-flow.xml b/lib/meta-flow.xml
index 82daaaffcb44..283a1cb0bcb8 100644
--- a/lib/meta-flow.xml
+++ b/lib/meta-flow.xml
@@ -314,6 +314,8 @@ tcp,tp_src=0x07c0/0xfff0
   </p>
 
   <dl>
+    <dt><code>eth</code></dt>
+    <dd><code>packet_type=(0,0)</code> (Open vSwitch 2.8 and later)</dd>
     <dt><code>ip</code></dt>     <dd><code>eth_type=0x0800</code></dd>
     <dt><code>ipv6</code></dt>   <dd><code>eth_type=0x86dd</code></dd>
     <dt><code>icmp</code></dt>   <dd><code>eth_type=0x0800,ip_proto=1</code></dd>
diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c
index 146fa4b2b82c..8467be7fe2b5 100644
--- a/lib/ofp-parse.c
+++ b/lib/ofp-parse.c
@@ -416,6 +416,8 @@ parse_ofp_str__(struct ofputil_flow_mod *fm, int command, char *string,
             if (p->nw_proto) {
                 match_set_nw_proto(&fm->match, p->nw_proto);
             }
+        } else if (!strcmp(name, "eth")) {
+            match_set_packet_type(&fm->match, htonl(PT_ETH));
         } else if (fields & F_FLAGS && !strcmp(name, "send_flow_rem")) {
             fm->flags |= OFPUTIL_FF_SEND_FLOW_REM;
         } else if (fields & F_FLAGS && !strcmp(name, "check_overlap")) {
-- 
2.10.2



More information about the dev mailing list