[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <6b5b7133-0dee-4539-8109-674f236e0fa5@redhat.com>
Date: Tue, 29 Oct 2024 12:45:01 +0100
From: Paolo Abeni <pabeni@...hat.com>
To: chia-yu.chang@...ia-bell-labs.com, netdev@...r.kernel.org,
davem@...emloft.net, edumazet@...gle.com, kuba@...nel.org,
dsahern@...nel.org, netfilter-devel@...r.kernel.org, kadlec@...filter.org,
coreteam@...filter.org, pablo@...filter.org, bpf@...r.kernel.org,
joel.granados@...nel.org, linux-fsdevel@...r.kernel.org, kees@...nel.org,
mcgrof@...nel.org, ij@...nel.org, ncardwell@...gle.com,
koen.de_schepper@...ia-bell-labs.com, g.white@...leLabs.com,
ingemar.s.johansson@...csson.com, mirja.kuehlewind@...csson.com,
cheshire@...le.com, rs.ietf@....at, Jason_Livingood@...cast.com,
vidhi_goel@...le.com
Subject: Re: [PATCH v4 net-next 04/14] tcp: extend TCP flags to allow AE
bit/ACE field
On 10/29/24 12:43, Paolo Abeni wrote:
> On 10/21/24 23:59, chia-yu.chang@...ia-bell-labs.com wrote:
>> diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c
>> index 9d3dd101ea71..9fe314a59240 100644
>> --- a/net/ipv4/tcp_ipv4.c
>> +++ b/net/ipv4/tcp_ipv4.c
>> @@ -2162,7 +2162,8 @@ static void tcp_v4_fill_cb(struct sk_buff *skb, const struct iphdr *iph,
>> TCP_SKB_CB(skb)->end_seq = (TCP_SKB_CB(skb)->seq + th->syn + th->fin +
>> skb->len - th->doff * 4);
>> TCP_SKB_CB(skb)->ack_seq = ntohl(th->ack_seq);
>> - TCP_SKB_CB(skb)->tcp_flags = tcp_flag_byte(th);
>> + TCP_SKB_CB(skb)->tcp_flags = ntohs(*(__be16 *)&tcp_flag_word(th)) &
>> + TCPHDR_FLAGS_MASK;
>
> As you access the same 2 bytes even later.
[Whoops, sorry part of the reply was unintentionally stripped.]
I suggest creating a specific helper to fetch them.
/P
Powered by blists - more mailing lists