diff mbox series

net: xfrm: xfrm_policy.c: remove some unnecessary cases in decode_session6

Message ID 20200725134949.z53thk4jubabiubd@pesu.pes.edu
State Awaiting Upstream
Delegated to: David Miller
Headers show
Series net: xfrm: xfrm_policy.c: remove some unnecessary cases in decode_session6 | expand

Commit Message

B K Karthik July 25, 2020, 1:49 p.m. UTC
remove some unnecessary cases in decode_session6

Signed-off-by: B K Karthik <bkkarthik@pesu.pes.edu>
---
 net/xfrm/xfrm_policy.c | 4 ----
 1 file changed, 4 deletions(-)

Comments

Steffen Klassert July 27, 2020, 9:36 a.m. UTC | #1
On Sat, Jul 25, 2020 at 07:19:49PM +0530, B K Karthik wrote:
> remove some unnecessary cases in decode_session6
> 
> Signed-off-by: B K Karthik <bkkarthik@pesu.pes.edu>
> ---
>  net/xfrm/xfrm_policy.c | 4 ----
>  1 file changed, 4 deletions(-)
> 
> diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
> index 19c5e0fa3f44..e1c988a89382 100644
> --- a/net/xfrm/xfrm_policy.c
> +++ b/net/xfrm/xfrm_policy.c
> @@ -3449,10 +3449,6 @@ decode_session6(struct sk_buff *skb, struct flowi *fl, bool reverse)
>  			fl6->flowi6_proto = nexthdr;
>  			return;
>  #endif
> -		/* XXX Why are there these headers? */
> -		case IPPROTO_AH:
> -		case IPPROTO_ESP:
> -		case IPPROTO_COMP:
>  		default:
>  			fl6->fl6_ipsec_spi = 0;
>  			fl6->flowi6_proto = nexthdr;

IPv4 implements spi parsing for these protocols, IPv6
does not do it. Before you just remove something, you
should think about which is the correct behaviour and
then do it for both, IPv4 and IPv6.
diff mbox series

Patch

diff --git a/net/xfrm/xfrm_policy.c b/net/xfrm/xfrm_policy.c
index 19c5e0fa3f44..e1c988a89382 100644
--- a/net/xfrm/xfrm_policy.c
+++ b/net/xfrm/xfrm_policy.c
@@ -3449,10 +3449,6 @@  decode_session6(struct sk_buff *skb, struct flowi *fl, bool reverse)
 			fl6->flowi6_proto = nexthdr;
 			return;
 #endif
-		/* XXX Why are there these headers? */
-		case IPPROTO_AH:
-		case IPPROTO_ESP:
-		case IPPROTO_COMP:
 		default:
 			fl6->fl6_ipsec_spi = 0;
 			fl6->flowi6_proto = nexthdr;