Skip to content

Commit bcb949b

Browse files
bwhacksdavem330
authored andcommitted
headers, net: Use __kernel_sa_family_t in more definitions shared with userland
Complete the work started with commit 6602a4b ('net: Make userland include of netlink.h more sane'). Signed-off-by: Ben Hutchings <ben@decadent.org.uk> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent d4b172d commit bcb949b

15 files changed

Lines changed: 37 additions & 33 deletions

File tree

‎include/linux/atalk.h‎

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33

44
#include <linux/types.h>
55
#include <asm/byteorder.h>
6+
#include <linux/socket.h>
67

78
/*
89
* AppleTalk networking structures
@@ -28,7 +29,7 @@ struct atalk_addr {
2829
};
2930

3031
struct sockaddr_at {
31-
sa_family_t sat_family;
32+
__kernel_sa_family_t sat_family;
3233
__u8 sat_port;
3334
struct atalk_addr sat_addr;
3435
char sat_zero[8];

‎include/linux/ax25.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -47,7 +47,7 @@ typedef struct {
4747
} ax25_address;
4848

4949
struct sockaddr_ax25 {
50-
sa_family_t sax25_family;
50+
__kernel_sa_family_t sax25_family;
5151
ax25_address sax25_call;
5252
int sax25_ndigis;
5353
/* Digipeater ax25_address sets follow */

‎include/linux/caif/caif_socket.h‎

Lines changed: 1 addition & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -9,12 +9,7 @@
99
#define _LINUX_CAIF_SOCKET_H
1010

1111
#include <linux/types.h>
12-
13-
#ifdef __KERNEL__
1412
#include <linux/socket.h>
15-
#else
16-
#include <sys/socket.h>
17-
#endif
1813

