Skip to content

Commit dcfc23c

Browse files
xemuldavem330
authored andcommitted
mib: add struct net to ICMP_INC_STATS_BH
Signed-off-by: Pavel Emelyanov <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 75c939b commit dcfc23c

File tree

6 files changed

+14
-13
lines changed

6 files changed

+14
-13
lines changed

include/net/icmp.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ extern struct icmp_err icmp_err_convert[];
3232
DECLARE_SNMP_STAT(struct icmp_mib, icmp_statistics);
3333
DECLARE_SNMP_STAT(struct icmpmsg_mib, icmpmsg_statistics);
3434
#define ICMP_INC_STATS(net, field) SNMP_INC_STATS(icmp_statistics, field)
35-
#define ICMP_INC_STATS_BH(field) SNMP_INC_STATS_BH(icmp_statistics, field)
35+
#define ICMP_INC_STATS_BH(net, field) SNMP_INC_STATS_BH(icmp_statistics, field)
3636
#define ICMPMSGOUT_INC_STATS(field) SNMP_INC_STATS(icmpmsg_statistics, field+256)
3737
#define ICMPMSGIN_INC_STATS_BH(field) SNMP_INC_STATS_BH(icmpmsg_statistics, field)
3838

net/dccp/ipv4.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -208,15 +208,15 @@ static void dccp_v4_err(struct sk_buff *skb, u32 info)
208208
struct net *net = dev_net(skb->dev);
209209

210210
if (skb->len < (iph->ihl << 2) + 8) {
211-
ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
211+
ICMP_INC_STATS_BH(net, ICMP_MIB_INERRORS);
212212
return;
213213
}
214214

215215
sk = inet_lookup(net, &dccp_hashinfo,
216216
iph->daddr, dh->dccph_dport,
217217
iph->saddr, dh->dccph_sport, inet_iif(skb));
218218
if (sk == NULL) {
219-
ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
219+
ICMP_INC_STATS_BH(net, ICMP_MIB_INERRORS);
220220
return;
221221
}
222222

net/ipv4/icmp.c

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -763,7 +763,7 @@ static void icmp_unreach(struct sk_buff *skb)
763763
out:
764764
return;
765765
out_err:
766-
ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
766+
ICMP_INC_STATS_BH(net, ICMP_MIB_INERRORS);
767767
goto out;
768768
}
769769

@@ -803,7 +803,7 @@ static void icmp_redirect(struct sk_buff *skb)
803803
out:
804804
return;
805805
out_err:
806-
ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
806+
ICMP_INC_STATS_BH(dev_net(skb->dev), ICMP_MIB_INERRORS);
807807
goto out;
808808
}
809809

@@ -874,7 +874,7 @@ static void icmp_timestamp(struct sk_buff *skb)
874874
out:
875875
return;
876876
out_err:
877-
ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
877+
ICMP_INC_STATS_BH(dev_net(skb->dst->dev), ICMP_MIB_INERRORS);
878878
goto out;
879879
}
880880

@@ -994,7 +994,7 @@ int icmp_rcv(struct sk_buff *skb)
994994
skb_set_network_header(skb, nh);
995995
}
996996

997-
ICMP_INC_STATS_BH(ICMP_MIB_INMSGS);
997+
ICMP_INC_STATS_BH(net, ICMP_MIB_INMSGS);
998998

999999
switch (skb->ip_summed) {
10001000
case CHECKSUM_COMPLETE:
@@ -1053,7 +1053,7 @@ int icmp_rcv(struct sk_buff *skb)
10531053
kfree_skb(skb);
10541054
return 0;
10551055
error:
1056-
ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
1056+
ICMP_INC_STATS_BH(net, ICMP_MIB_INERRORS);
10571057
goto drop;
10581058
}
10591059

net/ipv4/tcp_ipv4.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -346,14 +346,14 @@ void tcp_v4_err(struct sk_buff *skb, u32 info)
346346
struct net *net = dev_net(skb->dev);
347347

348348
if (skb->len < (iph->ihl << 2) + 8) {
349-
ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
349+
ICMP_INC_STATS_BH(net, ICMP_MIB_INERRORS);
350350
return;
351351
}
352352

353353
sk = inet_lookup(net, &tcp_hashinfo, iph->daddr, th->dest,
354354
iph->saddr, th->source, inet_iif(skb));
355355
if (!sk) {
356-
ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
356+
ICMP_INC_STATS_BH(net, ICMP_MIB_INERRORS);
357357
return;
358358
}
359359
if (sk->sk_state == TCP_TIME_WAIT) {

net/ipv4/udp.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -359,7 +359,7 @@ void __udp4_lib_err(struct sk_buff *skb, u32 info, struct hlist_head udptable[])
359359
sk = __udp4_lib_lookup(net, iph->daddr, uh->dest,
360360
iph->saddr, uh->source, skb->dev->ifindex, udptable);
361361
if (sk == NULL) {
362-
ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
362+
ICMP_INC_STATS_BH(net, ICMP_MIB_INERRORS);
363363
return; /* No socket for error */
364364
}
365365

net/sctp/input.c

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,7 @@
6161
#include <net/sctp/sctp.h>
6262
#include <net/sctp/sm.h>
6363
#include <net/sctp/checksum.h>
64+
#include <net/net_namespace.h>
6465

6566
/* Forward declarations for internal helpers. */
6667
static int sctp_rcv_ootb(struct sk_buff *);
@@ -534,7 +535,7 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info)
534535
int err;
535536

536537
if (skb->len < ihlen + 8) {
537-
ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
538+
ICMP_INC_STATS_BH(&init_net, ICMP_MIB_INERRORS);
538539
return;
539540
}
540541

@@ -548,7 +549,7 @@ void sctp_v4_err(struct sk_buff *skb, __u32 info)
548549
skb->network_header = saveip;
549550
skb->transport_header = savesctp;
550551
if (!sk) {
551-
ICMP_INC_STATS_BH(ICMP_MIB_INERRORS);
552+
ICMP_INC_STATS_BH(&init_net, ICMP_MIB_INERRORS);
552553
return;
553554
}
554555
/* Warning: The sock lock is held. Remember to call

0 commit comments

Comments
 (0)