Commit 058caf45 authored by Hideaki Yoshifuji's avatar Hideaki Yoshifuji

[IPV{4,6}] introduce ip-independent ipstats_mib based on ipv6_mib.

parent 6e934547
......@@ -111,7 +111,7 @@ extern int sysctl_ipv6_bindv6only;
extern int sysctl_mld_max_msf;
/* MIBs */
DECLARE_SNMP_STAT(struct ipv6_mib, ipv6_statistics);
DECLARE_SNMP_STAT(struct ipstats_mib, ipv6_statistics);
#define IP6_INC_STATS(field) SNMP_INC_STATS(ipv6_statistics, field)
#define IP6_INC_STATS_BH(field) SNMP_INC_STATS_BH(ipv6_statistics, field)
#define IP6_INC_STATS_USER(field) SNMP_INC_STATS_USER(ipv6_statistics, field)
......
......@@ -85,31 +85,32 @@ struct ip_mib
/*
* RFC 2465: IPv6 MIB: General Group
* draft-ietf-ipv6-rfc2011-update-10.txt: MIB for IP: IP Statistics Tables
*/
struct ipv6_mib
struct ipstats_mib
{
unsigned long Ip6InReceives;
unsigned long Ip6InHdrErrors;
unsigned long Ip6InTooBigErrors;
unsigned long Ip6InNoRoutes;
unsigned long Ip6InAddrErrors;
unsigned long Ip6InUnknownProtos;
unsigned long Ip6InTruncatedPkts;
unsigned long Ip6InDiscards;
unsigned long Ip6InDelivers;
unsigned long Ip6OutForwDatagrams;
unsigned long Ip6OutRequests;
unsigned long Ip6OutDiscards;
unsigned long Ip6OutNoRoutes;
unsigned long Ip6ReasmTimeout;
unsigned long Ip6ReasmReqds;
unsigned long Ip6ReasmOKs;
unsigned long Ip6ReasmFails;
unsigned long Ip6FragOKs;
unsigned long Ip6FragFails;
unsigned long Ip6FragCreates;
unsigned long Ip6InMcastPkts;
unsigned long Ip6OutMcastPkts;
unsigned long InReceives;
unsigned long InHdrErrors;
unsigned long InTooBigErrors;
unsigned long InNoRoutes;
unsigned long InAddrErrors;
unsigned long InUnknownProtos;
unsigned long InTruncatedPkts;
unsigned long InDiscards;
unsigned long InDelivers;
unsigned long OutForwDatagrams;
unsigned long OutRequests;
unsigned long OutDiscards;
unsigned long OutNoRoutes;
unsigned long ReasmTimeout;
unsigned long ReasmReqds;
unsigned long ReasmOKs;
unsigned long ReasmFails;
unsigned long FragOKs;
unsigned long FragFails;
unsigned long FragCreates;
unsigned long InMcastPkts;
unsigned long OutMcastPkts;
unsigned long __pad[0];
};
......
......@@ -667,8 +667,8 @@ snmp6_mib_free(void *ptr[2])
static int __init init_ipv6_mibs(void)
{
if (snmp6_mib_init((void **)ipv6_statistics, sizeof (struct ipv6_mib),
__alignof__(struct ipv6_mib)) < 0)
if (snmp6_mib_init((void **)ipv6_statistics, sizeof (struct ipstats_mib),
__alignof__(struct ipstats_mib)) < 0)
goto err_ip_mib;
if (snmp6_mib_init((void **)icmpv6_statistics, sizeof (struct icmpv6_mib),
__alignof__(struct icmpv6_mib)) < 0)
......
......@@ -159,7 +159,7 @@ static int ipv6_destopt_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
if (!pskb_may_pull(skb, (skb->h.raw-skb->data)+8) ||
!pskb_may_pull(skb, (skb->h.raw-skb->data)+((skb->h.raw[1]+1)<<3))) {
IP6_INC_STATS_BH(Ip6InHdrErrors);
IP6_INC_STATS_BH(InHdrErrors);
kfree_skb(skb);
return -1;
}
......@@ -172,7 +172,7 @@ static int ipv6_destopt_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
return 1;
}
IP6_INC_STATS_BH(Ip6InHdrErrors);
IP6_INC_STATS_BH(InHdrErrors);
return -1;
}
......@@ -227,7 +227,7 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
if (!pskb_may_pull(skb, (skb->h.raw-skb->data)+8) ||
!pskb_may_pull(skb, (skb->h.raw-skb->data)+((skb->h.raw[1]+1)<<3))) {
IP6_INC_STATS_BH(Ip6InHdrErrors);
IP6_INC_STATS_BH(InHdrErrors);
kfree_skb(skb);
return -1;
}
......@@ -236,7 +236,7 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
if (ipv6_addr_is_multicast(&skb->nh.ipv6h->daddr) ||
skb->pkt_type != PACKET_HOST) {
IP6_INC_STATS_BH(Ip6InAddrErrors);
IP6_INC_STATS_BH(InAddrErrors);
kfree_skb(skb);
return -1;
}
......@@ -252,13 +252,13 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
}
if (hdr->type != IPV6_SRCRT_TYPE_0) {
IP6_INC_STATS_BH(Ip6InHdrErrors);
IP6_INC_STATS_BH(InHdrErrors);
icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, (&hdr->type) - skb->nh.raw);
return -1;
}
if (hdr->hdrlen & 0x01) {
IP6_INC_STATS_BH(Ip6InHdrErrors);
IP6_INC_STATS_BH(InHdrErrors);
icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, (&hdr->hdrlen) - skb->nh.raw);
return -1;
}
......@@ -271,7 +271,7 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
n = hdr->hdrlen >> 1;
if (hdr->segments_left > n) {
IP6_INC_STATS_BH(Ip6InHdrErrors);
IP6_INC_STATS_BH(InHdrErrors);
icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, (&hdr->segments_left) - skb->nh.raw);
return -1;
}
......@@ -284,7 +284,7 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
kfree_skb(skb);
/* the copy is a forwarded packet */
if (skb2 == NULL) {
IP6_INC_STATS_BH(Ip6OutDiscards);
IP6_INC_STATS_BH(OutDiscards);
return -1;
}
*skbp = skb = skb2;
......@@ -302,7 +302,7 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
addr += i - 1;
if (ipv6_addr_is_multicast(addr)) {
IP6_INC_STATS_BH(Ip6InAddrErrors);
IP6_INC_STATS_BH(InAddrErrors);
kfree_skb(skb);
return -1;
}
......@@ -319,7 +319,7 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
}
if (skb->dst->dev->flags&IFF_LOOPBACK) {
if (skb->nh.ipv6h->hop_limit <= 1) {
IP6_INC_STATS_BH(Ip6InHdrErrors);
IP6_INC_STATS_BH(InHdrErrors);
icmpv6_send(skb, ICMPV6_TIME_EXCEED, ICMPV6_EXC_HOPLIMIT,
0, skb->dev);
kfree_skb(skb);
......@@ -436,24 +436,24 @@ static int ipv6_hop_jumbo(struct sk_buff *skb, int optoff)
if (skb->nh.raw[optoff+1] != 4 || (optoff&3) != 2) {
LIMIT_NETDEBUG(
printk(KERN_DEBUG "ipv6_hop_jumbo: wrong jumbo opt length/alignment %d\n", skb->nh.raw[optoff+1]));
IP6_INC_STATS_BH(Ip6InHdrErrors);
IP6_INC_STATS_BH(InHdrErrors);
goto drop;
}
pkt_len = ntohl(*(u32*)(skb->nh.raw+optoff+2));
if (pkt_len <= IPV6_MAXPLEN) {
IP6_INC_STATS_BH(Ip6InHdrErrors);
IP6_INC_STATS_BH(InHdrErrors);
icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, optoff+2);
return 0;
}
if (skb->nh.ipv6h->payload_len) {
IP6_INC_STATS_BH(Ip6InHdrErrors);
IP6_INC_STATS_BH(InHdrErrors);
icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, optoff);
return 0;
}
if (pkt_len > skb->len - sizeof(struct ipv6hdr)) {
IP6_INC_STATS_BH(Ip6InTruncatedPkts);
IP6_INC_STATS_BH(InTruncatedPkts);
goto drop;
}
if (pkt_len + sizeof(struct ipv6hdr) < skb->len) {
......
......@@ -174,7 +174,7 @@ static inline int icmpv6_xrlim_allow(struct sock *sk, int type,
*/
dst = ip6_route_output(sk, fl);
if (dst->error) {
IP6_INC_STATS(Ip6OutNoRoutes);
IP6_INC_STATS(OutNoRoutes);
} else if (dst->dev && (dst->dev->flags&IFF_LOOPBACK)) {
res = 1;
} else {
......
......@@ -64,10 +64,10 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
if (skb->pkt_type == PACKET_OTHERHOST)
goto drop;
IP6_INC_STATS_BH(Ip6InReceives);
IP6_INC_STATS_BH(InReceives);
if ((skb = skb_share_check(skb, GFP_ATOMIC)) == NULL) {
IP6_INC_STATS_BH(Ip6InDiscards);
IP6_INC_STATS_BH(InDiscards);
goto out;
}
......@@ -80,7 +80,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
goto err;
if (!pskb_may_pull(skb, sizeof(struct ipv6hdr))) {
IP6_INC_STATS_BH(Ip6InHdrErrors);
IP6_INC_STATS_BH(InHdrErrors);
goto drop;
}
......@@ -97,7 +97,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
goto truncated;
if (pkt_len + sizeof(struct ipv6hdr) < skb->len) {
if (__pskb_trim(skb, pkt_len + sizeof(struct ipv6hdr))){
IP6_INC_STATS_BH(Ip6InHdrErrors);
IP6_INC_STATS_BH(InHdrErrors);
goto drop;
}
hdr = skb->nh.ipv6h;
......@@ -109,7 +109,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
if (hdr->nexthdr == NEXTHDR_HOP) {
skb->h.raw = (u8*)(hdr+1);
if (ipv6_parse_hopopts(skb, offsetof(struct ipv6hdr, nexthdr)) < 0) {
IP6_INC_STATS_BH(Ip6InHdrErrors);
IP6_INC_STATS_BH(InHdrErrors);
return 0;
}
hdr = skb->nh.ipv6h;
......@@ -117,9 +117,9 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
return NF_HOOK(PF_INET6,NF_IP6_PRE_ROUTING, skb, dev, NULL, ip6_rcv_finish);
truncated:
IP6_INC_STATS_BH(Ip6InTruncatedPkts);
IP6_INC_STATS_BH(InTruncatedPkts);
err:
IP6_INC_STATS_BH(Ip6InHdrErrors);
IP6_INC_STATS_BH(InHdrErrors);
drop:
kfree_skb(skb);
out:
......@@ -194,15 +194,15 @@ static inline int ip6_input_finish(struct sk_buff *skb)
if (ret > 0)
goto resubmit;
else if (ret == 0)
IP6_INC_STATS_BH(Ip6InDelivers);
IP6_INC_STATS_BH(InDelivers);
} else {
if (!raw_sk) {
if (xfrm6_policy_check(NULL, XFRM_POLICY_IN, skb)) {
IP6_INC_STATS_BH(Ip6InUnknownProtos);
IP6_INC_STATS_BH(InUnknownProtos);
icmpv6_param_prob(skb, ICMPV6_UNK_NEXTHDR, nhoff);
}
} else {
IP6_INC_STATS_BH(Ip6InDelivers);
IP6_INC_STATS_BH(InDelivers);
kfree_skb(skb);
}
}
......@@ -210,7 +210,7 @@ static inline int ip6_input_finish(struct sk_buff *skb)
return 0;
discard:
IP6_INC_STATS_BH(Ip6InDiscards);
IP6_INC_STATS_BH(InDiscards);
rcu_read_unlock();
kfree_skb(skb);
return 0;
......@@ -227,7 +227,7 @@ int ip6_mc_input(struct sk_buff *skb)
struct ipv6hdr *hdr;
int deliver;
IP6_INC_STATS_BH(Ip6InMcastPkts);
IP6_INC_STATS_BH(InMcastPkts);
hdr = skb->nh.ipv6h;
deliver = likely(!(skb->dev->flags & (IFF_PROMISC|IFF_ALLMULTI))) ||
......
......@@ -87,7 +87,7 @@ static inline int ip6_output_finish(struct sk_buff *skb)
} else if (dst->neighbour)
return dst->neighbour->output(skb);
IP6_INC_STATS_BH(Ip6OutNoRoutes);
IP6_INC_STATS_BH(OutNoRoutes);
kfree_skb(skb);
return -EINVAL;
......@@ -132,13 +132,13 @@ int ip6_output2(struct sk_buff *skb)
ip6_dev_loopback_xmit);
if (skb->nh.ipv6h->hop_limit == 0) {
IP6_INC_STATS(Ip6OutDiscards);
IP6_INC_STATS(OutDiscards);
kfree_skb(skb);
return 0;
}
}
IP6_INC_STATS(Ip6OutMcastPkts);
IP6_INC_STATS(OutMcastPkts);
}
return NF_HOOK(PF_INET6, NF_IP6_POST_ROUTING, skb,NULL, skb->dev,ip6_output_finish);
......@@ -169,7 +169,7 @@ int ip6_route_me_harder(struct sk_buff *skb)
dst = ip6_route_output(skb->sk, &fl);
if (dst->error) {
IP6_INC_STATS(Ip6OutNoRoutes);
IP6_INC_STATS(OutNoRoutes);
LIMIT_NETDEBUG(
printk(KERN_DEBUG "ip6_route_me_harder: No more route.\n"));
dst_release(dst);
......@@ -228,7 +228,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
kfree_skb(skb);
skb = skb2;
if (skb == NULL) {
IP6_INC_STATS(Ip6OutDiscards);
IP6_INC_STATS(OutDiscards);
return -ENOBUFS;
}
if (sk)
......@@ -262,7 +262,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
mtu = dst_pmtu(dst);
if ((skb->len <= mtu) || ipfragok) {
IP6_INC_STATS(Ip6OutRequests);
IP6_INC_STATS(OutRequests);
return NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev, ip6_maybe_reroute);
}
......@@ -270,7 +270,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
printk(KERN_DEBUG "IPv6: sending pkt_too_big to self\n");
skb->dev = dst->dev;
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, mtu, skb->dev);
IP6_INC_STATS(Ip6FragFails);
IP6_INC_STATS(FragFails);
kfree_skb(skb);
return -EMSGSIZE;
}
......@@ -352,7 +352,7 @@ int ip6_forward(struct sk_buff *skb)
goto error;
if (!xfrm6_policy_check(NULL, XFRM_POLICY_FWD, skb)) {
IP6_INC_STATS(Ip6InDiscards);
IP6_INC_STATS(InDiscards);
goto drop;
}
......@@ -391,7 +391,7 @@ int ip6_forward(struct sk_buff *skb)
}
if (!xfrm6_route_forward(skb)) {
IP6_INC_STATS(Ip6InDiscards);
IP6_INC_STATS(InDiscards);
goto drop;
}
......@@ -429,14 +429,14 @@ int ip6_forward(struct sk_buff *skb)
/* Again, force OUTPUT device used as source address */
skb->dev = dst->dev;
icmpv6_send(skb, ICMPV6_PKT_TOOBIG, 0, dst_pmtu(dst), skb->dev);
IP6_INC_STATS_BH(Ip6InTooBigErrors);
IP6_INC_STATS_BH(Ip6FragFails);
IP6_INC_STATS_BH(InTooBigErrors);
IP6_INC_STATS_BH(FragFails);
kfree_skb(skb);
return -EMSGSIZE;
}
if (skb_cow(skb, dst->dev->hard_header_len)) {
IP6_INC_STATS(Ip6OutDiscards);
IP6_INC_STATS(OutDiscards);
goto drop;
}
......@@ -446,11 +446,11 @@ int ip6_forward(struct sk_buff *skb)
hdr->hop_limit--;
IP6_INC_STATS_BH(Ip6OutForwDatagrams);
IP6_INC_STATS_BH(OutForwDatagrams);
return NF_HOOK(PF_INET6,NF_IP6_FORWARD, skb, skb->dev, dst->dev, ip6_forward_finish);
error:
IP6_INC_STATS_BH(Ip6InAddrErrors);
IP6_INC_STATS_BH(InAddrErrors);
drop:
kfree_skb(skb);
return -EINVAL;
......@@ -563,7 +563,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
tmp_hdr = kmalloc(hlen, GFP_ATOMIC);
if (!tmp_hdr) {
IP6_INC_STATS(Ip6FragFails);
IP6_INC_STATS(FragFails);
return -ENOMEM;
}
......@@ -618,7 +618,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
kfree(tmp_hdr);
if (err == 0) {
IP6_INC_STATS(Ip6FragOKs);
IP6_INC_STATS(FragOKs);
return 0;
}
......@@ -628,7 +628,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
frag = skb;
}
IP6_INC_STATS(Ip6FragFails);
IP6_INC_STATS(FragFails);
return err;
}
......@@ -661,7 +661,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
if ((frag = alloc_skb(len+hlen+sizeof(struct frag_hdr)+LL_RESERVED_SPACE(rt->u.dst.dev), GFP_ATOMIC)) == NULL) {
NETDEBUG(printk(KERN_INFO "IPv6: frag: no memory for new fragment!\n"));
IP6_INC_STATS(Ip6FragFails);
IP6_INC_STATS(FragFails);
err = -ENOMEM;
goto fail;
}
......@@ -719,19 +719,19 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
* Put this fragment into the sending queue.
*/
IP6_INC_STATS(Ip6FragCreates);
IP6_INC_STATS(FragCreates);
err = output(frag);
if (err)
goto fail;
}
kfree_skb(skb);
IP6_INC_STATS(Ip6FragOKs);
IP6_INC_STATS(FragOKs);
return err;
fail:
kfree_skb(skb);
IP6_INC_STATS(Ip6FragFails);
IP6_INC_STATS(FragFails);
return err;
}
......@@ -1016,7 +1016,7 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, int offse
return 0;
error:
inet->cork.length -= length;
IP6_INC_STATS(Ip6OutDiscards);
IP6_INC_STATS(OutDiscards);
return err;
}
......@@ -1076,7 +1076,7 @@ int ip6_push_pending_frames(struct sock *sk)
ipv6_addr_copy(&hdr->daddr, final_dst);
skb->dst = dst_clone(&rt->u.dst);
IP6_INC_STATS(Ip6OutRequests);
IP6_INC_STATS(OutRequests);
err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, skb->dst->dev, dst_output);
if (err) {
if (err > 0)
......@@ -1108,7 +1108,7 @@ void ip6_flush_pending_frames(struct sock *sk)
struct sk_buff *skb;
while ((skb = __skb_dequeue_tail(&sk->sk_write_queue)) != NULL) {
IP6_INC_STATS(Ip6OutDiscards);
IP6_INC_STATS(OutDiscards);
kfree_skb(skb);
}
......
......@@ -55,7 +55,7 @@
#include <asm/uaccess.h>
DEFINE_SNMP_STAT(struct ipv6_mib, ipv6_statistics);
DEFINE_SNMP_STAT(struct ipstats_mib, ipv6_statistics);
static struct packet_type ipv6_packet_type = {
.type = __constant_htons(ETH_P_IPV6),
......
......@@ -1317,7 +1317,7 @@ static void mld_sendpack(struct sk_buff *skb)
struct inet6_dev *idev = in6_dev_get(skb->dev);
int err;
IP6_INC_STATS(Ip6OutRequests);
IP6_INC_STATS(OutRequests);
payload_len = skb->tail - (unsigned char *)skb->nh.ipv6h -
sizeof(struct ipv6hdr);
mldlen = skb->tail - skb->h.raw;
......@@ -1329,9 +1329,9 @@ static void mld_sendpack(struct sk_buff *skb)
dev_queue_xmit);
if (!err) {
ICMP6_INC_STATS(idev,Icmp6OutMsgs);
IP6_INC_STATS(Ip6OutMcastPkts);
IP6_INC_STATS(OutMcastPkts);
} else
IP6_INC_STATS(Ip6OutDiscards);
IP6_INC_STATS(OutDiscards);
if (likely(idev != NULL))
in6_dev_put(idev);
......@@ -1613,7 +1613,7 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type)
IPV6_TLV_ROUTERALERT, 2, 0, 0,
IPV6_TLV_PADN, 0 };
IP6_INC_STATS(Ip6OutRequests);
IP6_INC_STATS(OutRequests);
snd_addr = addr;
if (type == ICMPV6_MGM_REDUCTION) {
snd_addr = &all_routers;
......@@ -1627,7 +1627,7 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type)
skb = sock_alloc_send_skb(sk, LL_RESERVED_SPACE(dev) + full_len, 1, &err);
if (skb == NULL) {
IP6_INC_STATS(Ip6OutDiscards);
IP6_INC_STATS(OutDiscards);
return;
}
......@@ -1672,16 +1672,16 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type)
else
ICMP6_INC_STATS(idev, Icmp6OutGroupMembResponses);
ICMP6_INC_STATS(idev, Icmp6OutMsgs);
IP6_INC_STATS(Ip6OutMcastPkts);
IP6_INC_STATS(OutMcastPkts);
} else
IP6_INC_STATS(Ip6OutDiscards);
IP6_INC_STATS(OutDiscards);
if (likely(idev != NULL))
in6_dev_put(idev);
return;
out:
IP6_INC_STATS(Ip6OutDiscards);
IP6_INC_STATS(OutDiscards);
kfree_skb(skb);
}
......
......@@ -452,7 +452,7 @@ static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh,
skb->dst = dst;
idev = in6_dev_get(dst->dev);
IP6_INC_STATS(Ip6OutRequests);
IP6_INC_STATS(OutRequests);
err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev, dst_output);
if (!err) {
ICMP6_INC_STATS(idev, Icmp6OutNeighborAdvertisements);
......@@ -536,7 +536,7 @@ void ndisc_send_ns(struct net_device *dev, struct neighbour *neigh,
/* send it! */
skb->dst = dst;
idev = in6_dev_get(dst->dev);
IP6_INC_STATS(Ip6OutRequests);
IP6_INC_STATS(OutRequests);
err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev, dst_output);
if (!err) {
ICMP6_INC_STATS(idev, Icmp6OutNeighborSolicits);
......@@ -609,7 +609,7 @@ void ndisc_send_rs(struct net_device *dev, struct in6_addr *saddr,
/* send it! */
skb->dst = dst;
idev = in6_dev_get(dst->dev);
IP6_INC_STATS(Ip6OutRequests);
IP6_INC_STATS(OutRequests);
err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, dst->dev, dst_output);
if (!err) {
ICMP6_INC_STATS(idev, Icmp6OutRouterSolicits);
......@@ -1335,7 +1335,7 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
buff->dst = dst;
idev = in6_dev_get(dst->dev);
IP6_INC_STATS(Ip6OutRequests);
IP6_INC_STATS(OutRequests);
err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, buff, NULL, dst->dev, dst_output);
if (!err) {
ICMP6_INC_STATS(idev, Icmp6OutRedirects);
......
......@@ -59,29 +59,29 @@ static int sockstat6_seq_show(struct seq_file *seq, void *v)
static struct snmp_item snmp6_ipv6_list[] = {
/* ipv6 mib according to RFC 2465 */
#define SNMP6_GEN(x) SNMP_ITEM(struct ipv6_mib, x, "Ip6" #x)
SNMP6_GEN(Ip6InReceives),
SNMP6_GEN(Ip6InHdrErrors),
SNMP6_GEN(Ip6InTooBigErrors),
SNMP6_GEN(Ip6InNoRoutes),
SNMP6_GEN(Ip6InAddrErrors),
SNMP6_GEN(Ip6InUnknownProtos),
SNMP6_GEN(Ip6InTruncatedPkts),
SNMP6_GEN(Ip6InDiscards),
SNMP6_GEN(Ip6InDelivers),
SNMP6_GEN(Ip6OutForwDatagrams),
SNMP6_GEN(Ip6OutRequests),
SNMP6_GEN(Ip6OutDiscards),
SNMP6_GEN(Ip6OutNoRoutes),
SNMP6_GEN(Ip6ReasmTimeout),
SNMP6_GEN(Ip6ReasmReqds),
SNMP6_GEN(Ip6ReasmOKs),
SNMP6_GEN(Ip6ReasmFails),
SNMP6_GEN(Ip6FragOKs),
SNMP6_GEN(Ip6FragFails),
SNMP6_GEN(Ip6FragCreates),
SNMP6_GEN(Ip6InMcastPkts),
SNMP6_GEN(Ip6OutMcastPkts),
#define SNMP6_GEN(x) SNMP_ITEM(struct ipstats_mib, x, "Ip6" #x)
SNMP6_GEN(InReceives),
SNMP6_GEN(InHdrErrors),
SNMP6_GEN(InTooBigErrors),
SNMP6_GEN(InNoRoutes),
SNMP6_GEN(InAddrErrors),
SNMP6_GEN(InUnknownProtos),
SNMP6_GEN(InTruncatedPkts),
SNMP6_GEN(InDiscards),
SNMP6_GEN(InDelivers),
SNMP6_GEN(OutForwDatagrams),
SNMP6_GEN(OutRequests),
SNMP6_GEN(OutDiscards),
SNMP6_GEN(OutNoRoutes),
SNMP6_GEN(ReasmTimeout),
SNMP6_GEN(ReasmReqds),
SNMP6_GEN(ReasmOKs),
SNMP6_GEN(ReasmFails),
SNMP6_GEN(FragOKs),
SNMP6_GEN(FragFails),
SNMP6_GEN(FragCreates),
SNMP6_GEN(InMcastPkts),
SNMP6_GEN(OutMcastPkts),
#undef SNMP6_GEN
SNMP_ITEM_SENTINEL
};
......
......@@ -535,7 +535,7 @@ static int rawv6_send_hdrinc(struct sock *sk, void *from, int length,
if (err)
goto error_fault;
IP6_INC_STATS(Ip6OutRequests);
IP6_INC_STATS(OutRequests);
err = NF_HOOK(PF_INET6, NF_IP6_LOCAL_OUT, skb, NULL, rt->u.dst.dev,
dst_output);
if (err > 0)
......@@ -549,7 +549,7 @@ static int rawv6_send_hdrinc(struct sock *sk, void *from, int length,
err = -EFAULT;
kfree_skb(skb);
error:
IP6_INC_STATS(Ip6OutDiscards);
IP6_INC_STATS(OutDiscards);
return err;
}
static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
......
......@@ -284,7 +284,7 @@ static void ip6_evictor(void)
spin_unlock(&fq->lock);
fq_put(fq);
IP6_INC_STATS_BH(Ip6ReasmFails);
IP6_INC_STATS_BH(ReasmFails);
}
}
......@@ -299,8 +299,8 @@ static void ip6_frag_expire(unsigned long data)
fq_kill(fq);
IP6_INC_STATS_BH(Ip6ReasmTimeout);
IP6_INC_STATS_BH(Ip6ReasmFails);
IP6_INC_STATS_BH(ReasmTimeout);
IP6_INC_STATS_BH(ReasmFails);
/* Send error only if the first segment arrived. */
if (fq->last_in&FIRST_IN && fq->fragments) {
......@@ -386,7 +386,7 @@ ip6_frag_create(unsigned int hash, u32 id, struct in6_addr *src, struct in6_addr
return ip6_frag_intern(hash, fq);
oom:
IP6_INC_STATS_BH(Ip6ReasmFails);
IP6_INC_STATS_BH(ReasmFails);
return NULL;
}
......@@ -426,7 +426,7 @@ static void ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
((u8 *) (fhdr + 1) - (u8 *) (skb->nh.ipv6h + 1)));
if ((unsigned int)end > IPV6_MAXPLEN) {
IP6_INC_STATS_BH(Ip6InHdrErrors);
IP6_INC_STATS_BH(InHdrErrors);
icmpv6_param_prob(skb,ICMPV6_HDR_FIELD, (u8*)&fhdr->frag_off - skb->nh.raw);
return;
}
......@@ -453,7 +453,7 @@ static void ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
/* RFC2460 says always send parameter problem in
* this case. -DaveM
*/
IP6_INC_STATS_BH(Ip6InHdrErrors);
IP6_INC_STATS_BH(InHdrErrors);
icmpv6_param_prob(skb, ICMPV6_HDR_FIELD,
offsetof(struct ipv6hdr, payload_len));
return;
......@@ -572,7 +572,7 @@ static void ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
return;
err:
IP6_INC_STATS(Ip6ReasmFails);
IP6_INC_STATS(ReasmFails);
kfree_skb(skb);
}
......@@ -666,7 +666,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff **skb_in,
if (head->ip_summed == CHECKSUM_HW)
head->csum = csum_partial(head->nh.raw, head->h.raw-head->nh.raw, head->csum);
IP6_INC_STATS_BH(Ip6ReasmOKs);
IP6_INC_STATS_BH(ReasmOKs);
fq->fragments = NULL;
*nhoffp = nhoff;
return 1;
......@@ -679,7 +679,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff **skb_in,
if (net_ratelimit())
printk(KERN_DEBUG "ip6_frag_reasm: no memory for reassembly\n");
out_fail:
IP6_INC_STATS_BH(Ip6ReasmFails);
IP6_INC_STATS_BH(ReasmFails);
return -1;
}
......@@ -693,16 +693,16 @@ static int ipv6_frag_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
hdr = skb->nh.ipv6h;
IP6_INC_STATS_BH(Ip6ReasmReqds);
IP6_INC_STATS_BH(ReasmReqds);
/* Jumbo payload inhibits frag. header */
if (hdr->payload_len==0) {
IP6_INC_STATS(Ip6InHdrErrors);
IP6_INC_STATS(InHdrErrors);
icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, skb->h.raw-skb->nh.raw);
return -1;
}
if (!pskb_may_pull(skb, (skb->h.raw-skb->data)+sizeof(struct frag_hdr))) {
IP6_INC_STATS(Ip6InHdrErrors);
IP6_INC_STATS(InHdrErrors);
icmpv6_param_prob(skb, ICMPV6_HDR_FIELD, skb->h.raw-skb->nh.raw);
return -1;
}
......@@ -713,7 +713,7 @@ static int ipv6_frag_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
if (!(fhdr->frag_off & htons(0xFFF9))) {
/* It is not a fragmented frame */
skb->h.raw += sizeof(struct frag_hdr);
IP6_INC_STATS_BH(Ip6ReasmOKs);
IP6_INC_STATS_BH(ReasmOKs);
*nhoffp = (u8*)fhdr - skb->nh.raw;
return 1;
......@@ -738,7 +738,7 @@ static int ipv6_frag_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
return ret;
}
IP6_INC_STATS_BH(Ip6ReasmFails);
IP6_INC_STATS_BH(ReasmFails);
kfree_skb(skb);
return -1;
}
......
......@@ -1259,7 +1259,7 @@ int ipv6_route_ioctl(unsigned int cmd, void __user *arg)
int ip6_pkt_discard(struct sk_buff *skb)
{
IP6_INC_STATS(Ip6OutNoRoutes);
IP6_INC_STATS(OutNoRoutes);
icmpv6_send(skb, ICMPV6_DEST_UNREACH, ICMPV6_NOROUTE, 0, skb->dev);
kfree_skb(skb);
return 0;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment