MIB: add struct net to UDP6_INC_STATS_BH

Signed-off-by: Pavel Emelyanov <xemul@openvz.org>
Acked-by: Denis V. Lunev <den@openvz.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
Pavel Emelyanov 2008-07-05 21:19:40 -07:00 committed by David S. Miller
parent 235b9f7ac5
commit ef28d1a20f
2 changed files with 9 additions and 8 deletions

View file

@ -165,7 +165,7 @@ DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6);
if (is_udplite) SNMP_INC_STATS_BH(udplite_statistics, field); \ if (is_udplite) SNMP_INC_STATS_BH(udplite_statistics, field); \
else SNMP_INC_STATS_BH(udp_statistics, field); } while(0) else SNMP_INC_STATS_BH(udp_statistics, field); } while(0)
#define UDP6_INC_STATS_BH(field, is_udplite) do { \ #define UDP6_INC_STATS_BH(net, field, is_udplite) do { (void)net; \
if (is_udplite) SNMP_INC_STATS_BH(udplite_stats_in6, field); \ if (is_udplite) SNMP_INC_STATS_BH(udplite_stats_in6, field); \
else SNMP_INC_STATS_BH(udp_stats_in6, field); } while(0) else SNMP_INC_STATS_BH(udp_stats_in6, field); } while(0)
#define UDP6_INC_STATS_USER(net, field, is_udplite) do { (void)net; \ #define UDP6_INC_STATS_USER(net, field, is_udplite) do { (void)net; \
@ -178,7 +178,7 @@ DECLARE_SNMP_STAT(struct udp_mib, udplite_stats_in6);
if ((sk)->sk_family == AF_INET) \ if ((sk)->sk_family == AF_INET) \
UDP_INC_STATS_BH(sock_net(sk), field, 0); \ UDP_INC_STATS_BH(sock_net(sk), field, 0); \
else \ else \
UDP6_INC_STATS_BH(field, 0); \ UDP6_INC_STATS_BH(sock_net(sk), field, 0); \
} while (0); } while (0);
#else #else
#define UDPX_INC_STATS_BH(sk, field) UDP_INC_STATS_BH(sock_net(sk), field, 0) #define UDPX_INC_STATS_BH(sk, field) UDP_INC_STATS_BH(sock_net(sk), field, 0)

View file

@ -299,7 +299,8 @@ int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
if ((rc = sock_queue_rcv_skb(sk,skb)) < 0) { if ((rc = sock_queue_rcv_skb(sk,skb)) < 0) {
/* Note that an ENOMEM error is charged twice */ /* Note that an ENOMEM error is charged twice */
if (rc == -ENOMEM) { if (rc == -ENOMEM) {
UDP6_INC_STATS_BH(UDP_MIB_RCVBUFERRORS, is_udplite); UDP6_INC_STATS_BH(sock_net(sk),
UDP_MIB_RCVBUFERRORS, is_udplite);
atomic_inc(&sk->sk_drops); atomic_inc(&sk->sk_drops);
} }
goto drop; goto drop;
@ -307,7 +308,7 @@ int udpv6_queue_rcv_skb(struct sock * sk, struct sk_buff *skb)
return 0; return 0;
drop: drop:
UDP6_INC_STATS_BH(UDP_MIB_INERRORS, is_udplite); UDP6_INC_STATS_BH(sock_net(sk), UDP_MIB_INERRORS, is_udplite);
kfree_skb(skb); kfree_skb(skb);
return -1; return -1;
} }
@ -439,7 +440,7 @@ int __udp6_lib_rcv(struct sk_buff *skb, struct hlist_head udptable[],
struct net_device *dev = skb->dev; struct net_device *dev = skb->dev;
struct in6_addr *saddr, *daddr; struct in6_addr *saddr, *daddr;
u32 ulen = 0; u32 ulen = 0;
struct net *net; struct net *net = dev_net(skb->dev);
if (!pskb_may_pull(skb, sizeof(struct udphdr))) if (!pskb_may_pull(skb, sizeof(struct udphdr)))
goto short_packet; goto short_packet;
@ -474,7 +475,6 @@ int __udp6_lib_rcv(struct sk_buff *skb, struct hlist_head udptable[],
if (udp6_csum_init(skb, uh, proto)) if (udp6_csum_init(skb, uh, proto))
goto discard; goto discard;
net = dev_net(skb->dev);
/* /*
* Multicast receive code * Multicast receive code
*/ */
@ -497,7 +497,8 @@ int __udp6_lib_rcv(struct sk_buff *skb, struct hlist_head udptable[],
if (udp_lib_checksum_complete(skb)) if (udp_lib_checksum_complete(skb))
goto discard; goto discard;
UDP6_INC_STATS_BH(UDP_MIB_NOPORTS, proto == IPPROTO_UDPLITE); UDP6_INC_STATS_BH(net, UDP_MIB_NOPORTS,
proto == IPPROTO_UDPLITE);
icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_PORT_UNREACH, 0, dev); icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_PORT_UNREACH, 0, dev);
@ -522,7 +523,7 @@ int __udp6_lib_rcv(struct sk_buff *skb, struct hlist_head udptable[],
ulen, skb->len); ulen, skb->len);
discard: discard:
UDP6_INC_STATS_BH(UDP_MIB_INERRORS, proto == IPPROTO_UDPLITE); UDP6_INC_STATS_BH(net, UDP_MIB_INERRORS, proto == IPPROTO_UDPLITE);
kfree_skb(skb); kfree_skb(skb);
return 0; return 0;
} }