Я думаю, что нет проблем. Это может быть часть синхронизации сети. Проблемы с падением, с которыми я столкнулся, были вызваны DNF.i очень подозреваем, что это вызвано параллелизмом. Есть ли большой парень, который может мне помочь? Большое спасибо.
Код: Выделить всё
static void __exit
toa_exit(void)
{
unhook_toa_functions();
#ifdef TOA_NAT64_ENABLE
nf_unregister_sockopt(&toa_sockopts);
#endif
nf_unregister_sockopt(&toa_vip_sockopts);
synchronize_net();
if (0 != exit_toa_ip4()) {
TOA_INFO("exit toa ip4 fail.\n");
}
#if (defined(TOA_IPV6_ENABLE) || defined(TOA_NAT64_ENABLE))
if (0 != exit_toa_ip6()) {
TOA_INFO("exit toa ip6 fail.\n");
}
#endif
#if LINUX_VERSION_CODE >= KERNEL_VERSION(5,7,0)
unregister_kprobe(&kp);
#endif
proc_net_remove(&init_net, "toa_stats");
if (NULL != ext_stats) {
free_percpu(ext_stats);
ext_stats = NULL;
}
TOA_INFO("toa unloaded\n");
}
static int
exit_toa_ip4(void)
{
int i;
struct list_head *head;
struct data_entry *entry;
struct sock *sk;
lock_all_toa_ip4_sk();
for (i = 0; i < TOA_IP4_TAB_SIZE; ++i) {
spin_lock_bh(&__toa_ip4_list_tab[i].lock);
head = &__toa_ip4_list_tab[i].toa_ip4_head;
while (!list_empty(head)) {
entry = list_first_entry(head, struct data_entry, list);
sk = entry->sk;
if (sk && sk->sk_user_data &&
(sk->sk_destruct == tcp_v4_sk_destruct_toa)) {
sk->sk_destruct = inet_sock_destruct;
sk->sk_user_data = NULL;
}
list_del(&entry->list);
kfree(entry);
}
spin_unlock_bh(&__toa_ip4_list_tab[i].lock);
}
unlock_all_toa_ip4_sk();
synchronize_net();
free_percpu(toa_ip4_sk_lock.lock);
return 0;
}
static void
tcp_v4_sk_destruct_toa(struct sock *sk) {
lock_cpu_toa_ip4_sk();
if (sk->sk_user_data) {
struct data_entry *entry = sk->sk_user_data;
toa_ip4_unhash(entry);
sk->sk_destruct = inet_sock_destruct;
sk->sk_user_data = NULL;
kfree(entry);
}
inet_sock_destruct(sk);
unlock_cpu_toa_ip4_sk();
}
Подробнее здесь: https://stackoverflow.com/questions/797 ... cp-options