[ovs-dev] [PATCH 4/8] net: ip6_gre: Split up ip6gre_tnl_change()

William Tu u9012063 at gmail.com
Tue May 29 12:55:01 UTC 2018


commit a6465350ef495f5cbd76a3e505d25a01d648477e
Author: Petr Machata <petrm at mellanox.com>
Date:   Thu May 17 16:36:33 2018 +0200

    net: ip6_gre: Split up ip6gre_tnl_change()

    Split a reusable function ip6gre_tnl_copy_tnl_parm() from
    ip6gre_tnl_change(). This will allow ERSPAN-specific code to
    reuse the common parts while customizing the behavior for ERSPAN.

    Fixes: 5a963eb61b7c ("ip6_gre: Add ERSPAN native tunnel support")
    Signed-off-by: Petr Machata <petrm at mellanox.com>
    Acked-by: William Tu <u9012063 at gmail.com>
    Signed-off-by: David S. Miller <davem at davemloft.net>

Cc: Greg Rose <gvrose8192 at gmail.com>
Signed-off-by: William Tu <u9012063 at gmail.com>
---
 datapath/linux/compat/ip6_gre.c | 10 ++++++++--
 1 file changed, 8 insertions(+), 2 deletions(-)

diff --git a/datapath/linux/compat/ip6_gre.c b/datapath/linux/compat/ip6_gre.c
index c55ca56ed4b5..d8c5a83d8531 100644
--- a/datapath/linux/compat/ip6_gre.c
+++ b/datapath/linux/compat/ip6_gre.c
@@ -1270,8 +1270,8 @@ static void ip6gre_tnl_link_config(struct ip6_tnl *t, int set_mtu)
 	ip6gre_tnl_link_config_route(t, set_mtu, ip6gre_calc_hlen(t));
 }
 
-static int ip6gre_tnl_change(struct ip6_tnl *t,
-	const struct __ip6_tnl_parm *p, int set_mtu)
+static void ip6gre_tnl_copy_tnl_parm(struct ip6_tnl *t,
+				     const struct __ip6_tnl_parm *p)
 {
 	t->parms.laddr = p->laddr;
 	t->parms.raddr = p->raddr;
@@ -1287,6 +1287,12 @@ static int ip6gre_tnl_change(struct ip6_tnl *t,
 	t->parms.o_flags = p->o_flags;
 	t->parms.fwmark = p->fwmark;
 	dst_cache_reset(&t->dst_cache);
+}
+
+static int ip6gre_tnl_change(struct ip6_tnl *t, const struct __ip6_tnl_parm *p,
+			     int set_mtu)
+{
+	ip6gre_tnl_copy_tnl_parm(t, p);
 	ip6gre_tnl_link_config(t, set_mtu);
 	return 0;
 }
-- 
2.7.4



More information about the dev mailing list