aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorPetr Machata <petrm@mellanox.com>2018-05-17 10:36:33 -0400
committerDavid S. Miller <davem@davemloft.net>2018-05-17 16:50:06 -0400
commita6465350ef495f5cbd76a3e505d25a01d648477e (patch)
tree0413bf24c063f5b4e758191b3dc7ade7cad08f17 /net
parenta483373ead61e6079bc8ebe27e2dfdb2e3c1559f (diff)
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@mellanox.com> Acked-by: William Tu <u9012063@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r--net/ipv6/ip6_gre.c10
1 files changed, 8 insertions, 2 deletions
diff --git a/net/ipv6/ip6_gre.c b/net/ipv6/ip6_gre.c
index 5d0a3b1ee0e9..fac820b121ae 100644
--- a/net/ipv6/ip6_gre.c
+++ b/net/ipv6/ip6_gre.c
@@ -1112,8 +1112,8 @@ static void ip6gre_tnl_link_config(struct ip6_tnl *t, int set_mtu)
1112 ip6gre_tnl_link_config_route(t, set_mtu, ip6gre_calc_hlen(t)); 1112 ip6gre_tnl_link_config_route(t, set_mtu, ip6gre_calc_hlen(t));
1113} 1113}
1114 1114
1115static int ip6gre_tnl_change(struct ip6_tnl *t, 1115static void ip6gre_tnl_copy_tnl_parm(struct ip6_tnl *t,
1116 const struct __ip6_tnl_parm *p, int set_mtu) 1116 const struct __ip6_tnl_parm *p)
1117{ 1117{
1118 t->parms.laddr = p->laddr; 1118 t->parms.laddr = p->laddr;
1119 t->parms.raddr = p->raddr; 1119 t->parms.raddr = p->raddr;
@@ -1129,6 +1129,12 @@ static int ip6gre_tnl_change(struct ip6_tnl *t,
1129 t->parms.o_flags = p->o_flags; 1129 t->parms.o_flags = p->o_flags;
1130 t->parms.fwmark = p->fwmark; 1130 t->parms.fwmark = p->fwmark;
1131 dst_cache_reset(&t->dst_cache); 1131 dst_cache_reset(&t->dst_cache);
1132}
1133
1134static int ip6gre_tnl_change(struct ip6_tnl *t, const struct __ip6_tnl_parm *p,
1135 int set_mtu)
1136{
1137 ip6gre_tnl_copy_tnl_parm(t, p);
1132 ip6gre_tnl_link_config(t, set_mtu); 1138 ip6gre_tnl_link_config(t, set_mtu);
1133 return 0; 1139 return 0;
1134} 1140}