ip_fragment.c (787bea7748a76130566f881c2342a0be4127d182) ip_fragment.c (093ba72914b696521e4885756a68a3332782c8de)
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * INET An implementation of the TCP/IP protocol suite for the LINUX
4 * operating system. INET is implemented using the BSD Socket
5 * interface as the means of communication with the user level.
6 *
7 * The IP fragmentation functionality.
8 *

--- 154 unchanged lines hidden (view full) ---

163 inet_putpeer(qp->peer);
164}
165
166
167/* Destruction primitives. */
168
169static void ipq_put(struct ipq *ipq)
170{
1// SPDX-License-Identifier: GPL-2.0
2/*
3 * INET An implementation of the TCP/IP protocol suite for the LINUX
4 * operating system. INET is implemented using the BSD Socket
5 * interface as the means of communication with the user level.
6 *
7 * The IP fragmentation functionality.
8 *

--- 154 unchanged lines hidden (view full) ---

163 inet_putpeer(qp->peer);
164}
165
166
167/* Destruction primitives. */
168
169static void ipq_put(struct ipq *ipq)
170{
171 inet_frag_put(&ipq->q, &ip4_frags);
171 inet_frag_put(&ipq->q);
172}
173
174/* Kill ipq entry. It is not destroyed immediately,
175 * because caller (and someone more) holds reference count.
176 */
177static void ipq_kill(struct ipq *ipq)
178{
172}
173
174/* Kill ipq entry. It is not destroyed immediately,
175 * because caller (and someone more) holds reference count.
176 */
177static void ipq_kill(struct ipq *ipq)
178{
179 inet_frag_kill(&ipq->q, &ip4_frags);
179 inet_frag_kill(&ipq->q);
180}
181
182static bool frag_expire_skip_icmp(u32 user)
183{
184 return user == IP_DEFRAG_AF_PACKET ||
185 ip_defrag_user_in_between(user, IP_DEFRAG_CONNTRACK_IN,
186 __IP_DEFRAG_CONNTRACK_IN_END) ||
187 ip_defrag_user_in_between(user, IP_DEFRAG_CONNTRACK_BRIDGE_IN,

--- 679 unchanged lines hidden (view full) ---

867 /*
868 * Important NOTE! Fragment queue must be destroyed before MSL expires.
869 * RFC791 is wrong proposing to prolongate timer each fragment arrival
870 * by TTL.
871 */
872 net->ipv4.frags.timeout = IP_FRAG_TIME;
873
874 net->ipv4.frags.max_dist = 64;
180}
181
182static bool frag_expire_skip_icmp(u32 user)
183{
184 return user == IP_DEFRAG_AF_PACKET ||
185 ip_defrag_user_in_between(user, IP_DEFRAG_CONNTRACK_IN,
186 __IP_DEFRAG_CONNTRACK_IN_END) ||
187 ip_defrag_user_in_between(user, IP_DEFRAG_CONNTRACK_BRIDGE_IN,

--- 679 unchanged lines hidden (view full) ---

867 /*
868 * Important NOTE! Fragment queue must be destroyed before MSL expires.
869 * RFC791 is wrong proposing to prolongate timer each fragment arrival
870 * by TTL.
871 */
872 net->ipv4.frags.timeout = IP_FRAG_TIME;
873
874 net->ipv4.frags.max_dist = 64;
875 net->ipv4.frags.f = &ip4_frags;
875
876 res = inet_frags_init_net(&net->ipv4.frags);
877 if (res < 0)
878 return res;
879 res = ip4_frags_ns_ctl_register(net);
880 if (res < 0)
876
877 res = inet_frags_init_net(&net->ipv4.frags);
878 if (res < 0)
879 return res;
880 res = ip4_frags_ns_ctl_register(net);
881 if (res < 0)
881 inet_frags_exit_net(&net->ipv4.frags, &ip4_frags);
882 inet_frags_exit_net(&net->ipv4.frags);
882 return res;
883}
884
885static void __net_exit ipv4_frags_exit_net(struct net *net)
886{
887 ip4_frags_ns_ctl_unregister(net);
883 return res;
884}
885
886static void __net_exit ipv4_frags_exit_net(struct net *net)
887{
888 ip4_frags_ns_ctl_unregister(net);
888 inet_frags_exit_net(&net->ipv4.frags, &ip4_frags);
889 inet_frags_exit_net(&net->ipv4.frags);
889}
890
891static struct pernet_operations ip4_frags_ops = {
892 .init = ipv4_frags_init_net,
893 .exit = ipv4_frags_exit_net,
894};
895
896void __init ipfrag_init(void)

--- 13 unchanged lines hidden ---
890}
891
892static struct pernet_operations ip4_frags_ops = {
893 .init = ipv4_frags_init_net,
894 .exit = ipv4_frags_exit_net,
895};
896
897void __init ipfrag_init(void)

--- 13 unchanged lines hidden ---