From: planck kernel size experiment Subject: ipv4: remove tunnel metadata and GRE registration The appliance has one ordinary virtio Ethernet interface and creates no tunnel device. It neither receives GRE nor attaches metadata destinations to ARP requests. Unconditionally initializing IP-tunnel metadata and registering GRE offload handlers therefore cannot contribute to TCP or UDP log delivery. Keep ordinary ARP replies with a NULL reply destination, omit the tunnel core and GRE objects, and remove their IPv4 initialization call. The chained proof still requires ARP-backed TCP/UDP ingress and ICMP egress through virtio-net. --- a/net/ipv4/Makefile +++ b/net/ipv4/Makefile @@ -15,5 +15,5 @@ obj-y := route.o inetpeer.o protocol.o \ udp_offload.o arp.o icmp.o devinet.o af_inet.o igmp.o \ fib_frontend.o fib_semantics.o fib_trie.o fib_notifier.o \ - inet_fragment.o ping.o ip_tunnel_core.o gre_offload.o \ + inet_fragment.o ping.o \ metrics.o netlink.o nexthop.o udp_tunnel_stub.o --- a/net/ipv4/af_inet.c +++ b/net/ipv4/af_inet.c @@ -2002,9 +2002,7 @@ static int __init inet_init(void) ipfrag_init(); dev_add_pack(&ip_packet_type); - ip_tunnel_core_init(); - rc = 0; out: return rc; --- a/net/ipv4/arp.c +++ b/net/ipv4/arp.c @@ -110,7 +110,6 @@ #include #include #include -#include #include @@ -823,9 +822,4 @@ static int arp_process(struct net *net, struct sock *sk, struct sk_buff *skb) * cache. */ - if (arp->ar_op == htons(ARPOP_REQUEST) && skb_metadata_dst(skb)) - reply_dst = (struct dst_entry *) - iptunnel_metadata_reply(skb_metadata_dst(skb), - GFP_ATOMIC); - /* Special case: IPv4 duplicate address detection packet (RFC2131) */ --- a/net/ipv4/udp.c +++ b/net/ipv4/udp.c @@ -102,7 +102,6 @@ #include #include #include -#include #include #include #include @@ -833,18 +832,4 @@ static int __udp4_lib_err_encap_no_sk(struct sk_buff *skb, u32 info) { - int i; - - for (i = 0; i < MAX_IPTUN_ENCAP_OPS; i++) { - int (*handler)(struct sk_buff *skb, u32 info); - const struct ip_tunnel_encap_ops *encap; - - encap = rcu_dereference(iptun_encaps[i]); - if (!encap) - continue; - handler = encap->err_handler; - if (handler && !handler(skb, info)) - return 0; - } - return -ENOENT; }