aboutsummaryrefslogtreecommitdiffstats
path: root/include/uapi/linux/ppp_defs.h
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2019-04-16 22:19:44 +0200
committerArnd Bergmann <arnd@arndb.de>2019-10-23 17:23:47 +0200
commit17c7e7f407085f510a815c0c99b3fd25d5b13110 (patch)
treeaa674e21bcd6b6380049c28333e6b70ab909de34 /include/uapi/linux/ppp_defs.h
parentcompat_ioctl: move PPPIOCSCOMPRESS to ppp_generic (diff)
downloadlinux-dev-17c7e7f407085f510a815c0c99b3fd25d5b13110.tar.xz
linux-dev-17c7e7f407085f510a815c0c99b3fd25d5b13110.zip
compat_ioctl: handle PPPIOCGIDLE for 64-bit time_t
The ppp_idle structure is defined in terms of __kernel_time_t, which is defined as 'long' on all architectures, and this usage is not affected by the y2038 problem since it transports a time interval rather than an absolute time. However, the ppp user space defines the same structure as time_t, which may be 64-bit wide on new libc versions even on 32-bit architectures. It's easy enough to just handle both possible structure layouts on all architectures, to deal with the possibility that a user space ppp implementation comes with its own ppp_idle structure definition, as well as to document the fact that the driver is y2038-safe. Doing this also avoids the need for a special compat mode translation, since 32-bit and 64-bit kernels now support the same interfaces. The old 32-bit structure is also available on native 64-bit architectures now, but this is harmless. Cc: netdev@vger.kernel.org Cc: linux-ppp@vger.kernel.org Cc: Paul Mackerras <paulus@samba.org> Cc: "David S. Miller" <davem@davemloft.net> Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Diffstat (limited to 'include/uapi/linux/ppp_defs.h')
-rw-r--r--include/uapi/linux/ppp_defs.h14
1 files changed, 14 insertions, 0 deletions
diff --git a/include/uapi/linux/ppp_defs.h b/include/uapi/linux/ppp_defs.h
index fff51b91b409..0039fa39a358 100644
--- a/include/uapi/linux/ppp_defs.h
+++ b/include/uapi/linux/ppp_defs.h
@@ -142,10 +142,24 @@ struct ppp_comp_stats {
/*
* The following structure records the time in seconds since
* the last NP packet was sent or received.
+ *
+ * Linux implements both 32-bit and 64-bit time_t versions
+ * for compatibility with user space that defines ppp_idle
+ * based on the libc time_t.
*/
struct ppp_idle {
__kernel_time_t xmit_idle; /* time since last NP packet sent */
__kernel_time_t recv_idle; /* time since last NP packet received */
};
+struct ppp_idle32 {
+ __s32 xmit_idle; /* time since last NP packet sent */
+ __s32 recv_idle; /* time since last NP packet received */
+};
+
+struct ppp_idle64 {
+ __s64 xmit_idle; /* time since last NP packet sent */
+ __s64 recv_idle; /* time since last NP packet received */
+};
+
#endif /* _UAPI_PPP_DEFS_H_ */