2
0
mirror of https://github.com/openvswitch/ovs synced 2025-10-29 15:28:56 +00:00

compat: Move function to header

tnl_flags_to_gre_flags is also needed in both ip_gre.c and gre.c on
some kernels.  Move it from ip_gre.c to the common header.

Signed-off-by: Greg Rose <gvrose8192@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: William Tu <u9012063@gmail.com>
This commit is contained in:
Greg Rose
2018-02-27 08:36:28 -08:00
committed by Ben Pfaff
parent 4a8a3521e1
commit f62f550420

View File

@@ -30,6 +30,29 @@ static inline struct net_device *rpl_gretap_fb_dev_create(
#else
#include_next <net/gre.h>
#define tnl_flags_to_gre_flags rpl_tnl_flags_to_gre_flags
static inline __be16 tnl_flags_to_gre_flags(__be16 tflags)
{
__be16 flags = 0;
if (tflags & TUNNEL_CSUM)
flags |= GRE_CSUM;
if (tflags & TUNNEL_ROUTING)
flags |= GRE_ROUTING;
if (tflags & TUNNEL_KEY)
flags |= GRE_KEY;
if (tflags & TUNNEL_SEQ)
flags |= GRE_SEQ;
if (tflags & TUNNEL_STRICT)
flags |= GRE_STRICT;
if (tflags & TUNNEL_REC)
flags |= GRE_REC;
if (tflags & TUNNEL_VERSION)
flags |= GRE_VERSION;
return flags;
}
#ifndef HAVE_GRE_CISCO_REGISTER
/* GRE demux not available, implement our own demux. */