Skip to content

Commit

Permalink
ipv6: added net argument to ICMP6_INC_STATS_BH
Browse files Browse the repository at this point in the history
Signed-off-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Denis V. Lunev authored and David S. Miller committed Oct 8, 2008
1 parent a862f6a commit e41b536
Show file tree
Hide file tree
Showing 7 changed files with 13 additions and 9 deletions.
3 changes: 2 additions & 1 deletion include/net/ipv6.h
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,8 @@ DECLARE_SNMP_STAT(struct icmpv6msg_mib, icmpv6msg_statistics);

#define ICMP6_INC_STATS(net, idev, field) ({ (void)(net); \
_DEVINC(icmpv6, , idev, field); })
#define ICMP6_INC_STATS_BH(idev, field) _DEVINC(icmpv6, _BH, idev, field)
#define ICMP6_INC_STATS_BH(net, idev, field) ({ (void)(net); \
_DEVINC(icmpv6, _BH, idev, field); })

#define ICMP6MSGOUT_INC_STATS(idev, field) \
_DEVINC(icmpv6msg, , idev, field +256)
Expand Down
6 changes: 4 additions & 2 deletions net/dccp/ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,8 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,

if (skb->len < offset + sizeof(*dh) ||
skb->len < offset + __dccp_basic_hdr_len(dh)) {
ICMP6_INC_STATS_BH(__in6_dev_get(skb->dev), ICMP6_MIB_INERRORS);
ICMP6_INC_STATS_BH(net, __in6_dev_get(skb->dev),
ICMP6_MIB_INERRORS);
return;
}

Expand All @@ -107,7 +108,8 @@ static void dccp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
&hdr->saddr, dh->dccph_sport, inet6_iif(skb));

if (sk == NULL) {
ICMP6_INC_STATS_BH(__in6_dev_get(skb->dev), ICMP6_MIB_INERRORS);
ICMP6_INC_STATS_BH(net, __in6_dev_get(skb->dev),
ICMP6_MIB_INERRORS);
return;
}

Expand Down
4 changes: 2 additions & 2 deletions net/ipv6/icmp.c
Original file line number Diff line number Diff line change
Expand Up @@ -664,7 +664,7 @@ static int icmpv6_rcv(struct sk_buff *skb)
skb_set_network_header(skb, nh);
}

ICMP6_INC_STATS_BH(idev, ICMP6_MIB_INMSGS);
ICMP6_INC_STATS_BH(dev_net(dev), idev, ICMP6_MIB_INMSGS);

saddr = &ipv6_hdr(skb)->saddr;
daddr = &ipv6_hdr(skb)->daddr;
Expand Down Expand Up @@ -772,7 +772,7 @@ static int icmpv6_rcv(struct sk_buff *skb)
return 0;

discard_it:
ICMP6_INC_STATS_BH(idev, ICMP6_MIB_INERRORS);
ICMP6_INC_STATS_BH(dev_net(dev), idev, ICMP6_MIB_INERRORS);
drop_no_count:
kfree_skb(skb);
return 0;
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/ip6_output.c
Original file line number Diff line number Diff line change
Expand Up @@ -1483,7 +1483,7 @@ int ip6_push_pending_frames(struct sock *sk)
struct inet6_dev *idev = ip6_dst_idev(skb->dst);

ICMP6MSGOUT_INC_STATS_BH(idev, icmp6_hdr(skb)->icmp6_type);
ICMP6_INC_STATS_BH(idev, ICMP6_MIB_OUTMSGS);
ICMP6_INC_STATS_BH(net, idev, ICMP6_MIB_OUTMSGS);
}

err = ip6_local_out(skb);
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/mcast.c
Original file line number Diff line number Diff line change
Expand Up @@ -1475,7 +1475,7 @@ static void mld_sendpack(struct sk_buff *skb)
out:
if (!err) {
ICMP6MSGOUT_INC_STATS_BH(idev, ICMPV6_MLD2_REPORT);
ICMP6_INC_STATS_BH(idev, ICMP6_MIB_OUTMSGS);
ICMP6_INC_STATS_BH(net, idev, ICMP6_MIB_OUTMSGS);
IP6_INC_STATS_BH(net, idev, IPSTATS_MIB_OUTMCASTPKTS);
} else
IP6_INC_STATS_BH(net, idev, IPSTATS_MIB_OUTDISCARDS);
Expand Down
3 changes: 2 additions & 1 deletion net/ipv6/tcp_ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -330,7 +330,8 @@ static void tcp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
th->dest, &hdr->saddr, th->source, skb->dev->ifindex);

if (sk == NULL) {
ICMP6_INC_STATS_BH(__in6_dev_get(skb->dev), ICMP6_MIB_INERRORS);
ICMP6_INC_STATS_BH(net, __in6_dev_get(skb->dev),
ICMP6_MIB_INERRORS);
return;
}

Expand Down
2 changes: 1 addition & 1 deletion net/sctp/ipv6.c
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ SCTP_STATIC void sctp_v6_err(struct sk_buff *skb, struct inet6_skb_parm *opt,
skb->network_header = saveip;
skb->transport_header = savesctp;
if (!sk) {
ICMP6_INC_STATS_BH(idev, ICMP6_MIB_INERRORS);
ICMP6_INC_STATS_BH(dev_net(skb->dev), idev, ICMP6_MIB_INERRORS);
goto out;
}

Expand Down

0 comments on commit e41b536

Please sign in to comment.