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

In netdev_gre_build_header(), GRE protocol is set based on packet_type of flow.
If it's about an Ethernet packet, it is set to ETP_TYPE_TEB. Otherwise, if the 
name space is OFPHTN_ETHERNET, it is set according to the name space type.

Signed-off-by: Jan Scheurich <jan.scheur...@ericsson.com>
---
 lib/netdev-native-tnl.c | 8 +++++---
 1 file changed, 5 insertions(+), 3 deletions(-)

diff --git a/lib/netdev-native-tnl.c b/lib/netdev-native-tnl.c
index 2d947c2..76dd07e 100644
--- a/lib/netdev-native-tnl.c
+++ b/lib/netdev-native-tnl.c
@@ -462,10 +462,12 @@ netdev_gre_build_header(const struct netdev *netdev,
 
     greh = netdev_tnl_ip_build_header(data, params, IPPROTO_GRE);
 
-    if (tnl_cfg->is_layer3) {
-        greh->protocol = params->flow->dl_type;
-    } else {
+    if (params->flow->packet_type == htonl(PT_ETH)) {
         greh->protocol = htons(ETH_TYPE_TEB);
+    } else if (pt_ns(params->flow->packet_type) == OFPHTN_ETHERTYPE) {
+        greh->protocol = pt_ns_type_be(params->flow->packet_type);
+    } else {
+        return 1;
     }
     greh->flags = 0;
 
-- 
2.7.4
_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to