Group :: Development/Kernel
RPM: glibc-kernheaders
Main Changelog Spec Patches Sources Download Gear Bugs and FR Repocop
Patch: 0005-uapi-fix-linux-sctp.h-userspace-compilation-errors.patch
Download
Download
From 1e045265911216230e326e1783a09d959f45fd43 Mon Sep 17 00:00:00 2001
From: "Dmitry V. Levin" <ldv@altlinux.org>
Date: Thu, 23 Feb 2017 23:34:39 +0000
Subject: [PATCH 05/21] uapi: fix linux/sctp.h userspace compilation errors
Consistently use types from linux/types.h to fix the following
linux/sctp.h userspace compilation errors:
/usr/include/linux/sctp.h:773:2: error: unknown type name 'uint32_t'
uint32_t sack_delay;
/usr/include/linux/sctp.h:774:2: error: unknown type name 'uint32_t'
uint32_t sack_freq;
/usr/include/linux/sctp.h:779:5: error: unknown type name 'uint32_t'
uint32_t assoc_value;
/usr/include/linux/sctp.h:849:2: error: unknown type name 'uint8_t'
uint8_t gauth_chunks[];
/usr/include/linux/sctp.h:1036:2: error: unknown type name 'uint16_t'
uint16_t srs_flags;
/usr/include/linux/sctp.h:1037:2: error: unknown type name 'uint16_t'
uint16_t srs_number_streams; /* 0 == ALL */
/usr/include/linux/sctp.h:1038:2: error: unknown type name 'uint16_t'
uint16_t srs_stream_list[]; /* list if srs_num_streams is not 0 */
/usr/include/linux/sctp.h:1043:2: error: unknown type name 'uint16_t'
uint16_t sas_instrms;
/usr/include/linux/sctp.h:1044:2: error: unknown type name 'uint16_t'
uint16_t sas_outstrms;
On the kernel side, sockaddr_storage is #define'd to
__kernel_sockaddr_storage. Replace struct sockaddr_storage with
struct __kernel_sockaddr_storage defined by <linux/socket.h> to fix
the following linux/sctp.h userspace compilation errors:
/usr/include/linux/sctp.h:340:26: error: field 'spc_aaddr' has incomplete type
struct sockaddr_storage spc_aaddr;
/usr/include/linux/sctp.h:633:26: error: field 'sspp_addr' has incomplete type
struct sockaddr_storage sspp_addr;
/usr/include/linux/sctp.h:646:26: error: field 'ssp_addr' has incomplete type
struct sockaddr_storage ssp_addr;
/usr/include/linux/sctp.h:688:26: error: field 'spp_address' has incomplete type
struct sockaddr_storage spp_address;
/usr/include/linux/sctp.h:793:26: error: field 'spinfo_address' has incomplete type
struct sockaddr_storage spinfo_address;
/usr/include/linux/sctp.h:908:26: error: field 'sas_obs_rto_ipaddr' has incomplete type
struct sockaddr_storage sas_obs_rto_ipaddr;
/usr/include/linux/sctp.h:948:26: error: field 'spt_address' has incomplete type
struct sockaddr_storage spt_address;
/usr/include/linux/sctp.h:1007:26: error: field 'sctpi_p_address' has incomplete type
struct sockaddr_storage sctpi_p_address;
Signed-off-by: Dmitry V. Levin <ldv@altlinux.org>
---
include/uapi/linux/sctp.h | 38 +++++++++++++++++++-------------------
1 file changed, 19 insertions(+), 19 deletions(-)
diff --git a/include/uapi/linux/sctp.h b/include/uapi/linux/sctp.h
index b8f2c4d56532..fa503fa57ae5 100644
--- a/include/uapi/linux/sctp.h
+++ b/include/uapi/linux/sctp.h
@@ -388,7 +388,7 @@ struct sctp_paddr_change {
__u16 spc_type;
__u16 spc_flags;
__u32 spc_length;
- struct sockaddr_storage spc_aaddr;
+ struct __kernel_sockaddr_storage spc_aaddr;
int spc_state;
int spc_error;
sctp_assoc_t spc_assoc_id;
@@ -724,7 +724,7 @@ struct sctp_assocparams {
*/
struct sctp_setpeerprim {
sctp_assoc_t sspp_assoc_id;
- struct sockaddr_storage sspp_addr;
+ struct __kernel_sockaddr_storage sspp_addr;
} __attribute__((packed, aligned(4)));
/*
@@ -737,7 +737,7 @@ struct sctp_setpeerprim {
*/
struct sctp_prim {
sctp_assoc_t ssp_assoc_id;
- struct sockaddr_storage ssp_addr;
+ struct __kernel_sockaddr_storage ssp_addr;
} __attribute__((packed, aligned(4)));
/* For backward compatibility use, define the old name too */
@@ -781,7 +781,7 @@ enum sctp_spp_flags {
struct sctp_paddrparams {
sctp_assoc_t spp_assoc_id;
- struct sockaddr_storage spp_address;
+ struct __kernel_sockaddr_storage spp_address;
__u32 spp_hbinterval;
__u16 spp_pathmaxrxt;
__u32 spp_pathmtu;
@@ -870,19 +870,19 @@ struct sctp_authkeyid {
*/
struct sctp_sack_info {
sctp_assoc_t sack_assoc_id;
- uint32_t sack_delay;
- uint32_t sack_freq;
+ __u32 sack_delay;
+ __u32 sack_freq;
};
struct sctp_assoc_value {
sctp_assoc_t assoc_id;
- uint32_t assoc_value;
+ __u32 assoc_value;
};
struct sctp_stream_value {
sctp_assoc_t assoc_id;
- uint16_t stream_id;
- uint16_t stream_value;
+ __u16 stream_id;
+ __u16 stream_value;
};
/*
@@ -896,7 +896,7 @@ struct sctp_stream_value {
*/
struct sctp_paddrinfo {
sctp_assoc_t spinfo_assoc_id;
- struct sockaddr_storage spinfo_address;
+ struct __kernel_sockaddr_storage spinfo_address;
__s32 spinfo_state;
__u32 spinfo_cwnd;
__u32 spinfo_srtt;
@@ -952,7 +952,7 @@ struct sctp_status {
struct sctp_authchunks {
sctp_assoc_t gauth_assoc_id;
__u32 gauth_number_of_chunks;
- uint8_t gauth_chunks[];
+ __u8 gauth_chunks[];
};
/* The broken spelling has been released already in lksctp-tools header,
@@ -1015,7 +1015,7 @@ struct sctp_getaddrs {
struct sctp_assoc_stats {
sctp_assoc_t sas_assoc_id; /* Input */
/* Transport of observed max RTO */
- struct sockaddr_storage sas_obs_rto_ipaddr;
+ struct __kernel_sockaddr_storage sas_obs_rto_ipaddr;
__u64 sas_maxrto; /* Maximum Observed RTO for period */
__u64 sas_isacks; /* SACKs received */
__u64 sas_osacks; /* SACKs sent */
@@ -1060,7 +1060,7 @@ typedef struct {
*/
struct sctp_paddrthlds {
sctp_assoc_t spt_assoc_id;
- struct sockaddr_storage spt_address;
+ struct __kernel_sockaddr_storage spt_address;
__u16 spt_pathmaxrxt;
__u16 spt_pathpfthld;
};
@@ -1119,7 +1119,7 @@ struct sctp_info {
__u64 sctpi_ictrlchunks;
/* primary transport info */
- struct sockaddr_storage sctpi_p_address;
+ struct __kernel_sockaddr_storage sctpi_p_address;
__s32 sctpi_p_state;
__u32 sctpi_p_cwnd;
__u32 sctpi_p_srtt;
@@ -1148,15 +1148,15 @@ struct sctp_info {
struct sctp_reset_streams {
sctp_assoc_t srs_assoc_id;
- uint16_t srs_flags;
- uint16_t srs_number_streams; /* 0 == ALL */
- uint16_t srs_stream_list[]; /* list if srs_num_streams is not 0 */
+ __u16 srs_flags;
+ __u16 srs_number_streams; /* 0 == ALL */
+ __u16 srs_stream_list[]; /* list if srs_num_streams is not 0 */
};
struct sctp_add_streams {
sctp_assoc_t sas_assoc_id;
- uint16_t sas_instrms;
- uint16_t sas_outstrms;
+ __u16 sas_instrms;
+ __u16 sas_outstrms;
};
struct sctp_event {