Skip to content

Commit e6fe237

Browse files
xemuldavem330
authored andcommitted
sock_diag: Arrange sock_diag.h such that it is exportable to userspace
Properly toss existing components around the ifdef __KERNEL__ and include the header into the header-y target. Signed-off-by: Pavel Emelyanov <xemul@parallels.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 56be178 commit e6fe237

File tree

2 files changed

+8
-3
lines changed

2 files changed

+8
-3
lines changed

include/linux/Kbuild

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -195,6 +195,7 @@ header-y += igmp.h
195195
header-y += in.h
196196
header-y += in6.h
197197
header-y += in_route.h
198+
header-y += sock_diag.h
198199
header-y += inet_diag.h
199200
header-y += inotify.h
200201
header-y += input.h

include/linux/sock_diag.h

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,16 +1,19 @@
11
#ifndef __SOCK_DIAG_H__
22
#define __SOCK_DIAG_H__
33

4-
#define SOCK_DIAG_BY_FAMILY 20
4+
#include <linux/types.h>
55

6-
struct sk_buff;
7-
struct nlmsghdr;
6+
#define SOCK_DIAG_BY_FAMILY 20
87

98
struct sock_diag_req {
109
__u8 sdiag_family;
1110
__u8 sdiag_protocol;
1211
};
1312

13+
#ifdef __KERNEL__
14+
struct sk_buff;
15+
struct nlmsghdr;
16+
1417
struct sock_diag_handler {
1518
__u8 family;
1619
int (*dump)(struct sk_buff *skb, struct nlmsghdr *nlh);
@@ -26,4 +29,5 @@ int sock_diag_check_cookie(void *sk, __u32 *cookie);
2629
void sock_diag_save_cookie(void *sk, __u32 *cookie);
2730

2831
extern struct sock *sock_diag_nlsk;
32+
#endif /* KERNEL */
2933
#endif

0 commit comments

Comments
 (0)