Skip to content

Commit

Permalink
datapath: ip6_gre: Split up ip6gre_tnl_change()
Browse files Browse the repository at this point in the history
commit a6465350ef495f5cbd76a3e505d25a01d648477e
Author: Petr Machata <[email protected]>
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 <[email protected]>
    Acked-by: William Tu <[email protected]>
    Signed-off-by: David S. Miller <[email protected]>

Cc: Greg Rose <[email protected]>
Signed-off-by: William Tu <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
Reviewed-by: Greg Rose <[email protected]>
Tested-by: Greg Rose <[email protected]>
  • Loading branch information
williamtu authored and blp committed May 29, 2018
1 parent 9847f8b commit ec7f30a
Showing 1 changed file with 8 additions and 2 deletions.
10 changes: 8 additions & 2 deletions datapath/linux/compat/ip6_gre.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand All @@ -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;
}
Expand Down

0 comments on commit ec7f30a

Please sign in to comment.