]> git.proxmox.com Git - mirror_ubuntu-eoan-kernel.git/blame - include/net/netns/ipv4.h
net: Replace ip_ra_lock with per-net mutex
[mirror_ubuntu-eoan-kernel.git] / include / net / netns / ipv4.h
CommitLineData
b2441318 1/* SPDX-License-Identifier: GPL-2.0 */
8afd351c
PE
2/*
3 * ipv4 in net namespaces
4 */
5
6#ifndef __NETNS_IPV4_H__
7#define __NETNS_IPV4_H__
e4e4971c 8
7064d16e 9#include <linux/uidgid.h>
ac18e750 10#include <net/inet_frag.h>
a7e53531 11#include <linux/rcupdate.h>
ac18e750 12
51c5d0c4 13struct tcpm_hash_bucket;
752d14dc
PE
14struct ctl_table_header;
15struct ipv4_devconf;
e4e4971c 16struct fib_rules_ops;
e4aef8ae 17struct hlist_head;
f4530fa5 18struct fib_table;
6bd48fcf 19struct sock;
0bbf87d8
EB
20struct local_ports {
21 seqlock_t lock;
22 int range[2];
ed2dfd90 23 bool warned;
0bbf87d8 24};
752d14dc 25
ba6b918a
CW
26struct ping_group_range {
27 seqlock_t lock;
28 kgid_t range[2];
29};
30
1946e672
HY
31struct inet_hashinfo;
32
33struct inet_timewait_death_row {
34 atomic_t tw_count;
35
36 struct inet_hashinfo *hashinfo ____cacheline_aligned_in_smp;
1946e672
HY
37 int sysctl_max_tw_buckets;
38};
39
43713848
HY
40struct tcp_fastopen_context;
41
8afd351c 42struct netns_ipv4 {
2a75de0c 43#ifdef CONFIG_SYSCTL
752d14dc 44 struct ctl_table_header *forw_hdr;
e4a2d5c2 45 struct ctl_table_header *frags_hdr;
68528f09 46 struct ctl_table_header *ipv4_hdr;
39a23e75 47 struct ctl_table_header *route_hdr;
8d068875 48 struct ctl_table_header *xfrm4_hdr;
2a75de0c 49#endif
752d14dc
PE
50 struct ipv4_devconf *devconf_all;
51 struct ipv4_devconf *devconf_dflt;
5796ef75 52 struct ip_ra_chain __rcu *ra_chain;
d9ff3049 53 struct mutex ra_mutex;
e4e4971c
DL
54#ifdef CONFIG_IP_MULTIPLE_TABLES
55 struct fib_rules_ops *rules_ops;
f4530fa5 56 bool fib_has_custom_rules;
e37b1e97 57 unsigned int fib_rules_require_fldissect;
a7e53531
AD
58 struct fib_table __rcu *fib_main;
59 struct fib_table __rcu *fib_default;
f4530fa5 60#endif
a1f3316d 61 bool fib_has_custom_local_routes;
f4530fa5
DM
62#ifdef CONFIG_IP_ROUTE_CLASSID
63 int fib_num_tclassid_users;
e4e4971c 64#endif
e4aef8ae 65 struct hlist_head *fib_table_hash;
448b128a 66 bool fib_offload_disabled;
6bd48fcf 67 struct sock *fibnl;
ac18e750 68
349c9e3c 69 struct sock * __percpu *icmp_sk;
93a714d6 70 struct sock *mc_autojoin_sk;
349c9e3c 71
c8a627ed 72 struct inet_peer_base *peers;
bdbbb852 73 struct sock * __percpu *tcp_sk;
ac18e750 74 struct netns_frags frags;
9335f047
AD
75#ifdef CONFIG_NETFILTER
76 struct xt_table *iptable_filter;
77 struct xt_table *iptable_mangle;
78 struct xt_table *iptable_raw;
9ea0cb26 79 struct xt_table *arptable_filter;
e9d3897c 80#ifdef CONFIG_SECURITY
560ee653 81 struct xt_table *iptable_security;
e9d3897c 82#endif
e099a173 83 struct xt_table *nat_table;
9335f047 84#endif
a24022e1
PE
85
86 int sysctl_icmp_echo_ignore_all;
87 int sysctl_icmp_echo_ignore_broadcasts;
88 int sysctl_icmp_ignore_bogus_error_responses;
89 int sysctl_icmp_ratelimit;
90 int sysctl_icmp_ratemask;
91 int sysctl_icmp_errors_use_inbound_ifaddr;
9f5e97e5 92
c9d8f1a6 93 struct local_ports ip_local_ports;
0bbf87d8 94
5d134f1c 95 int sysctl_tcp_ecn;
49213555
DB
96 int sysctl_tcp_ecn_fallback;
97
fa50d974 98 int sysctl_ip_default_ttl;
974eda11 99 int sysctl_ip_no_pmtu_disc;
f87c10a8 100 int sysctl_ip_fwd_use_pmtu;
49a60158 101 int sysctl_ip_nonlocal_bind;
287b7f38
NB
102 /* Shall we try to damage output packets if routing dev changes? */
103 int sysctl_ip_dynaddr;
e21145a9 104 int sysctl_ip_early_demux;
dddb64bc
SAK
105 int sysctl_tcp_early_demux;
106 int sysctl_udp_early_demux;
5d134f1c 107
e110861f 108 int sysctl_fwmark_reflect;
84f39b08 109 int sysctl_tcp_fwmark_accept;
6dd9a14e
DA
110#ifdef CONFIG_NET_L3_MASTER_DEV
111 int sysctl_tcp_l3mdev_accept;
112#endif
b0f9ca53
FD
113 int sysctl_tcp_mtu_probing;
114 int sysctl_tcp_base_mss;
6b58e0a5 115 int sysctl_tcp_probe_threshold;
05cbc0db 116 u32 sysctl_tcp_probe_interval;
e110861f 117
13b287e8 118 int sysctl_tcp_keepalive_time;
9bd6861b 119 int sysctl_tcp_keepalive_probes;
b840d15d 120 int sysctl_tcp_keepalive_intvl;
13b287e8 121
6fa25166 122 int sysctl_tcp_syn_retries;
7c083ecb 123 int sysctl_tcp_synack_retries;
12ed8244 124 int sysctl_tcp_syncookies;
1043e25f 125 int sysctl_tcp_reordering;
ae5c3f40 126 int sysctl_tcp_retries1;
c6214a97 127 int sysctl_tcp_retries2;
c402d9be 128 int sysctl_tcp_orphan_retries;
1e579caa 129 int sysctl_tcp_fin_timeout;
4979f2d9 130 unsigned int sysctl_tcp_notsent_lowat;
56ab6b93 131 int sysctl_tcp_tw_reuse;
f9301034 132 int sysctl_tcp_sack;
9bb37ef0 133 int sysctl_tcp_window_scaling;
5d2ed052 134 int sysctl_tcp_timestamps;
2ae21cf5 135 int sysctl_tcp_early_retrans;
e20223f1 136 int sysctl_tcp_recovery;
2c04ac8a 137 int sysctl_tcp_thin_linear_timeouts;
b510f0d2 138 int sysctl_tcp_slow_start_after_idle;
e0a1e5b5 139 int sysctl_tcp_retrans_collapse;
3f4c7c6f 140 int sysctl_tcp_stdurg;
625357aa 141 int sysctl_tcp_rfc1337;
65c9410c 142 int sysctl_tcp_abort_on_overflow;
0bc65a28 143 int sysctl_tcp_fack;
c6e21803 144 int sysctl_tcp_max_reordering;
6496f6bd 145 int sysctl_tcp_dsack;
0c12654a 146 int sysctl_tcp_app_win;
94f0893e 147 int sysctl_tcp_adv_win_scale;
af9b69a7 148 int sysctl_tcp_frto;
ec36e416 149 int sysctl_tcp_nometrics_save;
4540c0cf 150 int sysctl_tcp_moderate_rcvbuf;
d06a9904 151 int sysctl_tcp_tso_win_divisor;
ceef9ab6 152 int sysctl_tcp_workaround_signed_windows;
9184d8bb 153 int sysctl_tcp_limit_output_bytes;
b530b681 154 int sysctl_tcp_challenge_ack_limit;
26e9596e 155 int sysctl_tcp_min_tso_segs;
bd239704 156 int sysctl_tcp_min_rtt_wlen;
790f00e1 157 int sysctl_tcp_autocorking;
4170ba6b 158 int sysctl_tcp_invalid_ratelimit;
23a7102a 159 int sysctl_tcp_pacing_ss_ratio;
c26e91f8 160 int sysctl_tcp_pacing_ca_ratio;
356d1833
ED
161 int sysctl_tcp_wmem[3];
162 int sysctl_tcp_rmem[3];
1946e672 163 struct inet_timewait_death_row tcp_death_row;
fee83d09 164 int sysctl_max_syn_backlog;
e1cfcbe8 165 int sysctl_tcp_fastopen;
6670e152 166 const struct tcp_congestion_ops __rcu *tcp_congestion_control;
43713848
HY
167 struct tcp_fastopen_context __rcu *tcp_fastopen_ctx;
168 spinlock_t tcp_fastopen_ctx_lock;
3733be14
HY
169 unsigned int sysctl_tcp_fastopen_blackhole_timeout;
170 atomic_t tfo_active_disable_times;
171 unsigned long tfo_active_disable_stamp;
12ed8244 172
1e802951
TZ
173 int sysctl_udp_wmem_min;
174 int sysctl_udp_rmem_min;
175
63a6fff3
RS
176#ifdef CONFIG_NET_L3_MASTER_DEV
177 int sysctl_udp_l3mdev_accept;
178#endif
179
815c5270 180 int sysctl_igmp_max_memberships;
166b6b2d 181 int sysctl_igmp_max_msf;
87a8a2ae 182 int sysctl_igmp_llm_reports;
165094af 183 int sysctl_igmp_qrv;
815c5270 184
ba6b918a 185 struct ping_group_range ping_group_range;
c319b4d7 186
436c3b66 187 atomic_t dev_addr_genid;
70a269e6 188
122ff243
WC
189#ifdef CONFIG_SYSCTL
190 unsigned long *sysctl_local_reserved_ports;
4548b683 191 int sysctl_ip_prot_sock;
122ff243
WC
192#endif
193
70a269e6 194#ifdef CONFIG_IP_MROUTE
f0ad0860 195#ifndef CONFIG_IP_MROUTE_MULTIPLE_TABLES
0c12295a 196 struct mr_table *mrt;
f0ad0860
PM
197#else
198 struct list_head mr_tables;
199 struct fib_rules_ops *mr_rules_ops;
200#endif
a6db4494
DA
201#endif
202#ifdef CONFIG_IP_ROUTE_MULTIPATH
203 int sysctl_fib_multipath_use_neigh;
bf4e0a3d 204 int sysctl_fib_multipath_hash_policy;
70a269e6 205#endif
cacaad11 206
04b1d4e5 207 struct fib_notifier_ops *notifier_ops;
cacaad11
IS
208 unsigned int fib_seq; /* protected by rtnl_mutex */
209
4d65b948
YG
210 struct fib_notifier_ops *ipmr_notifier_ops;
211 unsigned int ipmr_seq; /* protected by rtnl_mutex */
212
ca4c3fc2 213 atomic_t rt_genid;
8afd351c
PE
214};
215#endif