1 From 3b6115d6b57a263bdc8c9b1df273bd4a7955eead Mon Sep 17 00:00:00 2001
2 From: Felix Fietkau <nbd@nbd.name>
3 Date: Sat, 8 Jul 2017 08:16:31 +0200
4 Subject: debloat: add some debloat patches, strip down procfs and make O_DIRECT support optional, saves ~15K after lzma on MIPS
6 Signed-off-by: Felix Fietkau <nbd@nbd.name>
9 net/core/Makefile | 3 ++-
10 net/core/sock.c | 2 ++
11 net/ipv4/Kconfig | 1 +
12 net/netlink/Kconfig | 1 +
13 net/packet/Kconfig | 1 +
14 net/unix/Kconfig | 1 +
15 7 files changed, 11 insertions(+), 1 deletion(-)
19 @@ -95,6 +95,9 @@ source "net/netlabel/Kconfig"
26 config NETWORK_SECMARK
27 bool "Security Marking"
29 --- a/net/core/Makefile
30 +++ b/net/core/Makefile
31 @@ -9,8 +9,9 @@ obj-$(CONFIG_SYSCTL) += sysctl_net_core.
33 obj-y += dev.o ethtool.o dev_addr_lists.o dst.o netevent.o \
34 neighbour.o rtnetlink.o utils.o link_watch.o filter.o \
35 - sock_diag.o dev_ioctl.o tso.o sock_reuseport.o
36 + dev_ioctl.o tso.o sock_reuseport.o
38 +obj-$(CONFIG_SOCK_DIAG) += sock_diag.o
39 obj-$(CONFIG_XFRM) += flow.o
41 obj-$(CONFIG_PROC_FS) += net-procfs.o
44 @@ -1458,9 +1458,11 @@ void sk_destruct(struct sock *sk)
46 static void __sk_free(struct sock *sk)
48 +#ifdef CONFIG_SOCK_DIAG
49 if (unlikely(sk->sk_net_refcnt && sock_diag_has_destroy_listeners(sk)))
50 sock_diag_broadcast_destroy(sk);
56 --- a/net/ipv4/Kconfig
57 +++ b/net/ipv4/Kconfig
58 @@ -408,6 +408,7 @@ config INET_XFRM_MODE_BEET
61 tristate "INET: socket monitoring interface"
65 Support for INET (TCP, DCCP, etc) socket monitoring interface used by
66 --- a/net/netlink/Kconfig
67 +++ b/net/netlink/Kconfig
71 tristate "NETLINK: socket monitoring interface"
75 Support for NETLINK socket monitoring interface used by the ss tool.
76 --- a/net/packet/Kconfig
77 +++ b/net/packet/Kconfig
78 @@ -18,6 +18,7 @@ config PACKET
80 tristate "Packet: sockets monitoring interface"
85 Support for PF_PACKET sockets monitoring interface used by the ss tool.
86 --- a/net/unix/Kconfig
87 +++ b/net/unix/Kconfig
88 @@ -22,6 +22,7 @@ config UNIX
90 tristate "UNIX: socket monitoring interface"
95 Support for UNIX socket monitoring interface used by the ss tool.