diff options
Diffstat (limited to 'include/net/udp.h')
-rw-r--r-- | include/net/udp.h | 28 |
1 files changed, 13 insertions, 15 deletions
diff --git a/include/net/udp.h b/include/net/udp.h index ccce83707046..addcdc67234c 100644 --- a/include/net/udp.h +++ b/include/net/udp.h | |||
@@ -148,27 +148,25 @@ extern int udp_lib_setsockopt(struct sock *sk, int level, int optname, | |||
148 | char __user *optval, int optlen, | 148 | char __user *optval, int optlen, |
149 | int (*push_pending_frames)(struct sock *)); | 149 | int (*push_pending_frames)(struct sock *)); |
150 | 150 | ||
151 | DECLARE_SNMP_STAT(struct udp_mib, udp_statistics); | ||
152 | DECLARE_SNMP_STAT(struct udp_mib, udp_stats_in6); | 151 | DECLARE_SNMP_STAT(struct udp_mib, udp_stats_in6); |
153 | 152 | ||
154 | /* UDP-Lite does not have a standardized MIB yet, so we inherit from UDP */ | 153 | /* UDP-Lite does not have a standardized MIB yet, so we inherit from UDP */ |
155 | DECLARE_SNMP_STAT(struct udp_mib, udplite_statistics); | ||
156 | DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6); | 154 | DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6); |
157 | 155 | ||
158 | /* | 156 | /* |
159 | * SNMP statistics for UDP and UDP-Lite | 157 | * SNMP statistics for UDP and UDP-Lite |
160 | */ | 158 | */ |
161 | #define UDP_INC_STATS_USER(field, is_udplite) do { \ | 159 | #define UDP_INC_STATS_USER(net, field, is_udplite) do { \ |
162 | if (is_udplite) SNMP_INC_STATS_USER(udplite_statistics, field); \ | 160 | if (is_udplite) SNMP_INC_STATS_USER((net)->mib.udplite_statistics, field); \ |
163 | else SNMP_INC_STATS_USER(udp_statistics, field); } while(0) | 161 | else SNMP_INC_STATS_USER((net)->mib.udp_statistics, field); } while(0) |
164 | #define UDP_INC_STATS_BH(field, is_udplite) do { \ | 162 | #define UDP_INC_STATS_BH(net, field, is_udplite) do { \ |
165 | if (is_udplite) SNMP_INC_STATS_BH(udplite_statistics, field); \ | 163 | if (is_udplite) SNMP_INC_STATS_BH((net)->mib.udplite_statistics, field); \ |
166 | else SNMP_INC_STATS_BH(udp_statistics, field); } while(0) | 164 | else SNMP_INC_STATS_BH((net)->mib.udp_statistics, field); } while(0) |
167 | 165 | ||
168 | #define UDP6_INC_STATS_BH(field, is_udplite) do { \ | 166 | #define UDP6_INC_STATS_BH(net, field, is_udplite) do { (void)net; \ |
169 | if (is_udplite) SNMP_INC_STATS_BH(udplite_stats_in6, field); \ | 167 | if (is_udplite) SNMP_INC_STATS_BH(udplite_stats_in6, field); \ |
170 | else SNMP_INC_STATS_BH(udp_stats_in6, field); } while(0) | 168 | else SNMP_INC_STATS_BH(udp_stats_in6, field); } while(0) |
171 | #define UDP6_INC_STATS_USER(field, is_udplite) do { \ | 169 | #define UDP6_INC_STATS_USER(net, field, is_udplite) do { (void)net; \ |
172 | if (is_udplite) SNMP_INC_STATS_USER(udplite_stats_in6, field); \ | 170 | if (is_udplite) SNMP_INC_STATS_USER(udplite_stats_in6, field); \ |
173 | else SNMP_INC_STATS_USER(udp_stats_in6, field); } while(0) | 171 | else SNMP_INC_STATS_USER(udp_stats_in6, field); } while(0) |
174 | 172 | ||
@@ -176,12 +174,12 @@ DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6); | |||
176 | #define UDPX_INC_STATS_BH(sk, field) \ | 174 | #define UDPX_INC_STATS_BH(sk, field) \ |
177 | do { \ | 175 | do { \ |
178 | if ((sk)->sk_family == AF_INET) \ | 176 | if ((sk)->sk_family == AF_INET) \ |
179 | UDP_INC_STATS_BH(field, 0); \ | 177 | UDP_INC_STATS_BH(sock_net(sk), field, 0); \ |
180 | else \ | 178 | else \ |
181 | UDP6_INC_STATS_BH(field, 0); \ | 179 | UDP6_INC_STATS_BH(sock_net(sk), field, 0); \ |
182 | } while (0); | 180 | } while (0); |
183 | #else | 181 | #else |
184 | #define UDPX_INC_STATS_BH(sk, field) UDP_INC_STATS_BH(field, 0) | 182 | #define UDPX_INC_STATS_BH(sk, field) UDP_INC_STATS_BH(sock_net(sk), field, 0) |
185 | #endif | 183 | #endif |
186 | 184 | ||
187 | /* /proc */ | 185 | /* /proc */ |
@@ -196,8 +194,8 @@ struct udp_seq_afinfo { | |||
196 | struct udp_iter_state { | 194 | struct udp_iter_state { |
197 | struct seq_net_private p; | 195 | struct seq_net_private p; |
198 | sa_family_t family; | 196 | sa_family_t family; |
199 | struct hlist_head *hashtable; | ||
200 | int bucket; | 197 | int bucket; |
198 | struct hlist_head *hashtable; | ||
201 | }; | 199 | }; |
202 | 200 | ||
203 | #ifdef CONFIG_PROC_FS | 201 | #ifdef CONFIG_PROC_FS |