kernel: split patches folder up into backport, pending and hack folders
[openwrt/staging/wigyori.git] / target / linux / generic / pending-4.4 / 901-debloat_sock_diag.patch
1 --- a/net/Kconfig
2 +++ b/net/Kconfig
3 @@ -92,6 +92,9 @@ source "net/netlabel/Kconfig"
4
5 endif # if INET
6
7 +config SOCK_DIAG
8 + bool
9 +
10 config NETWORK_SECMARK
11 bool "Security Marking"
12 help
13 --- a/net/core/Makefile
14 +++ b/net/core/Makefile
15 @@ -9,8 +9,9 @@ obj-$(CONFIG_SYSCTL) += sysctl_net_core.
16
17 obj-y += dev.o ethtool.o dev_addr_lists.o dst.o netevent.o \
18 neighbour.o rtnetlink.o utils.o link_watch.o filter.o \
19 - sock_diag.o dev_ioctl.o tso.o
20 + dev_ioctl.o tso.o
21
22 +obj-$(CONFIG_SOCK_DIAG) += sock_diag.o
23 obj-$(CONFIG_XFRM) += flow.o
24 obj-y += net-sysfs.o
25 obj-$(CONFIG_PROC_FS) += net-procfs.o
26 --- a/net/core/sock.c
27 +++ b/net/core/sock.c
28 @@ -1474,9 +1474,11 @@ void sk_destruct(struct sock *sk)
29
30 static void __sk_free(struct sock *sk)
31 {
32 +#ifdef CONFIG_SOCK_DIAG
33 if (unlikely(sock_diag_has_destroy_listeners(sk) && sk->sk_net_refcnt))
34 sock_diag_broadcast_destroy(sk);
35 else
36 +#endif
37 sk_destruct(sk);
38 }
39
40 --- a/net/ipv4/Kconfig
41 +++ b/net/ipv4/Kconfig
42 @@ -414,6 +414,7 @@ config INET_LRO
43
44 config INET_DIAG
45 tristate "INET: socket monitoring interface"
46 + select SOCK_DIAG
47 default y
48 ---help---
49 Support for INET (TCP, DCCP, etc) socket monitoring interface used by
50 --- a/net/unix/Kconfig
51 +++ b/net/unix/Kconfig
52 @@ -22,6 +22,7 @@ config UNIX
53 config UNIX_DIAG
54 tristate "UNIX: socket monitoring interface"
55 depends on UNIX
56 + select SOCK_DIAG
57 default n
58 ---help---
59 Support for UNIX socket monitoring interface used by the ss tool.
60 --- a/net/netlink/Kconfig
61 +++ b/net/netlink/Kconfig
62 @@ -4,6 +4,7 @@
63
64 config NETLINK_DIAG
65 tristate "NETLINK: socket monitoring interface"
66 + select SOCK_DIAG
67 default n
68 ---help---
69 Support for NETLINK socket monitoring interface used by the ss tool.
70 --- a/net/packet/Kconfig
71 +++ b/net/packet/Kconfig
72 @@ -18,6 +18,7 @@ config PACKET
73 config PACKET_DIAG
74 tristate "Packet: sockets monitoring interface"
75 depends on PACKET
76 + select SOCK_DIAG
77 default n
78 ---help---
79 Support for PF_PACKET sockets monitoring interface used by the ss tool.