Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
L
linux
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
nexedi
linux
Commits
71d50c2b
Commit
71d50c2b
authored
Jun 01, 2004
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://bk.skbuff.net:20607/linux-2.6-ipstats
into nuts.davemloft.net:/disk1/BK/net-2.6
parents
c6e97af6
1db8a26a
Changes
25
Hide whitespace changes
Inline
Side-by-side
Showing
25 changed files
with
234 additions
and
222 deletions
+234
-222
include/net/ip.h
include/net/ip.h
+1
-1
include/net/ipv6.h
include/net/ipv6.h
+1
-1
include/net/snmp.h
include/net/snmp.h
+39
-48
net/ipv4/af_inet.c
net/ipv4/af_inet.c
+2
-2
net/ipv4/ip_forward.c
net/ipv4/ip_forward.c
+1
-1
net/ipv4/ip_fragment.c
net/ipv4/ip_fragment.c
+7
-7
net/ipv4/ip_input.c
net/ipv4/ip_input.c
+9
-9
net/ipv4/ip_output.c
net/ipv4/ip_output.c
+11
-11
net/ipv4/ipmr.c
net/ipv4/ipmr.c
+2
-2
net/ipv4/proc.c
net/ipv4/proc.c
+39
-11
net/ipv4/raw.c
net/ipv4/raw.c
+1
-1
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_ipv4.c
+2
-2
net/ipv6/af_inet6.c
net/ipv6/af_inet6.c
+4
-4
net/ipv6/exthdrs.c
net/ipv6/exthdrs.c
+14
-14
net/ipv6/icmp.c
net/ipv6/icmp.c
+1
-1
net/ipv6/ip6_input.c
net/ipv6/ip6_input.c
+12
-12
net/ipv6/ip6_output.c
net/ipv6/ip6_output.c
+24
-24
net/ipv6/ipv6_sockglue.c
net/ipv6/ipv6_sockglue.c
+1
-1
net/ipv6/mcast.c
net/ipv6/mcast.c
+8
-8
net/ipv6/ndisc.c
net/ipv6/ndisc.c
+4
-4
net/ipv6/proc.c
net/ipv6/proc.c
+33
-40
net/ipv6/raw.c
net/ipv6/raw.c
+2
-2
net/ipv6/reassembly.c
net/ipv6/reassembly.c
+14
-14
net/ipv6/route.c
net/ipv6/route.c
+1
-1
net/sctp/output.c
net/sctp/output.c
+1
-1
No files found.
include/net/ip.h
View file @
71d50c2b
...
...
@@ -150,7 +150,7 @@ struct ipv4_config
};
extern
struct
ipv4_config
ipv4_config
;
DECLARE_SNMP_STAT
(
struct
ip_mib
,
ip_statistics
);
DECLARE_SNMP_STAT
(
struct
ip
stats
_mib
,
ip_statistics
);
#define IP_INC_STATS(field) SNMP_INC_STATS(ip_statistics, field)
#define IP_INC_STATS_BH(field) SNMP_INC_STATS_BH(ip_statistics, field)
#define IP_INC_STATS_USER(field) SNMP_INC_STATS_USER(ip_statistics, field)
...
...
include/net/ipv6.h
View file @
71d50c2b
...
...
@@ -111,7 +111,7 @@ extern int sysctl_ipv6_bindv6only;
extern
int
sysctl_mld_max_msf
;
/* MIBs */
DECLARE_SNMP_STAT
(
struct
ip
v6
_mib
,
ipv6_statistics
);
DECLARE_SNMP_STAT
(
struct
ip
stats
_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)
...
...
include/net/snmp.h
View file @
71d50c2b
...
...
@@ -41,61 +41,52 @@
* cacheline machine it makes a *lot* of sense -AK
*/
struct
snmp_item
{
char
*
name
;
int
offset
;
};
#define SNMP_ITEM(mib,entry,procname) { \
.name = procname, \
.offset = offsetof(mib, entry), \
}
#define SNMP_ITEM_SENTINEL { \
.name = NULL, \
.offset = 0, \
}
/*
* RFC 1213: MIB-II
* RFC 2011 (updates 1213): SNMPv2-MIB-IP
* RFC 2863: Interfaces Group MIB
*/
struct
ip_mib
{
unsigned
long
IpInReceives
;
unsigned
long
IpInHdrErrors
;
unsigned
long
IpInAddrErrors
;
unsigned
long
IpForwDatagrams
;
unsigned
long
IpInUnknownProtos
;
unsigned
long
IpInDiscards
;
unsigned
long
IpInDelivers
;
unsigned
long
IpOutRequests
;
unsigned
long
IpOutDiscards
;
unsigned
long
IpOutNoRoutes
;
unsigned
long
IpReasmTimeout
;
unsigned
long
IpReasmReqds
;
unsigned
long
IpReasmOKs
;
unsigned
long
IpReasmFails
;
unsigned
long
IpFragOKs
;
unsigned
long
IpFragFails
;
unsigned
long
IpFragCreates
;
unsigned
long
__pad
[
0
];
};
/*
* RFC 2465: IPv6 MIB: General Group
* draft-ietf-ipv6-rfc2011-update-10.txt: MIB for IP: IP Statistics Tables
*/
struct
ip
v6
_mib
struct
ip
stats
_mib
{
unsigned
long
I
p6I
nReceives
;
unsigned
long
I
p6I
nHdrErrors
;
unsigned
long
I
p6I
nTooBigErrors
;
unsigned
long
I
p6I
nNoRoutes
;
unsigned
long
I
p6I
nAddrErrors
;
unsigned
long
I
p6I
nUnknownProtos
;
unsigned
long
I
p6I
nTruncatedPkts
;
unsigned
long
I
p6I
nDiscards
;
unsigned
long
I
p6I
nDelivers
;
unsigned
long
Ip6
OutForwDatagrams
;
unsigned
long
Ip6
OutRequests
;
unsigned
long
Ip6
OutDiscards
;
unsigned
long
Ip6
OutNoRoutes
;
unsigned
long
Ip6
ReasmTimeout
;
unsigned
long
Ip6
ReasmReqds
;
unsigned
long
Ip6
ReasmOKs
;
unsigned
long
Ip6
ReasmFails
;
unsigned
long
Ip6
FragOKs
;
unsigned
long
Ip6
FragFails
;
unsigned
long
Ip6
FragCreates
;
unsigned
long
I
p6I
nMcastPkts
;
unsigned
long
Ip6
OutMcastPkts
;
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
];
};
...
...
net/ipv4/af_inet.c
View file @
71d50c2b
...
...
@@ -1066,8 +1066,8 @@ static int __init init_ipv4_mibs(void)
{
net_statistics
[
0
]
=
alloc_percpu
(
struct
linux_mib
);
net_statistics
[
1
]
=
alloc_percpu
(
struct
linux_mib
);
ip_statistics
[
0
]
=
alloc_percpu
(
struct
ip_mib
);
ip_statistics
[
1
]
=
alloc_percpu
(
struct
ip_mib
);
ip_statistics
[
0
]
=
alloc_percpu
(
struct
ip
stats
_mib
);
ip_statistics
[
1
]
=
alloc_percpu
(
struct
ip
stats
_mib
);
icmp_statistics
[
0
]
=
alloc_percpu
(
struct
icmp_mib
);
icmp_statistics
[
1
]
=
alloc_percpu
(
struct
icmp_mib
);
tcp_statistics
[
0
]
=
alloc_percpu
(
struct
tcp_mib
);
...
...
net/ipv4/ip_forward.c
View file @
71d50c2b
...
...
@@ -46,7 +46,7 @@ static inline int ip_forward_finish(struct sk_buff *skb)
{
struct
ip_options
*
opt
=
&
(
IPCB
(
skb
)
->
opt
);
IP_INC_STATS_BH
(
Ip
ForwDatagrams
);
IP_INC_STATS_BH
(
Out
ForwDatagrams
);
if
(
unlikely
(
opt
->
optlen
))
ip_forward_options
(
skb
);
...
...
net/ipv4/ip_fragment.c
View file @
71d50c2b
...
...
@@ -263,7 +263,7 @@ static void ip_evictor(void)
spin_unlock
(
&
qp
->
lock
);
ipq_put
(
qp
);
IP_INC_STATS_BH
(
Ip
ReasmFails
);
IP_INC_STATS_BH
(
ReasmFails
);
}
}
...
...
@@ -281,8 +281,8 @@ static void ip_expire(unsigned long arg)
ipq_kill
(
qp
);
IP_INC_STATS_BH
(
Ip
ReasmTimeout
);
IP_INC_STATS_BH
(
Ip
ReasmFails
);
IP_INC_STATS_BH
(
ReasmTimeout
);
IP_INC_STATS_BH
(
ReasmFails
);
if
((
qp
->
last_in
&
FIRST_IN
)
&&
qp
->
fragments
!=
NULL
)
{
struct
sk_buff
*
head
=
qp
->
fragments
;
...
...
@@ -609,7 +609,7 @@ static struct sk_buff *ip_frag_reasm(struct ipq *qp, struct net_device *dev)
iph
=
head
->
nh
.
iph
;
iph
->
frag_off
=
0
;
iph
->
tot_len
=
htons
(
len
);
IP_INC_STATS_BH
(
Ip
ReasmOKs
);
IP_INC_STATS_BH
(
ReasmOKs
);
qp
->
fragments
=
NULL
;
return
head
;
...
...
@@ -625,7 +625,7 @@ static struct sk_buff *ip_frag_reasm(struct ipq *qp, struct net_device *dev)
"Oversized IP packet from %d.%d.%d.%d.
\n
"
,
NIPQUAD
(
qp
->
saddr
));
out_fail:
IP_INC_STATS_BH
(
Ip
ReasmFails
);
IP_INC_STATS_BH
(
ReasmFails
);
return
NULL
;
}
...
...
@@ -636,7 +636,7 @@ struct sk_buff *ip_defrag(struct sk_buff *skb)
struct
ipq
*
qp
;
struct
net_device
*
dev
;
IP_INC_STATS_BH
(
Ip
ReasmReqds
);
IP_INC_STATS_BH
(
ReasmReqds
);
/* Start by cleaning up the memory. */
if
(
atomic_read
(
&
ip_frag_mem
)
>
sysctl_ipfrag_high_thresh
)
...
...
@@ -661,7 +661,7 @@ struct sk_buff *ip_defrag(struct sk_buff *skb)
return
ret
;
}
IP_INC_STATS_BH
(
Ip
ReasmFails
);
IP_INC_STATS_BH
(
ReasmFails
);
kfree_skb
(
skb
);
return
NULL
;
}
...
...
net/ipv4/ip_input.c
View file @
71d50c2b
...
...
@@ -150,7 +150,7 @@
* SNMP management statistics
*/
DEFINE_SNMP_STAT
(
struct
ip_mib
,
ip_statistics
);
DEFINE_SNMP_STAT
(
struct
ip
stats
_mib
,
ip_statistics
);
/*
* Process Router Attention IP option
...
...
@@ -249,16 +249,16 @@ static inline int ip_local_deliver_finish(struct sk_buff *skb)
protocol
=
-
ret
;
goto
resubmit
;
}
IP_INC_STATS_BH
(
I
pI
nDelivers
);
IP_INC_STATS_BH
(
InDelivers
);
}
else
{
if
(
!
raw_sk
)
{
if
(
xfrm4_policy_check
(
NULL
,
XFRM_POLICY_IN
,
skb
))
{
IP_INC_STATS_BH
(
I
pI
nUnknownProtos
);
IP_INC_STATS_BH
(
InUnknownProtos
);
icmp_send
(
skb
,
ICMP_DEST_UNREACH
,
ICMP_PROT_UNREACH
,
0
);
}
}
else
IP_INC_STATS_BH
(
I
pI
nDelivers
);
IP_INC_STATS_BH
(
InDelivers
);
kfree_skb
(
skb
);
}
}
...
...
@@ -324,7 +324,7 @@ static inline int ip_rcv_finish(struct sk_buff *skb)
*/
if
(
skb_cow
(
skb
,
skb_headroom
(
skb
)))
{
IP_INC_STATS_BH
(
I
pI
nDiscards
);
IP_INC_STATS_BH
(
InDiscards
);
goto
drop
;
}
iph
=
skb
->
nh
.
iph
;
...
...
@@ -353,7 +353,7 @@ static inline int ip_rcv_finish(struct sk_buff *skb)
return
dst_input
(
skb
);
inhdr_error:
IP_INC_STATS_BH
(
I
pI
nHdrErrors
);
IP_INC_STATS_BH
(
InHdrErrors
);
drop:
kfree_skb
(
skb
);
return
NET_RX_DROP
;
...
...
@@ -372,10 +372,10 @@ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
if
(
skb
->
pkt_type
==
PACKET_OTHERHOST
)
goto
drop
;
IP_INC_STATS_BH
(
I
pI
nReceives
);
IP_INC_STATS_BH
(
InReceives
);
if
((
skb
=
skb_share_check
(
skb
,
GFP_ATOMIC
))
==
NULL
)
{
IP_INC_STATS_BH
(
I
pI
nDiscards
);
IP_INC_STATS_BH
(
InDiscards
);
goto
out
;
}
...
...
@@ -426,7 +426,7 @@ int ip_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt)
ip_rcv_finish
);
inhdr_error:
IP_INC_STATS_BH
(
I
pI
nHdrErrors
);
IP_INC_STATS_BH
(
InHdrErrors
);
drop:
kfree_skb
(
skb
);
out:
...
...
net/ipv4/ip_output.c
View file @
71d50c2b
...
...
@@ -232,7 +232,7 @@ int ip_mc_output(struct sk_buff *skb)
/*
* If the indicated interface is up and running, send the packet.
*/
IP_INC_STATS
(
Ip
OutRequests
);
IP_INC_STATS
(
OutRequests
);
skb
->
dev
=
dev
;
skb
->
protocol
=
htons
(
ETH_P_IP
);
...
...
@@ -285,7 +285,7 @@ int ip_mc_output(struct sk_buff *skb)
int
ip_output
(
struct
sk_buff
*
skb
)
{
IP_INC_STATS
(
Ip
OutRequests
);
IP_INC_STATS
(
OutRequests
);
if
((
skb
->
len
>
dst_pmtu
(
skb
->
dst
)
||
skb_shinfo
(
skb
)
->
frag_list
)
&&
!
skb_shinfo
(
skb
)
->
tso_size
)
...
...
@@ -390,7 +390,7 @@ int ip_queue_xmit(struct sk_buff *skb, int ipfragok)
dst_output
);
no_route:
IP_INC_STATS
(
Ip
OutNoRoutes
);
IP_INC_STATS
(
OutNoRoutes
);
kfree_skb
(
skb
);
return
-
EHOSTUNREACH
;
}
...
...
@@ -547,7 +547,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
}
if
(
err
==
0
)
{
IP_INC_STATS
(
Ip
FragOKs
);
IP_INC_STATS
(
FragOKs
);
return
0
;
}
...
...
@@ -556,7 +556,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
kfree_skb
(
frag
);
frag
=
skb
;
}
IP_INC_STATS
(
Ip
FragFails
);
IP_INC_STATS
(
FragFails
);
return
err
;
}
...
...
@@ -662,7 +662,7 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
* Put this fragment into the sending queue.
*/
IP_INC_STATS
(
Ip
FragCreates
);
IP_INC_STATS
(
FragCreates
);
iph
->
tot_len
=
htons
(
len
+
hlen
);
...
...
@@ -673,12 +673,12 @@ int ip_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
goto
fail
;
}
kfree_skb
(
skb
);
IP_INC_STATS
(
Ip
FragOKs
);
IP_INC_STATS
(
FragOKs
);
return
err
;
fail:
kfree_skb
(
skb
);
IP_INC_STATS
(
Ip
FragFails
);
IP_INC_STATS
(
FragFails
);
return
err
;
}
...
...
@@ -975,7 +975,7 @@ int ip_append_data(struct sock *sk,
error:
inet
->
cork
.
length
-=
length
;
IP_INC_STATS
(
Ip
OutDiscards
);
IP_INC_STATS
(
OutDiscards
);
return
err
;
}
...
...
@@ -1088,7 +1088,7 @@ ssize_t ip_append_page(struct sock *sk, struct page *page,
error:
inet
->
cork
.
length
-=
size
;
IP_INC_STATS
(
Ip
OutDiscards
);
IP_INC_STATS
(
OutDiscards
);
return
err
;
}
...
...
@@ -1198,7 +1198,7 @@ int ip_push_pending_frames(struct sock *sk)
return
err
;
error:
IP_INC_STATS
(
Ip
OutDiscards
);
IP_INC_STATS
(
OutDiscards
);
goto
out
;
}
...
...
net/ipv4/ipmr.c
View file @
71d50c2b
...
...
@@ -1115,7 +1115,7 @@ static inline int ipmr_forward_finish(struct sk_buff *skb)
{
struct
ip_options
*
opt
=
&
(
IPCB
(
skb
)
->
opt
);
IP_INC_STATS_BH
(
Ip
ForwDatagrams
);
IP_INC_STATS_BH
(
Out
ForwDatagrams
);
if
(
unlikely
(
opt
->
optlen
))
ip_forward_options
(
skb
);
...
...
@@ -1178,7 +1178,7 @@ static void ipmr_queue_xmit(struct sk_buff *skb, struct mfc_cache *c, int vifi)
to blackhole.
*/
IP_INC_STATS_BH
(
Ip
FragFails
);
IP_INC_STATS_BH
(
FragFails
);
ip_rt_put
(
rt
);
goto
out_free
;
}
...
...
net/ipv4/proc.c
View file @
71d50c2b
...
...
@@ -88,7 +88,7 @@ static struct file_operations sockstat_seq_fops = {
};
static
unsigned
long
fold_field
(
void
*
mib
[],
int
nr
)
__fold_field
(
void
*
mib
[],
int
offt
)
{
unsigned
long
res
=
0
;
int
i
;
...
...
@@ -98,14 +98,41 @@ fold_field(void *mib[], int nr)
continue
;
res
+=
*
((
unsigned
long
*
)
(((
void
*
)
per_cpu_ptr
(
mib
[
0
],
i
))
+
sizeof
(
unsigned
long
)
*
nr
));
offt
));
res
+=
*
((
unsigned
long
*
)
(((
void
*
)
per_cpu_ptr
(
mib
[
1
],
i
))
+
sizeof
(
unsigned
long
)
*
nr
));
offt
));
}
return
res
;
}
#define fold_field(_mib, _nr) __fold_field(_mib, (sizeof(unsigned long) * (_nr)))
/* snmp items */
static
struct
snmp_item
snmp4_ipstats_list
[]
=
{
#define __SNMP_GEN(x,y) SNMP_ITEM(struct ipstats_mib, x, y)
#define SNMP_GEN(x) __SNMP_GEN(x, #x)
SNMP_GEN
(
InReceives
),
SNMP_GEN
(
InHdrErrors
),
SNMP_GEN
(
InAddrErrors
),
__SNMP_GEN
(
OutForwDatagrams
,
"ForwDatagrams"
),
/* for backward compatibility */
SNMP_GEN
(
InUnknownProtos
),
SNMP_GEN
(
InDiscards
),
SNMP_GEN
(
InDelivers
),
SNMP_GEN
(
OutRequests
),
SNMP_GEN
(
OutDiscards
),
SNMP_GEN
(
OutNoRoutes
),
SNMP_GEN
(
ReasmTimeout
),
SNMP_GEN
(
ReasmReqds
),
SNMP_GEN
(
ReasmOKs
),
SNMP_GEN
(
ReasmFails
),
SNMP_GEN
(
FragOKs
),
SNMP_GEN
(
FragFails
),
SNMP_GEN
(
FragCreates
),
SNMP_ITEM_SENTINEL
#undef SNMP_GEN
};
/*
* Called from the PROCfs module. This outputs /proc/net/snmp.
*/
...
...
@@ -113,17 +140,18 @@ static int snmp_seq_show(struct seq_file *seq, void *v)
{
int
i
;
seq_printf
(
seq
,
"Ip: Forwarding DefaultTTL InReceives InHdrErrors "
"InAddrErrors ForwDatagrams InUnknownProtos "
"InDiscards InDelivers OutRequests OutDiscards "
"OutNoRoutes ReasmTimeout ReasmReqds ReasmOKs "
"ReasmFails FragOKs FragFails FragCreates
\n
Ip: %d %d"
,
seq_printf
(
seq
,
"Ip: Forwarding DefaultTTL"
);
for
(
i
=
0
;
snmp4_ipstats_list
[
i
].
name
!=
NULL
;
i
++
)
seq_printf
(
seq
,
" %s"
,
snmp4_ipstats_list
[
i
].
name
);
seq_printf
(
seq
,
"
\n
Ip: %d %d"
,
ipv4_devconf
.
forwarding
?
1
:
2
,
sysctl_ip_default_ttl
);
for
(
i
=
0
;
i
<
offsetof
(
struct
ip_mib
,
__pad
)
/
sizeof
(
unsigned
long
);
i
++
)
for
(
i
=
0
;
snmp4_ipstats_list
[
i
].
name
!=
NULL
;
i
++
)
seq_printf
(
seq
,
" %lu"
,
fold_field
((
void
**
)
ip_statistics
,
i
));
__fold_field
((
void
**
)
ip_statistics
,
snmp4_ipstats_list
[
i
].
offset
));
seq_printf
(
seq
,
"
\n
Icmp: InMsgs InErrors InDestUnreachs InTimeExcds "
"InParmProbs InSrcQuenchs InRedirects InEchos "
...
...
net/ipv4/raw.c
View file @
71d50c2b
...
...
@@ -319,7 +319,7 @@ static int raw_send_hdrinc(struct sock *sk, void *from, int length,
err
=
-
EFAULT
;
kfree_skb
(
skb
);
error:
IP_INC_STATS
(
Ip
OutDiscards
);
IP_INC_STATS
(
OutDiscards
);
return
err
;
}
...
...
net/ipv4/tcp_ipv4.c
View file @
71d50c2b
...
...
@@ -1290,12 +1290,12 @@ static struct dst_entry* tcp_v4_route_req(struct sock *sk,
.
dport
=
req
->
rmt_port
}
}
};
if
(
ip_route_output_flow
(
&
rt
,
&
fl
,
sk
,
0
))
{
IP_INC_STATS_BH
(
Ip
OutNoRoutes
);
IP_INC_STATS_BH
(
OutNoRoutes
);
return
NULL
;
}
if
(
opt
&&
opt
->
is_strictroute
&&
rt
->
rt_dst
!=
rt
->
rt_gateway
)
{
ip_rt_put
(
rt
);
IP_INC_STATS_BH
(
Ip
OutNoRoutes
);
IP_INC_STATS_BH
(
OutNoRoutes
);
return
NULL
;
}
return
&
rt
->
u
.
dst
;
...
...
net/ipv6/af_inet6.c
View file @
71d50c2b
...
...
@@ -667,14 +667,14 @@ snmp6_mib_free(void *ptr[2])
static
int
__init
init_ipv6_mibs
(
void
)
{
if
(
snmp6_mib_init
((
void
**
)
ipv6_statistics
,
sizeof
(
struct
ip
v6
_mib
),
__alignof__
(
struct
ip
v6
_mib
))
<
0
)
if
(
snmp6_mib_init
((
void
**
)
ipv6_statistics
,
sizeof
(
struct
ip
stats
_mib
),
__alignof__
(
struct
ip
stats
_mib
))
<
0
)
goto
err_ip_mib
;
if
(
snmp6_mib_init
((
void
**
)
icmpv6_statistics
,
sizeof
(
struct
icmpv6_mib
),
__alignof__
(
struct
ipv6_mib
))
<
0
)
__alignof__
(
struct
i
cm
pv6_mib
))
<
0
)
goto
err_icmp_mib
;
if
(
snmp6_mib_init
((
void
**
)
udp_stats_in6
,
sizeof
(
struct
udp_mib
),
__alignof__
(
struct
ipv6
_mib
))
<
0
)
__alignof__
(
struct
udp
_mib
))
<
0
)
goto
err_udp_mib
;
return
0
;
...
...
net/ipv6/exthdrs.c
View file @
71d50c2b
...
...
@@ -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
(
I
p6I
nHdrErrors
);
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
(
I
p6I
nHdrErrors
);
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
(
I
p6I
nHdrErrors
);
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
(
I
p6I
nAddrErrors
);
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
(
I
p6I
nHdrErrors
);
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
(
I
p6I
nHdrErrors
);
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
(
I
p6I
nHdrErrors
);
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
(
Ip6
OutDiscards
);
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
(
I
p6I
nAddrErrors
);
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
(
I
p6I
nHdrErrors
);
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
(
I
p6I
nHdrErrors
);
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
(
I
p6I
nHdrErrors
);
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
(
I
p6I
nHdrErrors
);
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
(
I
p6I
nTruncatedPkts
);
IP6_INC_STATS_BH
(
InTruncatedPkts
);
goto
drop
;
}
if
(
pkt_len
+
sizeof
(
struct
ipv6hdr
)
<
skb
->
len
)
{
...
...
net/ipv6/icmp.c
View file @
71d50c2b
...
...
@@ -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
(
Ip6
OutNoRoutes
);
IP6_INC_STATS
(
OutNoRoutes
);
}
else
if
(
dst
->
dev
&&
(
dst
->
dev
->
flags
&
IFF_LOOPBACK
))
{
res
=
1
;
}
else
{
...
...
net/ipv6/ip6_input.c
View file @
71d50c2b
...
...
@@ -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
(
I
p6I
nReceives
);
IP6_INC_STATS_BH
(
InReceives
);
if
((
skb
=
skb_share_check
(
skb
,
GFP_ATOMIC
))
==
NULL
)
{
IP6_INC_STATS_BH
(
I
p6I
nDiscards
);
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
(
I
p6I
nHdrErrors
);
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
(
I
p6I
nHdrErrors
);
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
(
I
p6I
nHdrErrors
);
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
(
I
p6I
nTruncatedPkts
);
IP6_INC_STATS_BH
(
InTruncatedPkts
);
err:
IP6_INC_STATS_BH
(
I
p6I
nHdrErrors
);
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
(
I
p6I
nDelivers
);
IP6_INC_STATS_BH
(
InDelivers
);
}
else
{
if
(
!
raw_sk
)
{
if
(
xfrm6_policy_check
(
NULL
,
XFRM_POLICY_IN
,
skb
))
{
IP6_INC_STATS_BH
(
I
p6I
nUnknownProtos
);
IP6_INC_STATS_BH
(
InUnknownProtos
);
icmpv6_param_prob
(
skb
,
ICMPV6_UNK_NEXTHDR
,
nhoff
);
}
}
else
{
IP6_INC_STATS_BH
(
I
p6I
nDelivers
);
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
(
I
p6I
nDiscards
);
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
(
I
p6I
nMcastPkts
);
IP6_INC_STATS_BH
(
InMcastPkts
);
hdr
=
skb
->
nh
.
ipv6h
;
deliver
=
likely
(
!
(
skb
->
dev
->
flags
&
(
IFF_PROMISC
|
IFF_ALLMULTI
)))
||
...
...
net/ipv6/ip6_output.c
View file @
71d50c2b
...
...
@@ -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
(
Ip6
OutNoRoutes
);
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
(
Ip6
OutDiscards
);
IP6_INC_STATS
(
OutDiscards
);
kfree_skb
(
skb
);
return
0
;
}
}
IP6_INC_STATS
(
Ip6
OutMcastPkts
);
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
(
Ip6
OutNoRoutes
);
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
(
Ip6
OutDiscards
);
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
(
Ip6
OutRequests
);
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
(
Ip6
FragFails
);
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
(
I
p6I
nDiscards
);
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
(
I
p6I
nDiscards
);
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
(
I
p6I
nTooBigErrors
);
IP6_INC_STATS_BH
(
Ip6
FragFails
);
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
(
Ip6
OutDiscards
);
IP6_INC_STATS
(
OutDiscards
);
goto
drop
;
}
...
...
@@ -446,11 +446,11 @@ int ip6_forward(struct sk_buff *skb)
hdr
->
hop_limit
--
;
IP6_INC_STATS_BH
(
Ip6
OutForwDatagrams
);
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
(
I
p6I
nAddrErrors
);
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
(
Ip6
FragFails
);
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
(
Ip6
FragOKs
);
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
(
Ip6
FragFails
);
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
(
Ip6
FragFails
);
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
(
Ip6
FragCreates
);
IP6_INC_STATS
(
FragCreates
);
err
=
output
(
frag
);
if
(
err
)
goto
fail
;
}
kfree_skb
(
skb
);
IP6_INC_STATS
(
Ip6
FragOKs
);
IP6_INC_STATS
(
FragOKs
);
return
err
;
fail:
kfree_skb
(
skb
);
IP6_INC_STATS
(
Ip6
FragFails
);
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
(
Ip6
OutDiscards
);
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
(
Ip6
OutRequests
);
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
(
Ip6
OutDiscards
);
IP6_INC_STATS
(
OutDiscards
);
kfree_skb
(
skb
);
}
...
...
net/ipv6/ipv6_sockglue.c
View file @
71d50c2b
...
...
@@ -55,7 +55,7 @@
#include <asm/uaccess.h>
DEFINE_SNMP_STAT
(
struct
ip
v6
_mib
,
ipv6_statistics
);
DEFINE_SNMP_STAT
(
struct
ip
stats
_mib
,
ipv6_statistics
);
static
struct
packet_type
ipv6_packet_type
=
{
.
type
=
__constant_htons
(
ETH_P_IPV6
),
...
...
net/ipv6/mcast.c
View file @
71d50c2b
...
...
@@ -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
(
Ip6
OutRequests
);
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
(
Ip6
OutMcastPkts
);
IP6_INC_STATS
(
OutMcastPkts
);
}
else
IP6_INC_STATS
(
Ip6
OutDiscards
);
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
(
Ip6
OutRequests
);
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
(
Ip6
OutDiscards
);
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
(
Ip6
OutMcastPkts
);
IP6_INC_STATS
(
OutMcastPkts
);
}
else
IP6_INC_STATS
(
Ip6
OutDiscards
);
IP6_INC_STATS
(
OutDiscards
);
if
(
likely
(
idev
!=
NULL
))
in6_dev_put
(
idev
);
return
;
out:
IP6_INC_STATS
(
Ip6
OutDiscards
);
IP6_INC_STATS
(
OutDiscards
);
kfree_skb
(
skb
);
}
...
...
net/ipv6/ndisc.c
View file @
71d50c2b
...
...
@@ -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
(
Ip6
OutRequests
);
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
(
Ip6
OutRequests
);
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
(
Ip6
OutRequests
);
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
(
Ip6
OutRequests
);
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
);
...
...
net/ipv6/proc.c
View file @
71d50c2b
...
...
@@ -57,43 +57,36 @@ static int sockstat6_seq_show(struct seq_file *seq, void *v)
return
0
;
}
struct
snmp6_item
{
char
*
name
;
int
offset
;
};
#define SNMP6_SENTINEL { .name = NULL, .offset = 0 }
static
struct
snmp6_item
snmp6_ipv6_list
[]
=
{
static
struct
snmp_item
snmp6_ipstats_list
[]
=
{
/* ipv6 mib according to RFC 2465 */
#define SNMP6_GEN(x)
{ .name = #x , .offset = offsetof(struct ipv6_mib, x) }
SNMP6_GEN
(
I
p6I
nReceives
),
SNMP6_GEN
(
I
p6I
nHdrErrors
),
SNMP6_GEN
(
I
p6I
nTooBigErrors
),
SNMP6_GEN
(
I
p6I
nNoRoutes
),
SNMP6_GEN
(
I
p6I
nAddrErrors
),
SNMP6_GEN
(
I
p6I
nUnknownProtos
),
SNMP6_GEN
(
I
p6I
nTruncatedPkts
),
SNMP6_GEN
(
I
p6I
nDiscards
),
SNMP6_GEN
(
I
p6I
nDelivers
),
SNMP6_GEN
(
Ip6
OutForwDatagrams
),
SNMP6_GEN
(
Ip6
OutRequests
),
SNMP6_GEN
(
Ip6
OutDiscards
),
SNMP6_GEN
(
Ip6
OutNoRoutes
),
SNMP6_GEN
(
Ip6
ReasmTimeout
),
SNMP6_GEN
(
Ip6
ReasmReqds
),
SNMP6_GEN
(
Ip6
ReasmOKs
),
SNMP6_GEN
(
Ip6
ReasmFails
),
SNMP6_GEN
(
Ip6
FragOKs
),
SNMP6_GEN
(
Ip6
FragFails
),
SNMP6_GEN
(
Ip6
FragCreates
),
SNMP6_GEN
(
I
p6I
nMcastPkts
),
SNMP6_GEN
(
Ip6
OutMcastPkts
),
#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
6
_SENTINEL
SNMP
_ITEM
_SENTINEL
};
static
struct
snmp
6
_item
snmp6_icmp6_list
[]
=
{
static
struct
snmp_item
snmp6_icmp6_list
[]
=
{
/* icmpv6 mib according to RFC 2466
Exceptions: {In|Out}AdminProhibs are removed, because I see
...
...
@@ -104,7 +97,7 @@ static struct snmp6_item snmp6_icmp6_list[] = {
OutRouterAdvertisements too.
OutGroupMembQueries too.
*/
#define SNMP6_GEN(x)
{ .name = #x , .offset = offsetof(struct icmpv6_mib, x) }
#define SNMP6_GEN(x)
SNMP_ITEM(struct icmpv6_mib, x, #x)
SNMP6_GEN
(
Icmp6InMsgs
),
SNMP6_GEN
(
Icmp6InErrors
),
SNMP6_GEN
(
Icmp6InDestUnreachs
),
...
...
@@ -134,17 +127,17 @@ static struct snmp6_item snmp6_icmp6_list[] = {
SNMP6_GEN
(
Icmp6OutGroupMembResponses
),
SNMP6_GEN
(
Icmp6OutGroupMembReductions
),
#undef SNMP6_GEN
SNMP
6
_SENTINEL
SNMP
_ITEM
_SENTINEL
};
static
struct
snmp
6
_item
snmp6_udp6_list
[]
=
{
#define SNMP6_GEN(x)
{ .name = "Udp6" #x , .offset = offsetof(struct udp_mib, Udp##x) }
static
struct
snmp_item
snmp6_udp6_list
[]
=
{
#define SNMP6_GEN(x)
SNMP_ITEM(struct udp_mib, Udp##x, "Udp6" #x)
SNMP6_GEN
(
InDatagrams
),
SNMP6_GEN
(
NoPorts
),
SNMP6_GEN
(
InErrors
),
SNMP6_GEN
(
OutDatagrams
),
#undef SNMP6_GEN
SNMP
6
_SENTINEL
SNMP
_ITEM
_SENTINEL
};
static
unsigned
long
...
...
@@ -167,7 +160,7 @@ fold_field(void *mib[], int offt)
}
static
inline
void
snmp6_seq_show_item
(
struct
seq_file
*
seq
,
void
**
mib
,
struct
snmp
6
_item
*
itemlist
)
snmp6_seq_show_item
(
struct
seq_file
*
seq
,
void
**
mib
,
struct
snmp_item
*
itemlist
)
{
int
i
;
for
(
i
=
0
;
itemlist
[
i
].
name
;
i
++
)
...
...
@@ -183,7 +176,7 @@ static int snmp6_seq_show(struct seq_file *seq, void *v)
seq_printf
(
seq
,
"%-32s
\t
%u
\n
"
,
"ifIndex"
,
idev
->
dev
->
ifindex
);
snmp6_seq_show_item
(
seq
,
(
void
**
)
idev
->
stats
.
icmpv6
,
snmp6_icmp6_list
);
}
else
{
snmp6_seq_show_item
(
seq
,
(
void
**
)
ipv6_statistics
,
snmp6_ip
v6
_list
);
snmp6_seq_show_item
(
seq
,
(
void
**
)
ipv6_statistics
,
snmp6_ip
stats
_list
);
snmp6_seq_show_item
(
seq
,
(
void
**
)
icmpv6_statistics
,
snmp6_icmp6_list
);
snmp6_seq_show_item
(
seq
,
(
void
**
)
udp_stats_in6
,
snmp6_udp6_list
);
}
...
...
net/ipv6/raw.c
View file @
71d50c2b
...
...
@@ -535,7 +535,7 @@ static int rawv6_send_hdrinc(struct sock *sk, void *from, int length,
if
(
err
)
goto
error_fault
;
IP6_INC_STATS
(
Ip6
OutRequests
);
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
(
Ip6
OutDiscards
);
IP6_INC_STATS
(
OutDiscards
);
return
err
;
}
static
int
rawv6_sendmsg
(
struct
kiocb
*
iocb
,
struct
sock
*
sk
,
...
...
net/ipv6/reassembly.c
View file @
71d50c2b
...
...
@@ -284,7 +284,7 @@ static void ip6_evictor(void)
spin_unlock
(
&
fq
->
lock
);
fq_put
(
fq
);
IP6_INC_STATS_BH
(
Ip6
ReasmFails
);
IP6_INC_STATS_BH
(
ReasmFails
);
}
}
...
...
@@ -299,8 +299,8 @@ static void ip6_frag_expire(unsigned long data)
fq_kill
(
fq
);
IP6_INC_STATS_BH
(
Ip6
ReasmTimeout
);
IP6_INC_STATS_BH
(
Ip6
ReasmFails
);
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
(
Ip6
ReasmFails
);
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
(
I
p6I
nHdrErrors
);
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
(
I
p6I
nHdrErrors
);
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
(
Ip6
ReasmFails
);
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
(
Ip6
ReasmOKs
);
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
(
Ip6
ReasmFails
);
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
(
Ip6
ReasmReqds
);
IP6_INC_STATS_BH
(
ReasmReqds
);
/* Jumbo payload inhibits frag. header */
if
(
hdr
->
payload_len
==
0
)
{
IP6_INC_STATS
(
I
p6I
nHdrErrors
);
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
(
I
p6I
nHdrErrors
);
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
(
Ip6
ReasmOKs
);
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
(
Ip6
ReasmFails
);
IP6_INC_STATS_BH
(
ReasmFails
);
kfree_skb
(
skb
);
return
-
1
;
}
...
...
net/ipv6/route.c
View file @
71d50c2b
...
...
@@ -1272,7 +1272,7 @@ int ipv6_route_ioctl(unsigned int cmd, void __user *arg)
int
ip6_pkt_discard
(
struct
sk_buff
*
skb
)
{
IP6_INC_STATS
(
Ip6
OutNoRoutes
);
IP6_INC_STATS
(
OutNoRoutes
);
icmpv6_send
(
skb
,
ICMPV6_DEST_UNREACH
,
ICMPV6_NOROUTE
,
0
,
skb
->
dev
);
kfree_skb
(
skb
);
return
0
;
...
...
net/sctp/output.c
View file @
71d50c2b
...
...
@@ -496,7 +496,7 @@ int sctp_packet_transmit(struct sctp_packet *packet)
return
err
;
no_route:
kfree_skb
(
nskb
);
IP_INC_STATS_BH
(
Ip
OutNoRoutes
);
IP_INC_STATS_BH
(
OutNoRoutes
);
/* FIXME: Returning the 'err' will effect all the associations
* associated with a socket, although only one of the paths of the
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment