[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20210415100049.7dde542d@kicinski-fedora-pc1c0hjn.dhcp.thefacebook.com>
Date: Thu, 15 Apr 2021 10:00:49 -0700
From: Jakub Kicinski <kuba@...nel.org>
To: Saeed Mahameed <saeed@...nel.org>
Cc: "David S. Miller" <davem@...emloft.net>, netdev@...r.kernel.org,
"Cc : Steffen Klassert" <steffen.klassert@...unet.com>,
Huy Nguyen <huyn@...dia.com>, Raed Salem <raeds@...dia.com>
Subject: Re: [PATCH net 2/3] net/xfrm: Add inner_ipproto into sec_path
On Wed, 14 Apr 2021 16:25:39 -0700 Saeed Mahameed wrote:
> +static void get_inner_ipproto(struct sk_buff *skb, struct sec_path *sp)
> +{
> + const struct ethhdr *eth;
> +
> + if (!skb->inner_protocol)
> + return;
> +
> + if (skb->inner_protocol_type == ENCAP_TYPE_IPPROTO) {
> + sp->inner_ipproto = skb->inner_protocol;
> + return;
> + }
> +
> + if (skb->inner_protocol_type != ENCAP_TYPE_ETHER)
> + return;
> +
> + eth = (struct ethhdr *)skb_inner_mac_header(skb);
> +
> + switch (eth->h_proto) {
> + case ntohs(ETH_P_IPV6):
> + sp->inner_ipproto = inner_ipv6_hdr(skb)->nexthdr;
> + break;
> + case ntohs(ETH_P_IP):
> + sp->inner_ipproto = inner_ip_hdr(skb)->protocol;
> + break;
> + default:
> + return;
> + }
> +}
Bunch of sparse warnings here, please check.
Powered by blists - more mailing lists