From: Jan Scheurich <jan.scheur...@ericsson.com>

Add default match on packet_type Ethernet in case of packet type-aware bridge.

Signed-off-by: Jan Scheurich <jan.scheur...@ericsson.com>
---
 ofproto/ofproto.c | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c
index c21a6e1..31e64b6 100644
--- a/ofproto/ofproto.c
+++ b/ofproto/ofproto.c
@@ -4709,6 +4709,7 @@ add_flow_init(struct ofproto *ofproto, struct 
ofproto_flow_mod *ofm,
     OVS_EXCLUDED(ofproto_mutex)
 {
     struct oftable *table;
+    struct match match = fm->match;
     struct cls_rule cr;
     uint8_t table_id;
     enum ofperr error;
@@ -4749,8 +4750,16 @@ add_flow_init(struct ofproto *ofproto, struct 
ofproto_flow_mod *ofm,
         return OFPERR_OFPBRC_EPERM;
     }
 
+    if (ofproto->packet_type_aware) {
+        if (!match.wc.masks.packet_type) {
+            /* Add default match on packet_type Ethernet.*/
+            match.flow.packet_type = htonl(PT_ETH);
+            match.wc.masks.packet_type = OVS_BE32_MAX;
+        }
+    }
+
     if (!ofm->temp_rule) {
-        cls_rule_init(&cr, &fm->match, fm->priority);
+        cls_rule_init(&cr, &match, fm->priority);
 
         /* Allocate new rule.  Destroys 'cr'. */
         error = ofproto_rule_create(ofproto, &cr, table - ofproto->tables,
-- 
2.7.4

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to