From: planck kernel size experiment Subject: tcp: remove upper-layer-protocol attachment The logger uses ordinary TCP sockets and never transforms them into kTLS, MPTCP or another registered TCP ULP. No ULP implementation is built in this kernel, yet the name registry, TCP_ULP option parser and close-time callback dispatch remain linked. Remove that unreachable extension surface; TCP_ULP now falls through to the normal unsupported-option result. Measured effect on RV32: Image shrank by 8 bytes (1,216,704 to 1,216,696 bytes), with the TCP/UDP/Minix acceptance proof still passing. --- a/net/ipv4/Makefile +++ b/net/ipv4/Makefile @@ -10,3 +10,3 @@ obj-y := route.o inetpeer.o protocol.o \ tcp.o tcp_input.o tcp_output.o tcp_timer.o tcp_ipv4.o \ tcp_minisocks.o tcp_cong.o tcp_fastopen.o \ - tcp_rate.o tcp_recovery.o tcp_ulp.o \ + tcp_rate.o tcp_recovery.o \ --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -3853,21 +3853,3 @@ int do_tcp_setsockopt(struct sock *sk, int level, int optname, return err; } - case TCP_ULP: { - char name[TCP_ULP_NAME_MAX]; - - if (optlen < 1) - return -EINVAL; - - val = strncpy_from_sockptr(name, optval, - min_t(long, TCP_ULP_NAME_MAX - 1, - optlen)); - if (val < 0) - return -EFAULT; - name[val] = 0; - - sockopt_lock_sock(sk); - err = tcp_set_ulp(sk, name); - sockopt_release_sock(sk); - return err; - } case TCP_FASTOPEN_KEY: { --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -2515,5 +2515,3 @@ void tcp_v4_destroy_sock(struct sock *sk) tcp_cleanup_congestion_control(sk); - tcp_cleanup_ulp(sk); - /* Cleanup up the write buffer. */