From: planck kernel size experiment Subject: net: keep TCP/UDP while disabling SO_REUSEPORT and BPF lookup The logger needs one TCP listener and one UDP socket, but never creates a reuseport group and cannot install a BPF socket-lookup program. TCP/UDP still contain conditional calls for those facilities because normal NET forces BPF and builds sock_reuseport.c. Supply the permanently-disabled results: ordinary hash lookup continues when selection returns NULL, while attempts to create a reuseport group fail explicitly. --- a/net/core/planck_minimal.c +++ b/net/core/planck_minimal.c @@ -7,6 +7,7 @@ DEFINE_STATIC_KEY_FALSE(bpf_stats_enabled_key); DEFINE_STATIC_KEY_FALSE(bpf_master_redirect_enabled_key); +DEFINE_STATIC_KEY_FALSE(bpf_sk_lookup_enabled); int sk_filter_trim_cap(struct sock *sk, struct sk_buff *skb, unsigned int cap, enum skb_drop_reason *reason) @@ -17,6 +18,47 @@ void reuseport_has_conns_set(struct sock *sk) { } + +int reuseport_alloc(struct sock *sk, bool bind_inany) +{ + return -EOPNOTSUPP; +} + +int reuseport_add_sock(struct sock *sk, struct sock *sk2, bool bind_inany) +{ + return -EOPNOTSUPP; +} + +void reuseport_detach_sock(struct sock *sk) +{ +} + +void reuseport_stop_listen_sock(struct sock *sk) +{ +} + +struct sock *reuseport_select_sock(struct sock *sk, u32 hash, + struct sk_buff *skb, int hdr_len) +{ + return NULL; +} + +struct sock *reuseport_migrate_sock(struct sock *sk, + struct sock *migrating_sk, + struct sk_buff *skb) +{ + return NULL; +} + +int reuseport_attach_prog(struct sock *sk, struct bpf_prog *prog) +{ + return -EOPNOTSUPP; +} + +int reuseport_detach_prog(struct sock *sk) +{ + return -EOPNOTSUPP; +} u32 xdp_master_redirect(struct xdp_buff *xdp) {