1914
/**
2015
* enum caif_link_selector - Physical Link Selection.
@@ -144,7 +139,7 @@ enum caif_debug_service {
144139
* CAIF Channel. It defines the service to connect to on the modem.
145140
*/
146141
struct sockaddr_caif {
147-
sa_family_t family;
142+
__kernel_sa_family_t family;
148143
union {
149144
struct {
150145
__u8 type; /* type: enum caif_at_type */

‎include/linux/can.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -78,7 +78,7 @@ struct can_frame {
7878
* @can_addr: protocol specific address information
7979
*/
8080
struct sockaddr_can {
81-
sa_family_t can_family;
81+
__kernel_sa_family_t can_family;
8282
int can_ifindex;
8383
union {
8484
/* transport protocol class address information (e.g. ISOTP) */

‎include/linux/if_pppox.h‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -20,6 +20,7 @@
2020
#include <linux/types.h>
2121
#include <asm/byteorder.h>
2222

23+
#include <linux/socket.h>
2324
#include <linux/if_ether.h>
2425
#ifdef __KERNEL__
2526
#include <linux/if.h>
@@ -63,7 +64,7 @@ struct pptp_addr {
6364
#define PX_MAX_PROTO 3
6465

6566
struct sockaddr_pppox {
66-
sa_family_t sa_family; /* address family, AF_PPPOX */
67+
__kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
6768
unsigned int sa_protocol; /* protocol identifier */
6869
union {
6970
struct pppoe_addr pppoe;
@@ -77,7 +78,7 @@ struct sockaddr_pppox {
7778
* type instead.
7879
*/
7980
struct sockaddr_pppol2tp {
80-
sa_family_t sa_family; /* address family, AF_PPPOX */
81+
__kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
8182
unsigned int sa_protocol; /* protocol identifier */
8283
struct pppol2tp_addr pppol2tp;
8384
} __attribute__((packed));
@@ -86,7 +87,7 @@ struct sockaddr_pppol2tp {
8687
* bits. So we need a different sockaddr structure.
8788
*/
8889
struct sockaddr_pppol2tpv3 {
89-
sa_family_t sa_family; /* address family, AF_PPPOX */
90+
__kernel_sa_family_t sa_family; /* address family, AF_PPPOX */
9091
unsigned int sa_protocol; /* protocol identifier */
9192
struct pppol2tpv3_addr pppol2tp;
9293
} __attribute__((packed));

‎include/linux/in.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -182,7 +182,7 @@ struct in_pktinfo {
182182
/* Structure describing an Internet (IP) socket address. */
183183
#define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */
184184
struct sockaddr_in {
185-
sa_family_t sin_family; /* Address family */
185+
__kernel_sa_family_t sin_family; /* Address family */
186186
__be16 sin_port; /* Port number */
187187
struct in_addr sin_addr; /* Internet address */
188188

‎include/linux/ipx.h‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
#define IPX_MTU 576
88

99
struct sockaddr_ipx {
10-
sa_family_t sipx_family;
10+
__kernel_sa_family_t sipx_family;
1111
__be16 sipx_port;
1212
__be32 sipx_network;
1313
unsigned char sipx_node[IPX_NODE_LEN];

‎include/linux/irda.h‎

Lines changed: 3 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -26,12 +26,9 @@
2626
#define KERNEL_IRDA_H
2727

2828
#include <linux/types.h>
29+
#include <linux/socket.h>
2930

30-
/* Please do *not* add any #include in this file, this file is
31-
* included as-is in user space.
32-
* Please fix the calling file to properly included needed files before
33-
* this one, or preferably to include <net/irda/irda.h> instead.
34-
* Jean II */
31+
/* Note that this file is shared with user space. */
3532

3633
/* Hint bit positions for first hint byte */
3734
#define HINT_PNP 0x01
@@ -125,7 +122,7 @@ enum {
125122
#define LSAP_ANY 0xff
126123

127124
struct sockaddr_irda {
128-
sa_family_t sir_family; /* AF_IRDA */
125+
__kernel_sa_family_t sir_family; /* AF_IRDA */
129126
__u8 sir_lsap_sel; /* LSAP selector */
130127
__u32 sir_addr; /* Device address */
131128
char sir_name[25]; /* Usually <service>:IrDA:TinyTP */

‎include/linux/l2tp.h‎

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,8 +8,8 @@
88
#define _LINUX_L2TP_H_
99

1010
#include <linux/types.h>
11-
#ifdef __KERNEL__
1211
#include <linux/socket.h>
12+
#ifdef __KERNEL__
1313
#include <linux/in.h>
1414
#else
1515
#include <netinet/in.h>
@@ -26,14 +26,15 @@
2626
#define __SOCK_SIZE__ 16 /* sizeof(struct sockaddr) */
2727
struct sockaddr_l2tpip {
2828
/* The first fields must match struct sockaddr_in */
29-
sa_family_t l2tp_family; /* AF_INET */
29+
__kernel_sa_family_t l2tp_family; /* AF_INET */
3030
__be16 l2tp_unused; /* INET port number (unused) */
3131
struct in_addr l2tp_addr; /* Internet address */
3232

3333
__u32 l2tp_conn_id; /* Connection ID of tunnel */
3434

3535
/* Pad to size of `struct sockaddr'. */
36-
unsigned char __pad[sizeof(struct sockaddr) - sizeof(sa_family_t) -
36+
unsigned char __pad[sizeof(struct sockaddr) -
37+
sizeof(__kernel_sa_family_t) -
3738
sizeof(__be16) - sizeof(struct in_addr) -
3839
sizeof(__u32)];
3940
};

‎include/linux/llc.h‎

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -12,16 +12,20 @@
1212
*
1313
* See the GNU General Public License for more details.
1414
*/
15+
16+
#include <linux/socket.h>
17+
1518
#define __LLC_SOCK_SIZE__ 16 /* sizeof(sockaddr_llc), word align. */
1619
struct sockaddr_llc {
17-
sa_family_t sllc_family; /* AF_LLC */
18-
sa_family_t sllc_arphrd; /* ARPHRD_ETHER */
20+
__kernel_sa_family_t sllc_family; /* AF_LLC */
21+
__kernel_sa_family_t sllc_arphrd; /* ARPHRD_ETHER */
1922
unsigned char sllc_test;
2023
unsigned char sllc_xid;
2124
unsigned char sllc_ua; /* UA data, only for SOCK_STREAM. */
2225
unsigned char sllc_sap;
2326
unsigned char sllc_mac[IFHWADDRLEN];
24-
unsigned char __pad[__LLC_SOCK_SIZE__ - sizeof(sa_family_t) * 2 -
27+
unsigned char __pad[__LLC_SOCK_SIZE__ -
28+
sizeof(__kernel_sa_family_t) * 2 -
2529
sizeof(unsigned char) * 4 - IFHWADDRLEN];
2630
};
2731

0 commit comments

Comments
 (0)