[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <677729b5-baa5-f6fa-c4ee-1d1417e4779a@nvidia.com>
Date: Wed, 28 Apr 2021 20:50:06 -0500
From: Huy Nguyen <huyn@...dia.com>
To: Jakub Kicinski <kuba@...nel.org>, Saeed Mahameed <saeed@...nel.org>
CC: "David S. Miller" <davem@...emloft.net>, <netdev@...r.kernel.org>,
"Cc : Steffen Klassert" <steffen.klassert@...unet.com>,
Raed Salem <raeds@...dia.com>
Subject: Re: [PATCH net 2/3] net/xfrm: Add inner_ipproto into sec_path
I fixed. Thank you. Saeed will resubmit.
On 4/15/2021 12:00 PM, Jakub Kicinski wrote:
> 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