--- zzzz-none-000/linux-4.9.276/net/core/sock.c 2021-07-20 14:21:16.000000000 +0000 +++ falcon-5530-750/linux-4.9.276/net/core/sock.c 2023-04-05 08:19:02.000000000 +0000 @@ -141,6 +141,11 @@ #include #include +#if defined(CONFIG_UDP_REDIRECT) || defined(CONFIG_UDP_REDIRECT_MODULE) +#include +#include +#endif + static DEFINE_MUTEX(proto_list_mutex); static LIST_HEAD(proto_list); @@ -418,6 +423,15 @@ return -ENOBUFS; } + /* UNPREDIRECT */ +#if defined(CONFIG_UDP_REDIRECT) || defined(CONFIG_UDP_REDIRECT_MODULE) + if (udp_do_redirect_fn && sk->sk_user_data == UDP_REDIRECT_MAGIC) { + udp_do_redirect_fn(sk, skb); + kfree_skb(skb); + return 0; + } +#endif + skb->dev = NULL; skb_set_owner_r(skb, sk); @@ -1464,9 +1478,11 @@ static void __sk_free(struct sock *sk) { +#ifdef CONFIG_SOCK_DIAG if (unlikely(sk->sk_net_refcnt && sock_diag_has_destroy_listeners(sk))) sock_diag_broadcast_destroy(sk); else +#endif sk_destruct(sk); } @@ -1680,6 +1696,9 @@ #endif skb->destructor = sock_wfree; skb_set_hash_from_sk(skb, sk); +#ifdef CONFIG_AVM_SK_TC_INDEX + skb->tc_index = sk->sk_tc_index; +#endif /* * We used to take a refcount on sk, but following operation * is enough to guarantee sk_free() wont free this sock until @@ -2470,8 +2489,11 @@ sk->sk_type = sock->type; sk->sk_wq = sock->wq; sock->sk = sk; - } else + sk->sk_uid = SOCK_INODE(sock)->i_uid; + } else { sk->sk_wq = NULL; + sk->sk_uid = make_kuid(sock_net(sk)->user_ns, 0); + } rwlock_init(&sk->sk_callback_lock); lockdep_set_class_and_name(&sk->sk_callback_lock, @@ -2507,6 +2529,7 @@ sk->sk_max_pacing_rate = ~0U; sk->sk_pacing_rate = ~0U; + sk->sk_pacing_shift = 10; sk->sk_incoming_cpu = -1; /* * Before updating sk_refcnt, we must commit prior changes to memory @@ -3113,6 +3136,8 @@ static int __init proto_init(void) { + if (IS_ENABLED(CONFIG_PROC_STRIPPED)) + return 0; return register_pernet_subsys(&proto_net_ops); }