From mboxrd@z Thu Jan 1 00:00:00 1970 From: Lorenzo Colitti Subject: [RFC ipsec-next 4/4] net: xfrm: don't pass tunnel objects to xfrm6_rcv_spi. Date: Tue, 19 Dec 2017 01:16:56 +0900 Message-ID: <20171218161656.40618-5-lorenzo@google.com> References: <20171218161656.40618-1-lorenzo@google.com> Cc: steffen.klassert@secunet.com, subashab@codeaurora.org, nharold@google.com, Lorenzo Colitti To: netdev@vger.kernel.org Return-path: Received: from mail-pl0-f68.google.com ([209.85.160.68]:46761 "EHLO mail-pl0-f68.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S936253AbdLRQRR (ORCPT ); Mon, 18 Dec 2017 11:17:17 -0500 Received: by mail-pl0-f68.google.com with SMTP id i6so5095028plt.13 for ; Mon, 18 Dec 2017 08:17:17 -0800 (PST) In-Reply-To: <20171218161656.40618-1-lorenzo@google.com> Sender: netdev-owner@vger.kernel.org List-ID: This change removes the tunnel parameter from xfrm6_rcv_spi and deletes xfrm6_rcv_tnl. These were only used by the VTI code and are now unused. Signed-off-by: Lorenzo Colitti --- include/net/xfrm.h | 4 +--- net/ipv4/ip_vti.c | 4 ++-- net/ipv6/ip6_vti.c | 2 +- net/ipv6/xfrm6_input.c | 13 +++---------- net/ipv6/xfrm6_tunnel.c | 2 +- 5 files changed, 8 insertions(+), 17 deletions(-) diff --git a/include/net/xfrm.h b/include/net/xfrm.h index 3d245f2f6f6c..fc19dda73c50 100644 --- a/include/net/xfrm.h +++ b/include/net/xfrm.h @@ -1638,10 +1638,8 @@ int xfrm4_tunnel_deregister(struct xfrm_tunnel *handler, unsigned short family); void xfrm4_local_error(struct sk_buff *skb, u32 mtu); int xfrm6_extract_header(struct sk_buff *skb); int xfrm6_extract_input(struct xfrm_state *x, struct sk_buff *skb); -int xfrm6_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi, - struct ip6_tnl *t); +int xfrm6_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi); int xfrm6_transport_finish(struct sk_buff *skb, int async); -int xfrm6_rcv_tnl(struct sk_buff *skb, struct ip6_tnl *t); int xfrm6_rcv(struct sk_buff *skb); int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr, xfrm_address_t *saddr, u8 proto); diff --git a/net/ipv4/ip_vti.c b/net/ipv4/ip_vti.c index f5793782c418..144ec34fd975 100644 --- a/net/ipv4/ip_vti.c +++ b/net/ipv4/ip_vti.c @@ -384,12 +384,12 @@ static int vti4_err(struct sk_buff *skb, u32 info) static __be16 vti_flags_to_tnl_flags(__be16 i_flags) { - return VTI_ISVTI | ((i_flags & VTI_KEYED) ? GRE_KEY : 0); + return VTI_ISVTI | ((i_flags & VTI_KEYED) ? TUNNEL_KEY : 0); } static __be16 tnl_flags_to_vti_flags(__be16 i_flags) { - return VTI_ISVTI | ((i_flags & GRE_KEY) ? VTI_KEYED : 0); + return VTI_ISVTI | ((i_flags & TUNNEL_KEY) ? VTI_KEYED : 0); } static int diff --git a/net/ipv6/ip6_vti.c b/net/ipv6/ip6_vti.c index 3797738c828f..3a68b7ba1b9c 100644 --- a/net/ipv6/ip6_vti.c +++ b/net/ipv6/ip6_vti.c @@ -391,7 +391,7 @@ static int vti6_rcv(struct sk_buff *skb) int nexthdr = skb_network_header(skb)[IP6CB(skb)->nhoff]; XFRM_TUNNEL_SKB_CB(skb)->tunnel.lookup = vti6_lookup; - return xfrm6_rcv_spi(skb, nexthdr, 0, NULL); + return xfrm6_rcv_spi(skb, nexthdr, 0); } static int vti6_rcv_cb(struct sk_buff *skb, int err) diff --git a/net/ipv6/xfrm6_input.c b/net/ipv6/xfrm6_input.c index 6d1b734fef8d..5f20e309263f 100644 --- a/net/ipv6/xfrm6_input.c +++ b/net/ipv6/xfrm6_input.c @@ -22,8 +22,7 @@ int xfrm6_extract_input(struct xfrm_state *x, struct sk_buff *skb) return xfrm6_extract_header(skb); } -int xfrm6_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi, - struct ip6_tnl *t) +int xfrm6_rcv_spi(struct sk_buff *skb, int nexthdr, __be32 spi) { XFRM_SPI_SKB_CB(skb)->family = AF_INET6; XFRM_SPI_SKB_CB(skb)->daddroff = offsetof(struct ipv6hdr, daddr); @@ -59,16 +58,10 @@ int xfrm6_transport_finish(struct sk_buff *skb, int async) return -1; } -int xfrm6_rcv_tnl(struct sk_buff *skb, struct ip6_tnl *t) -{ - return xfrm6_rcv_spi(skb, skb_network_header(skb)[IP6CB(skb)->nhoff], - 0, t); -} -EXPORT_SYMBOL(xfrm6_rcv_tnl); - int xfrm6_rcv(struct sk_buff *skb) { - return xfrm6_rcv_tnl(skb, NULL); + return xfrm6_rcv_spi(skb, skb_network_header(skb)[IP6CB(skb)->nhoff], + 0); } EXPORT_SYMBOL(xfrm6_rcv); int xfrm6_input_addr(struct sk_buff *skb, xfrm_address_t *daddr, diff --git a/net/ipv6/xfrm6_tunnel.c b/net/ipv6/xfrm6_tunnel.c index f85f0d7480ac..02161543a932 100644 --- a/net/ipv6/xfrm6_tunnel.c +++ b/net/ipv6/xfrm6_tunnel.c @@ -236,7 +236,7 @@ static int xfrm6_tunnel_rcv(struct sk_buff *skb) __be32 spi; spi = xfrm6_tunnel_spi_lookup(net, (const xfrm_address_t *)&iph->saddr); - return xfrm6_rcv_spi(skb, IPPROTO_IPV6, spi, NULL); + return xfrm6_rcv_spi(skb, IPPROTO_IPV6, spi); } static int xfrm6_tunnel_err(struct sk_buff *skb, struct inet6_skb_parm *opt, -- 2.15.1.504.g5279b80103-goog