From: Michael Ellerman <mpe@ellerman.id.au>
To: Deepa Dinamani <deepa.kernel@gmail.com>,
davem@davemloft.net, linux-kernel@vger.kernel.org
Cc: netdev@vger.kernel.org, arnd@arndb.de, y2038@lists.linaro.org,
ccaulfie@redhat.com, deller@gmx.de, paulus@samba.org,
ralf@linux-mips.org, rth@twiddle.net, cluster-devel@redhat.com,
linuxppc-dev@lists.ozlabs.org, linux-alpha@vger.kernel.org,
linux-arch@vger.kernel.org, linux-mips@vger.kernel.org,
linux-parisc@vger.kernel.org, sparclinux@vger.kernel.org
Subject: Re: [PATCH net-next v5 11/12] socket: Rename SO_RCVTIMEO/ SO_SNDTIMEO with _OLD suffixes
Date: Wed, 06 Feb 2019 22:58:18 +1100 [thread overview]
Message-ID: <87o97pku1x.fsf@concordia.ellerman.id.au> (raw)
In-Reply-To: <20190202153454.7121-12-deepa.kernel@gmail.com>
Deepa Dinamani <deepa.kernel@gmail.com> writes:
> SO_RCVTIMEO and SO_SNDTIMEO socket options use struct timeval
> as the time format. struct timeval is not y2038 safe.
> The subsequent patches in the series add support for new socket
> timeout options with _NEW suffix that will use y2038 safe
> data structures. Although the existing struct timeval layout
> is sufficiently wide to represent timeouts, because of the way
> libc will interpret time_t based on user defined flag, these
> new flags provide a way of having a structure that is the same
> for all architectures consistently.
> Rename the existing options with _OLD suffix forms so that the
> right option is enabled for userspace applications according
> to the architecture and time_t definition of libc.
>
> Signed-off-by: Deepa Dinamani <deepa.kernel@gmail.com>
> Acked-by: Willem de Bruijn <willemb@google.com>
> Cc: ccaulfie@redhat.com
> Cc: deller@gmx.de
> Cc: paulus@samba.org
> Cc: ralf@linux-mips.org
> Cc: rth@twiddle.net
> Cc: cluster-devel@redhat.com
> Cc: linuxppc-dev@lists.ozlabs.org
> Cc: linux-alpha@vger.kernel.org
> Cc: linux-arch@vger.kernel.org
> Cc: linux-mips@vger.kernel.org
> Cc: linux-parisc@vger.kernel.org
> Cc: sparclinux@vger.kernel.org
> ---
> arch/alpha/include/uapi/asm/socket.h | 7 +++++--
> arch/mips/include/uapi/asm/socket.h | 6 ++++--
> arch/parisc/include/uapi/asm/socket.h | 6 ++++--
> arch/powerpc/include/uapi/asm/socket.h | 4 ++--
The powerpc changes look OK to me.
Acked-by: Michael Ellerman <mpe@ellerman.id.au> (powerpc)
cheers
> diff --git a/arch/powerpc/include/uapi/asm/socket.h b/arch/powerpc/include/uapi/asm/socket.h
> index 94de465e0920..12aa0c43e775 100644
> --- a/arch/powerpc/include/uapi/asm/socket.h
> +++ b/arch/powerpc/include/uapi/asm/socket.h
> @@ -11,8 +11,8 @@
>
> #define SO_RCVLOWAT 16
> #define SO_SNDLOWAT 17
> -#define SO_RCVTIMEO 18
> -#define SO_SNDTIMEO 19
> +#define SO_RCVTIMEO_OLD 18
> +#define SO_SNDTIMEO_OLD 19
> #define SO_PASSCRED 20
> #define SO_PEERCRED 21
>
> diff --git a/include/uapi/asm-generic/socket.h b/include/uapi/asm-generic/socket.h
> index 2713e0fa68ef..c56b8b487c12 100644
> --- a/include/uapi/asm-generic/socket.h
> +++ b/include/uapi/asm-generic/socket.h
> @@ -30,8 +30,8 @@
> #define SO_PEERCRED 17
> #define SO_RCVLOWAT 18
> #define SO_SNDLOWAT 19
> -#define SO_RCVTIMEO 20
> -#define SO_SNDTIMEO 21
> +#define SO_RCVTIMEO_OLD 20
> +#define SO_SNDTIMEO_OLD 21
> #endif
>
> /* Security levels - as per NRL IPv6 - don't actually do anything */
> @@ -116,6 +116,8 @@
>
> #if !defined(__KERNEL__)
>
> +#define SO_RCVTIMEO SO_RCVTIMEO_OLD
> +#define SO_SNDTIMEO SO_SNDTIMEO_OLD
> #if __BITS_PER_LONG == 64 || (defined(__x86_64__) && defined(__ILP32__))
> /* on 64-bit and x32, avoid the ?: operator */
> #define SO_TIMESTAMP SO_TIMESTAMP_OLD
next prev parent reply other threads:[~2019-02-06 11:58 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-02-02 15:34 [PATCH net-next v5 00/12] net: y2038-safe socket timestamps Deepa Dinamani
2019-02-02 15:34 ` [PATCH net-next v5 01/12] selftests: add missing include unistd Deepa Dinamani
2019-02-02 15:34 ` [PATCH net-next v5 02/12] socket: move compat timeout handling into sock.c Deepa Dinamani
2019-02-02 15:34 ` [PATCH net-next v5 03/12] arch: Use asm-generic/socket.h when possible Deepa Dinamani
2019-02-02 15:34 ` [PATCH net-next v5 04/12] sockopt: Rename SO_TIMESTAMP* to SO_TIMESTAMP*_OLD Deepa Dinamani
2019-02-02 15:34 ` [PATCH net-next v5 05/12] arch: sparc: Override struct __kernel_old_timeval Deepa Dinamani
2019-02-02 15:34 ` [PATCH net-next v5 06/12] socket: Use old_timeval types for socket timestamps Deepa Dinamani
2019-02-02 15:34 ` [PATCH net-next v5 07/12] socket: Add struct __kernel_sock_timeval Deepa Dinamani
2019-02-02 15:34 ` [PATCH net-next v5 08/12] socket: Add SO_TIMESTAMP[NS]_NEW Deepa Dinamani
2019-02-02 15:34 ` [PATCH net-next v5 09/12] socket: Add SO_TIMESTAMPING_NEW Deepa Dinamani
2019-02-10 15:43 ` Ran Rozenstein
2019-02-11 3:21 ` Deepa Dinamani
2019-02-12 19:08 ` Deepa Dinamani
2019-02-02 15:34 ` [PATCH net-next v5 10/12] socket: Update timestamping Documentation Deepa Dinamani
2019-02-02 15:34 ` [PATCH net-next v5 11/12] socket: Rename SO_RCVTIMEO/ SO_SNDTIMEO with _OLD suffixes Deepa Dinamani
2019-02-06 11:58 ` Michael Ellerman [this message]
2019-02-02 15:34 ` [PATCH net-next v5 12/12] sock: Add SO_RCVTIMEO_NEW and SO_SNDTIMEO_NEW Deepa Dinamani
2019-02-02 17:15 ` Oliver Hartkopp
2019-02-03 2:47 ` Deepa Dinamani
2019-02-06 11:56 ` Michael Ellerman
2019-02-09 1:44 ` Deepa Dinamani
2019-02-10 22:12 ` Michael Ellerman
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=87o97pku1x.fsf@concordia.ellerman.id.au \
--to=mpe@ellerman.id.au \
--cc=arnd@arndb.de \
--cc=ccaulfie@redhat.com \
--cc=cluster-devel@redhat.com \
--cc=davem@davemloft.net \
--cc=deepa.kernel@gmail.com \
--cc=deller@gmx.de \
--cc=linux-alpha@vger.kernel.org \
--cc=linux-arch@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mips@vger.kernel.org \
--cc=linux-parisc@vger.kernel.org \
--cc=linuxppc-dev@lists.ozlabs.org \
--cc=netdev@vger.kernel.org \
--cc=paulus@samba.org \
--cc=ralf@linux-mips.org \
--cc=rth@twiddle.net \
--cc=sparclinux@vger.kernel.org \
--cc=y2038@lists.linaro.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 NNTP newsgroup(s).