From: Adhemerval Zanella <adhemerval.zanella@linaro.org>
To: Florian Weimer <fweimer@redhat.com>
Cc: Adhemerval Zanella via Libc-alpha <libc-alpha@sourceware.org>
Subject: Re: [PATCH v2 2/2] linux: Fix ancillary 64-bit time timestamp conversion (BZ #28349, BZ #28350)
Date: Fri, 10 Dec 2021 10:44:58 -0300 [thread overview]
Message-ID: <8538f1fc-cac4-06d5-010c-6600dd4357db@linaro.org> (raw)
In-Reply-To: <87ilvw8tqv.fsf@oldenburg.str.redhat.com>
On 10/12/2021 10:38, Florian Weimer wrote:
> * Adhemerval Zanella:
>
>> On 10/12/2021 09:59, Florian Weimer wrote:
>>> * Florian Weimer:
>>>
>>>> * Adhemerval Zanella:
>>>>
>>>>> Indeed I think it should be safe to drop the check, we already check
>>>>> if before with CMSG_SPACE and return MSG_CTRUNC if this is no extra
>>>>> space (which will make CMSG_NXTHDR return NULL).
>>>>>
>>>>> Are you ok with this change?
>>>>
>>>> Let me read it again …
>>>
>>> I don't see how we patch anything if CMSG_NEXT (msg, last) is null.
>>
>> The issue is the 'last = cmsg' not being updated for 'cmsg->cmsg_level
>> != SOL_SOCKET'.
>
> Sorry, I don't understand. Does this mean that the patch needs fixing?
I think the indentation change made the patch hard to read, the issues is
currently we have:
for (cmsg = CMSG_FIRSTHDR (msg);
cmsg != NULL;
cmsg = CMSG_NXTHDR (msg, cmsg))
{
if (cmsg->cmsg_level != SOL_SOCKET)
continue;
[...]
last = cmsg;
}
Where we need 'last' to updated regardless of 'cmsg_level':
for (cmsg = CMSG_FIRSTHDR (msg);
cmsg != NULL;
cmsg = CMSG_NXTHDR (msg, cmsg))
{
if (cmsg->cmsg_level == SOL_SOCKET)
[...]
last = cmsg;
}
The 'cmsg == NULL' at the end that you spotted is just an optimization.
next prev parent reply other threads:[~2021-12-10 13:45 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-09-29 14:06 [PATCH v2 1/2] support: Add support_socket_so_timestamp_time64 Adhemerval Zanella
2021-09-29 14:06 ` [PATCH v2 2/2] linux: Fix ancillary 64-bit time timestamp conversion (BZ #28349, BZ #28350) Adhemerval Zanella
2021-10-08 11:58 ` Adhemerval Zanella
2021-10-20 12:08 ` Adhemerval Zanella
2021-11-08 18:30 ` Adhemerval Zanella
2021-12-10 11:03 ` Adhemerval Zanella
2021-12-10 11:53 ` Florian Weimer
2021-12-10 12:47 ` Adhemerval Zanella
2021-12-10 12:56 ` Florian Weimer
2021-12-10 12:59 ` Florian Weimer
2021-12-10 13:13 ` Adhemerval Zanella
2021-12-10 13:38 ` Florian Weimer
2021-12-10 13:44 ` Adhemerval Zanella [this message]
2021-12-10 13:53 ` Andreas Schwab
2021-12-10 13:56 ` Adhemerval Zanella
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=8538f1fc-cac4-06d5-010c-6600dd4357db@linaro.org \
--to=adhemerval.zanella@linaro.org \
--cc=fweimer@redhat.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).