Commit a6465350 authored by Petr Machata's avatar Petr Machata Committed by David S. Miller

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: 5a963eb6 ("ip6_gre: Add ERSPAN native tunnel support")
Signed-off-by: default avatarPetr Machata <petrm@mellanox.com>
Acked-by: default avatarWilliam Tu <u9012063@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent a483373e
...@@ -1112,8 +1112,8 @@ static void ip6gre_tnl_link_config(struct ip6_tnl *t, int set_mtu) ...@@ -1112,8 +1112,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)); ip6gre_tnl_link_config_route(t, set_mtu, ip6gre_calc_hlen(t));
} }
static int ip6gre_tnl_change(struct ip6_tnl *t, static void ip6gre_tnl_copy_tnl_parm(struct ip6_tnl *t,
const struct __ip6_tnl_parm *p, int set_mtu) const struct __ip6_tnl_parm *p)
{ {
t->parms.laddr = p->laddr; t->parms.laddr = p->laddr;
t->parms.raddr = p->raddr; t->parms.raddr = p->raddr;
...@@ -1129,6 +1129,12 @@ static int ip6gre_tnl_change(struct ip6_tnl *t, ...@@ -1129,6 +1129,12 @@ static int ip6gre_tnl_change(struct ip6_tnl *t,
t->parms.o_flags = p->o_flags; t->parms.o_flags = p->o_flags;
t->parms.fwmark = p->fwmark; t->parms.fwmark = p->fwmark;
dst_cache_reset(&t->dst_cache); 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); ip6gre_tnl_link_config(t, set_mtu);
return 0; return 0;
} }
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment