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
058caf45
Commit
058caf45
authored
Jun 02, 2004
by
Hideaki Yoshifuji
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPV{4,6}] introduce ip-independent ipstats_mib based on ipv6_mib.
parent
6e934547
Changes
14
Hide whitespace changes
Inline
Side-by-side
Showing
14 changed files
with
131 additions
and
130 deletions
+131
-130
include/net/ipv6.h
include/net/ipv6.h
+1
-1
include/net/snmp.h
include/net/snmp.h
+24
-23
net/ipv6/af_inet6.c
net/ipv6/af_inet6.c
+2
-2
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
+23
-23
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
No files found.
include/net/ipv6.h
View file @
058caf45
...
@@ -111,7 +111,7 @@ extern int sysctl_ipv6_bindv6only;
...
@@ -111,7 +111,7 @@ extern int sysctl_ipv6_bindv6only;
extern
int
sysctl_mld_max_msf
;
extern
int
sysctl_mld_max_msf
;
/* MIBs */
/* 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(field) SNMP_INC_STATS(ipv6_statistics, field)
#define IP6_INC_STATS_BH(field) SNMP_INC_STATS_BH(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)
#define IP6_INC_STATS_USER(field) SNMP_INC_STATS_USER(ipv6_statistics, field)
...
...
include/net/snmp.h
View file @
058caf45
...
@@ -85,31 +85,32 @@ struct ip_mib
...
@@ -85,31 +85,32 @@ struct ip_mib
/*
/*
* RFC 2465: IPv6 MIB: General Group
* 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
InReceives
;
unsigned
long
I
p6I
nHdrErrors
;
unsigned
long
InHdrErrors
;
unsigned
long
I
p6I
nTooBigErrors
;
unsigned
long
InTooBigErrors
;
unsigned
long
I
p6I
nNoRoutes
;
unsigned
long
InNoRoutes
;
unsigned
long
I
p6I
nAddrErrors
;
unsigned
long
InAddrErrors
;
unsigned
long
I
p6I
nUnknownProtos
;
unsigned
long
InUnknownProtos
;
unsigned
long
I
p6I
nTruncatedPkts
;
unsigned
long
InTruncatedPkts
;
unsigned
long
I
p6I
nDiscards
;
unsigned
long
InDiscards
;
unsigned
long
I
p6I
nDelivers
;
unsigned
long
InDelivers
;
unsigned
long
Ip6
OutForwDatagrams
;
unsigned
long
OutForwDatagrams
;
unsigned
long
Ip6
OutRequests
;
unsigned
long
OutRequests
;
unsigned
long
Ip6
OutDiscards
;
unsigned
long
OutDiscards
;
unsigned
long
Ip6
OutNoRoutes
;
unsigned
long
OutNoRoutes
;
unsigned
long
Ip6
ReasmTimeout
;
unsigned
long
ReasmTimeout
;
unsigned
long
Ip6
ReasmReqds
;
unsigned
long
ReasmReqds
;
unsigned
long
Ip6
ReasmOKs
;
unsigned
long
ReasmOKs
;
unsigned
long
Ip6
ReasmFails
;
unsigned
long
ReasmFails
;
unsigned
long
Ip6
FragOKs
;
unsigned
long
FragOKs
;
unsigned
long
Ip6
FragFails
;
unsigned
long
FragFails
;
unsigned
long
Ip6
FragCreates
;
unsigned
long
FragCreates
;
unsigned
long
I
p6I
nMcastPkts
;
unsigned
long
InMcastPkts
;
unsigned
long
Ip6
OutMcastPkts
;
unsigned
long
OutMcastPkts
;
unsigned
long
__pad
[
0
];
unsigned
long
__pad
[
0
];
};
};
...
...
net/ipv6/af_inet6.c
View file @
058caf45
...
@@ -667,8 +667,8 @@ snmp6_mib_free(void *ptr[2])
...
@@ -667,8 +667,8 @@ snmp6_mib_free(void *ptr[2])
static
int
__init
init_ipv6_mibs
(
void
)
static
int
__init
init_ipv6_mibs
(
void
)
{
{
if
(
snmp6_mib_init
((
void
**
)
ipv6_statistics
,
sizeof
(
struct
ip
v6
_mib
),
if
(
snmp6_mib_init
((
void
**
)
ipv6_statistics
,
sizeof
(
struct
ip
stats
_mib
),
__alignof__
(
struct
ip
v6
_mib
))
<
0
)
__alignof__
(
struct
ip
stats
_mib
))
<
0
)
goto
err_ip_mib
;
goto
err_ip_mib
;
if
(
snmp6_mib_init
((
void
**
)
icmpv6_statistics
,
sizeof
(
struct
icmpv6_mib
),
if
(
snmp6_mib_init
((
void
**
)
icmpv6_statistics
,
sizeof
(
struct
icmpv6_mib
),
__alignof__
(
struct
icmpv6_mib
))
<
0
)
__alignof__
(
struct
icmpv6_mib
))
<
0
)
...
...
net/ipv6/exthdrs.c
View file @
058caf45
...
@@ -159,7 +159,7 @@ static int ipv6_destopt_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
...
@@ -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
)
||
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
)))
{
!
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
);
kfree_skb
(
skb
);
return
-
1
;
return
-
1
;
}
}
...
@@ -172,7 +172,7 @@ static int ipv6_destopt_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
...
@@ -172,7 +172,7 @@ static int ipv6_destopt_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
return
1
;
return
1
;
}
}
IP6_INC_STATS_BH
(
I
p6I
nHdrErrors
);
IP6_INC_STATS_BH
(
InHdrErrors
);
return
-
1
;
return
-
1
;
}
}
...
@@ -227,7 +227,7 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
...
@@ -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
)
||
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
)))
{
!
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
);
kfree_skb
(
skb
);
return
-
1
;
return
-
1
;
}
}
...
@@ -236,7 +236,7 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
...
@@ -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
)
||
if
(
ipv6_addr_is_multicast
(
&
skb
->
nh
.
ipv6h
->
daddr
)
||
skb
->
pkt_type
!=
PACKET_HOST
)
{
skb
->
pkt_type
!=
PACKET_HOST
)
{
IP6_INC_STATS_BH
(
I
p6I
nAddrErrors
);
IP6_INC_STATS_BH
(
InAddrErrors
);
kfree_skb
(
skb
);
kfree_skb
(
skb
);
return
-
1
;
return
-
1
;
}
}
...
@@ -252,13 +252,13 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
...
@@ -252,13 +252,13 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
}
}
if
(
hdr
->
type
!=
IPV6_SRCRT_TYPE_0
)
{
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
);
icmpv6_param_prob
(
skb
,
ICMPV6_HDR_FIELD
,
(
&
hdr
->
type
)
-
skb
->
nh
.
raw
);
return
-
1
;
return
-
1
;
}
}
if
(
hdr
->
hdrlen
&
0x01
)
{
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
);
icmpv6_param_prob
(
skb
,
ICMPV6_HDR_FIELD
,
(
&
hdr
->
hdrlen
)
-
skb
->
nh
.
raw
);
return
-
1
;
return
-
1
;
}
}
...
@@ -271,7 +271,7 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
...
@@ -271,7 +271,7 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
n
=
hdr
->
hdrlen
>>
1
;
n
=
hdr
->
hdrlen
>>
1
;
if
(
hdr
->
segments_left
>
n
)
{
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
);
icmpv6_param_prob
(
skb
,
ICMPV6_HDR_FIELD
,
(
&
hdr
->
segments_left
)
-
skb
->
nh
.
raw
);
return
-
1
;
return
-
1
;
}
}
...
@@ -284,7 +284,7 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
...
@@ -284,7 +284,7 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
kfree_skb
(
skb
);
kfree_skb
(
skb
);
/* the copy is a forwarded packet */
/* the copy is a forwarded packet */
if
(
skb2
==
NULL
)
{
if
(
skb2
==
NULL
)
{
IP6_INC_STATS_BH
(
Ip6
OutDiscards
);
IP6_INC_STATS_BH
(
OutDiscards
);
return
-
1
;
return
-
1
;
}
}
*
skbp
=
skb
=
skb2
;
*
skbp
=
skb
=
skb2
;
...
@@ -302,7 +302,7 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
...
@@ -302,7 +302,7 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
addr
+=
i
-
1
;
addr
+=
i
-
1
;
if
(
ipv6_addr_is_multicast
(
addr
))
{
if
(
ipv6_addr_is_multicast
(
addr
))
{
IP6_INC_STATS_BH
(
I
p6I
nAddrErrors
);
IP6_INC_STATS_BH
(
InAddrErrors
);
kfree_skb
(
skb
);
kfree_skb
(
skb
);
return
-
1
;
return
-
1
;
}
}
...
@@ -319,7 +319,7 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
...
@@ -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
->
dst
->
dev
->
flags
&
IFF_LOOPBACK
)
{
if
(
skb
->
nh
.
ipv6h
->
hop_limit
<=
1
)
{
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
,
icmpv6_send
(
skb
,
ICMPV6_TIME_EXCEED
,
ICMPV6_EXC_HOPLIMIT
,
0
,
skb
->
dev
);
0
,
skb
->
dev
);
kfree_skb
(
skb
);
kfree_skb
(
skb
);
...
@@ -436,24 +436,24 @@ static int ipv6_hop_jumbo(struct sk_buff *skb, int optoff)
...
@@ -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
)
{
if
(
skb
->
nh
.
raw
[
optoff
+
1
]
!=
4
||
(
optoff
&
3
)
!=
2
)
{
LIMIT_NETDEBUG
(
LIMIT_NETDEBUG
(
printk
(
KERN_DEBUG
"ipv6_hop_jumbo: wrong jumbo opt length/alignment %d
\n
"
,
skb
->
nh
.
raw
[
optoff
+
1
]));
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
;
goto
drop
;
}
}
pkt_len
=
ntohl
(
*
(
u32
*
)(
skb
->
nh
.
raw
+
optoff
+
2
));
pkt_len
=
ntohl
(
*
(
u32
*
)(
skb
->
nh
.
raw
+
optoff
+
2
));
if
(
pkt_len
<=
IPV6_MAXPLEN
)
{
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
);
icmpv6_param_prob
(
skb
,
ICMPV6_HDR_FIELD
,
optoff
+
2
);
return
0
;
return
0
;
}
}
if
(
skb
->
nh
.
ipv6h
->
payload_len
)
{
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
);
icmpv6_param_prob
(
skb
,
ICMPV6_HDR_FIELD
,
optoff
);
return
0
;
return
0
;
}
}
if
(
pkt_len
>
skb
->
len
-
sizeof
(
struct
ipv6hdr
))
{
if
(
pkt_len
>
skb
->
len
-
sizeof
(
struct
ipv6hdr
))
{
IP6_INC_STATS_BH
(
I
p6I
nTruncatedPkts
);
IP6_INC_STATS_BH
(
InTruncatedPkts
);
goto
drop
;
goto
drop
;
}
}
if
(
pkt_len
+
sizeof
(
struct
ipv6hdr
)
<
skb
->
len
)
{
if
(
pkt_len
+
sizeof
(
struct
ipv6hdr
)
<
skb
->
len
)
{
...
...
net/ipv6/icmp.c
View file @
058caf45
...
@@ -174,7 +174,7 @@ static inline int icmpv6_xrlim_allow(struct sock *sk, int type,
...
@@ -174,7 +174,7 @@ static inline int icmpv6_xrlim_allow(struct sock *sk, int type,
*/
*/
dst
=
ip6_route_output
(
sk
,
fl
);
dst
=
ip6_route_output
(
sk
,
fl
);
if
(
dst
->
error
)
{
if
(
dst
->
error
)
{
IP6_INC_STATS
(
Ip6
OutNoRoutes
);
IP6_INC_STATS
(
OutNoRoutes
);
}
else
if
(
dst
->
dev
&&
(
dst
->
dev
->
flags
&
IFF_LOOPBACK
))
{
}
else
if
(
dst
->
dev
&&
(
dst
->
dev
->
flags
&
IFF_LOOPBACK
))
{
res
=
1
;
res
=
1
;
}
else
{
}
else
{
...
...
net/ipv6/ip6_input.c
View file @
058caf45
...
@@ -64,10 +64,10 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
...
@@ -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
)
if
(
skb
->
pkt_type
==
PACKET_OTHERHOST
)
goto
drop
;
goto
drop
;
IP6_INC_STATS_BH
(
I
p6I
nReceives
);
IP6_INC_STATS_BH
(
InReceives
);
if
((
skb
=
skb_share_check
(
skb
,
GFP_ATOMIC
))
==
NULL
)
{
if
((
skb
=
skb_share_check
(
skb
,
GFP_ATOMIC
))
==
NULL
)
{
IP6_INC_STATS_BH
(
I
p6I
nDiscards
);
IP6_INC_STATS_BH
(
InDiscards
);
goto
out
;
goto
out
;
}
}
...
@@ -80,7 +80,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
...
@@ -80,7 +80,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
goto
err
;
goto
err
;
if
(
!
pskb_may_pull
(
skb
,
sizeof
(
struct
ipv6hdr
)))
{
if
(
!
pskb_may_pull
(
skb
,
sizeof
(
struct
ipv6hdr
)))
{
IP6_INC_STATS_BH
(
I
p6I
nHdrErrors
);
IP6_INC_STATS_BH
(
InHdrErrors
);
goto
drop
;
goto
drop
;
}
}
...
@@ -97,7 +97,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
...
@@ -97,7 +97,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
goto
truncated
;
goto
truncated
;
if
(
pkt_len
+
sizeof
(
struct
ipv6hdr
)
<
skb
->
len
)
{
if
(
pkt_len
+
sizeof
(
struct
ipv6hdr
)
<
skb
->
len
)
{
if
(
__pskb_trim
(
skb
,
pkt_len
+
sizeof
(
struct
ipv6hdr
))){
if
(
__pskb_trim
(
skb
,
pkt_len
+
sizeof
(
struct
ipv6hdr
))){
IP6_INC_STATS_BH
(
I
p6I
nHdrErrors
);
IP6_INC_STATS_BH
(
InHdrErrors
);
goto
drop
;
goto
drop
;
}
}
hdr
=
skb
->
nh
.
ipv6h
;
hdr
=
skb
->
nh
.
ipv6h
;
...
@@ -109,7 +109,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
...
@@ -109,7 +109,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
if
(
hdr
->
nexthdr
==
NEXTHDR_HOP
)
{
if
(
hdr
->
nexthdr
==
NEXTHDR_HOP
)
{
skb
->
h
.
raw
=
(
u8
*
)(
hdr
+
1
);
skb
->
h
.
raw
=
(
u8
*
)(
hdr
+
1
);
if
(
ipv6_parse_hopopts
(
skb
,
offsetof
(
struct
ipv6hdr
,
nexthdr
))
<
0
)
{
if
(
ipv6_parse_hopopts
(
skb
,
offsetof
(
struct
ipv6hdr
,
nexthdr
))
<
0
)
{
IP6_INC_STATS_BH
(
I
p6I
nHdrErrors
);
IP6_INC_STATS_BH
(
InHdrErrors
);
return
0
;
return
0
;
}
}
hdr
=
skb
->
nh
.
ipv6h
;
hdr
=
skb
->
nh
.
ipv6h
;
...
@@ -117,9 +117,9 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
...
@@ -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
);
return
NF_HOOK
(
PF_INET6
,
NF_IP6_PRE_ROUTING
,
skb
,
dev
,
NULL
,
ip6_rcv_finish
);
truncated:
truncated:
IP6_INC_STATS_BH
(
I
p6I
nTruncatedPkts
);
IP6_INC_STATS_BH
(
InTruncatedPkts
);
err:
err:
IP6_INC_STATS_BH
(
I
p6I
nHdrErrors
);
IP6_INC_STATS_BH
(
InHdrErrors
);
drop:
drop:
kfree_skb
(
skb
);
kfree_skb
(
skb
);
out:
out:
...
@@ -194,15 +194,15 @@ static inline int ip6_input_finish(struct sk_buff *skb)
...
@@ -194,15 +194,15 @@ static inline int ip6_input_finish(struct sk_buff *skb)
if
(
ret
>
0
)
if
(
ret
>
0
)
goto
resubmit
;
goto
resubmit
;
else
if
(
ret
==
0
)
else
if
(
ret
==
0
)
IP6_INC_STATS_BH
(
I
p6I
nDelivers
);
IP6_INC_STATS_BH
(
InDelivers
);
}
else
{
}
else
{
if
(
!
raw_sk
)
{
if
(
!
raw_sk
)
{
if
(
xfrm6_policy_check
(
NULL
,
XFRM_POLICY_IN
,
skb
))
{
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
);
icmpv6_param_prob
(
skb
,
ICMPV6_UNK_NEXTHDR
,
nhoff
);
}
}
}
else
{
}
else
{
IP6_INC_STATS_BH
(
I
p6I
nDelivers
);
IP6_INC_STATS_BH
(
InDelivers
);
kfree_skb
(
skb
);
kfree_skb
(
skb
);
}
}
}
}
...
@@ -210,7 +210,7 @@ static inline int ip6_input_finish(struct sk_buff *skb)
...
@@ -210,7 +210,7 @@ static inline int ip6_input_finish(struct sk_buff *skb)
return
0
;
return
0
;
discard:
discard:
IP6_INC_STATS_BH
(
I
p6I
nDiscards
);
IP6_INC_STATS_BH
(
InDiscards
);
rcu_read_unlock
();
rcu_read_unlock
();
kfree_skb
(
skb
);
kfree_skb
(
skb
);
return
0
;
return
0
;
...
@@ -227,7 +227,7 @@ int ip6_mc_input(struct sk_buff *skb)
...
@@ -227,7 +227,7 @@ int ip6_mc_input(struct sk_buff *skb)
struct
ipv6hdr
*
hdr
;
struct
ipv6hdr
*
hdr
;
int
deliver
;
int
deliver
;
IP6_INC_STATS_BH
(
I
p6I
nMcastPkts
);
IP6_INC_STATS_BH
(
InMcastPkts
);
hdr
=
skb
->
nh
.
ipv6h
;
hdr
=
skb
->
nh
.
ipv6h
;
deliver
=
likely
(
!
(
skb
->
dev
->
flags
&
(
IFF_PROMISC
|
IFF_ALLMULTI
)))
||
deliver
=
likely
(
!
(
skb
->
dev
->
flags
&
(
IFF_PROMISC
|
IFF_ALLMULTI
)))
||
...
...
net/ipv6/ip6_output.c
View file @
058caf45
...
@@ -87,7 +87,7 @@ static inline int ip6_output_finish(struct sk_buff *skb)
...
@@ -87,7 +87,7 @@ static inline int ip6_output_finish(struct sk_buff *skb)
}
else
if
(
dst
->
neighbour
)
}
else
if
(
dst
->
neighbour
)
return
dst
->
neighbour
->
output
(
skb
);
return
dst
->
neighbour
->
output
(
skb
);
IP6_INC_STATS_BH
(
Ip6
OutNoRoutes
);
IP6_INC_STATS_BH
(
OutNoRoutes
);
kfree_skb
(
skb
);
kfree_skb
(
skb
);
return
-
EINVAL
;
return
-
EINVAL
;
...
@@ -132,13 +132,13 @@ int ip6_output2(struct sk_buff *skb)
...
@@ -132,13 +132,13 @@ int ip6_output2(struct sk_buff *skb)
ip6_dev_loopback_xmit
);
ip6_dev_loopback_xmit
);
if
(
skb
->
nh
.
ipv6h
->
hop_limit
==
0
)
{
if
(
skb
->
nh
.
ipv6h
->
hop_limit
==
0
)
{
IP6_INC_STATS
(
Ip6
OutDiscards
);
IP6_INC_STATS
(
OutDiscards
);
kfree_skb
(
skb
);
kfree_skb
(
skb
);
return
0
;
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
);
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)
...
@@ -169,7 +169,7 @@ int ip6_route_me_harder(struct sk_buff *skb)
dst
=
ip6_route_output
(
skb
->
sk
,
&
fl
);
dst
=
ip6_route_output
(
skb
->
sk
,
&
fl
);
if
(
dst
->
error
)
{
if
(
dst
->
error
)
{
IP6_INC_STATS
(
Ip6
OutNoRoutes
);
IP6_INC_STATS
(
OutNoRoutes
);
LIMIT_NETDEBUG
(
LIMIT_NETDEBUG
(
printk
(
KERN_DEBUG
"ip6_route_me_harder: No more route.
\n
"
));
printk
(
KERN_DEBUG
"ip6_route_me_harder: No more route.
\n
"
));
dst_release
(
dst
);
dst_release
(
dst
);
...
@@ -228,7 +228,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
...
@@ -228,7 +228,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
kfree_skb
(
skb
);
kfree_skb
(
skb
);
skb
=
skb2
;
skb
=
skb2
;
if
(
skb
==
NULL
)
{
if
(
skb
==
NULL
)
{
IP6_INC_STATS
(
Ip6
OutDiscards
);
IP6_INC_STATS
(
OutDiscards
);
return
-
ENOBUFS
;
return
-
ENOBUFS
;
}
}
if
(
sk
)
if
(
sk
)
...
@@ -262,7 +262,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
...
@@ -262,7 +262,7 @@ int ip6_xmit(struct sock *sk, struct sk_buff *skb, struct flowi *fl,
mtu
=
dst_pmtu
(
dst
);
mtu
=
dst_pmtu
(
dst
);
if
((
skb
->
len
<=
mtu
)
||
ipfragok
)
{
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
);
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,
...
@@ -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
"
);
printk
(
KERN_DEBUG
"IPv6: sending pkt_too_big to self
\n
"
);
skb
->
dev
=
dst
->
dev
;
skb
->
dev
=
dst
->
dev
;
icmpv6_send
(
skb
,
ICMPV6_PKT_TOOBIG
,
0
,
mtu
,
skb
->
dev
);
icmpv6_send
(
skb
,
ICMPV6_PKT_TOOBIG
,
0
,
mtu
,
skb
->
dev
);
IP6_INC_STATS
(
Ip6
FragFails
);
IP6_INC_STATS
(
FragFails
);
kfree_skb
(
skb
);
kfree_skb
(
skb
);
return
-
EMSGSIZE
;
return
-
EMSGSIZE
;
}
}
...
@@ -352,7 +352,7 @@ int ip6_forward(struct sk_buff *skb)
...
@@ -352,7 +352,7 @@ int ip6_forward(struct sk_buff *skb)
goto
error
;
goto
error
;
if
(
!
xfrm6_policy_check
(
NULL
,
XFRM_POLICY_FWD
,
skb
))
{
if
(
!
xfrm6_policy_check
(
NULL
,
XFRM_POLICY_FWD
,
skb
))
{
IP6_INC_STATS
(
I
p6I
nDiscards
);
IP6_INC_STATS
(
InDiscards
);
goto
drop
;
goto
drop
;
}
}
...
@@ -391,7 +391,7 @@ int ip6_forward(struct sk_buff *skb)
...
@@ -391,7 +391,7 @@ int ip6_forward(struct sk_buff *skb)
}
}
if
(
!
xfrm6_route_forward
(
skb
))
{
if
(
!
xfrm6_route_forward
(
skb
))
{
IP6_INC_STATS
(
I
p6I
nDiscards
);
IP6_INC_STATS
(
InDiscards
);
goto
drop
;
goto
drop
;
}
}
...
@@ -429,14 +429,14 @@ int ip6_forward(struct sk_buff *skb)
...
@@ -429,14 +429,14 @@ int ip6_forward(struct sk_buff *skb)
/* Again, force OUTPUT device used as source address */
/* Again, force OUTPUT device used as source address */
skb
->
dev
=
dst
->
dev
;
skb
->
dev
=
dst
->
dev
;
icmpv6_send
(
skb
,
ICMPV6_PKT_TOOBIG
,
0
,
dst_pmtu
(
dst
),
skb
->
dev
);
icmpv6_send
(
skb
,
ICMPV6_PKT_TOOBIG
,
0
,
dst_pmtu
(
dst
),
skb
->
dev
);
IP6_INC_STATS_BH
(
I
p6I
nTooBigErrors
);
IP6_INC_STATS_BH
(
InTooBigErrors
);
IP6_INC_STATS_BH
(
Ip6
FragFails
);
IP6_INC_STATS_BH
(
FragFails
);
kfree_skb
(
skb
);
kfree_skb
(
skb
);
return
-
EMSGSIZE
;
return
-
EMSGSIZE
;
}
}
if
(
skb_cow
(
skb
,
dst
->
dev
->
hard_header_len
))
{
if
(
skb_cow
(
skb
,
dst
->
dev
->
hard_header_len
))
{
IP6_INC_STATS
(
Ip6
OutDiscards
);
IP6_INC_STATS
(
OutDiscards
);
goto
drop
;
goto
drop
;
}
}
...
@@ -446,11 +446,11 @@ int ip6_forward(struct sk_buff *skb)
...
@@ -446,11 +446,11 @@ int ip6_forward(struct sk_buff *skb)
hdr
->
hop_limit
--
;
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
);
return
NF_HOOK
(
PF_INET6
,
NF_IP6_FORWARD
,
skb
,
skb
->
dev
,
dst
->
dev
,
ip6_forward_finish
);
error:
error:
IP6_INC_STATS_BH
(
I
p6I
nAddrErrors
);
IP6_INC_STATS_BH
(
InAddrErrors
);
drop:
drop:
kfree_skb
(
skb
);
kfree_skb
(
skb
);
return
-
EINVAL
;
return
-
EINVAL
;
...
@@ -563,7 +563,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
...
@@ -563,7 +563,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
tmp_hdr
=
kmalloc
(
hlen
,
GFP_ATOMIC
);
tmp_hdr
=
kmalloc
(
hlen
,
GFP_ATOMIC
);
if
(
!
tmp_hdr
)
{
if
(
!
tmp_hdr
)
{
IP6_INC_STATS
(
Ip6
FragFails
);
IP6_INC_STATS
(
FragFails
);
return
-
ENOMEM
;
return
-
ENOMEM
;
}
}
...
@@ -618,7 +618,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
...
@@ -618,7 +618,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
kfree
(
tmp_hdr
);
kfree
(
tmp_hdr
);
if
(
err
==
0
)
{
if
(
err
==
0
)
{
IP6_INC_STATS
(
Ip6
FragOKs
);
IP6_INC_STATS
(
FragOKs
);
return
0
;
return
0
;
}
}
...
@@ -628,7 +628,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
...
@@ -628,7 +628,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
frag
=
skb
;
frag
=
skb
;
}
}
IP6_INC_STATS
(
Ip6
FragFails
);
IP6_INC_STATS
(
FragFails
);
return
err
;
return
err
;
}
}
...
@@ -661,7 +661,7 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
...
@@ -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
)
{
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
"
));
NETDEBUG
(
printk
(
KERN_INFO
"IPv6: frag: no memory for new fragment!
\n
"
));
IP6_INC_STATS
(
Ip6
FragFails
);
IP6_INC_STATS
(
FragFails
);
err
=
-
ENOMEM
;
err
=
-
ENOMEM
;
goto
fail
;
goto
fail
;
}
}
...
@@ -719,19 +719,19 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
...
@@ -719,19 +719,19 @@ static int ip6_fragment(struct sk_buff *skb, int (*output)(struct sk_buff*))
* Put this fragment into the sending queue.
* Put this fragment into the sending queue.
*/
*/
IP6_INC_STATS
(
Ip6
FragCreates
);
IP6_INC_STATS
(
FragCreates
);
err
=
output
(
frag
);
err
=
output
(
frag
);
if
(
err
)
if
(
err
)
goto
fail
;
goto
fail
;
}
}
kfree_skb
(
skb
);
kfree_skb
(
skb
);
IP6_INC_STATS
(
Ip6
FragOKs
);
IP6_INC_STATS
(
FragOKs
);
return
err
;
return
err
;
fail:
fail:
kfree_skb
(
skb
);
kfree_skb
(
skb
);
IP6_INC_STATS
(
Ip6
FragFails
);
IP6_INC_STATS
(
FragFails
);
return
err
;
return
err
;
}
}
...
@@ -1016,7 +1016,7 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, int offse
...
@@ -1016,7 +1016,7 @@ int ip6_append_data(struct sock *sk, int getfrag(void *from, char *to, int offse
return
0
;
return
0
;
error:
error:
inet
->
cork
.
length
-=
length
;
inet
->
cork
.
length
-=
length
;
IP6_INC_STATS
(
Ip6
OutDiscards
);
IP6_INC_STATS
(
OutDiscards
);
return
err
;
return
err
;
}
}
...
@@ -1076,7 +1076,7 @@ int ip6_push_pending_frames(struct sock *sk)
...
@@ -1076,7 +1076,7 @@ int ip6_push_pending_frames(struct sock *sk)
ipv6_addr_copy
(
&
hdr
->
daddr
,
final_dst
);
ipv6_addr_copy
(
&
hdr
->
daddr
,
final_dst
);
skb
->
dst
=
dst_clone
(
&
rt
->
u
.
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
);
err
=
NF_HOOK
(
PF_INET6
,
NF_IP6_LOCAL_OUT
,
skb
,
NULL
,
skb
->
dst
->
dev
,
dst_output
);
if
(
err
)
{
if
(
err
)
{
if
(
err
>
0
)
if
(
err
>
0
)
...
@@ -1108,7 +1108,7 @@ void ip6_flush_pending_frames(struct sock *sk)
...
@@ -1108,7 +1108,7 @@ void ip6_flush_pending_frames(struct sock *sk)
struct
sk_buff
*
skb
;
struct
sk_buff
*
skb
;
while
((
skb
=
__skb_dequeue_tail
(
&
sk
->
sk_write_queue
))
!=
NULL
)
{
while
((
skb
=
__skb_dequeue_tail
(
&
sk
->
sk_write_queue
))
!=
NULL
)
{
IP6_INC_STATS
(
Ip6
OutDiscards
);
IP6_INC_STATS
(
OutDiscards
);
kfree_skb
(
skb
);
kfree_skb
(
skb
);
}
}
...
...
net/ipv6/ipv6_sockglue.c
View file @
058caf45
...
@@ -55,7 +55,7 @@
...
@@ -55,7 +55,7 @@
#include <asm/uaccess.h>
#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
=
{
static
struct
packet_type
ipv6_packet_type
=
{
.
type
=
__constant_htons
(
ETH_P_IPV6
),
.
type
=
__constant_htons
(
ETH_P_IPV6
),
...
...
net/ipv6/mcast.c
View file @
058caf45
...
@@ -1317,7 +1317,7 @@ static void mld_sendpack(struct sk_buff *skb)
...
@@ -1317,7 +1317,7 @@ static void mld_sendpack(struct sk_buff *skb)
struct
inet6_dev
*
idev
=
in6_dev_get
(
skb
->
dev
);
struct
inet6_dev
*
idev
=
in6_dev_get
(
skb
->
dev
);
int
err
;
int
err
;
IP6_INC_STATS
(
Ip6
OutRequests
);
IP6_INC_STATS
(
OutRequests
);
payload_len
=
skb
->
tail
-
(
unsigned
char
*
)
skb
->
nh
.
ipv6h
-
payload_len
=
skb
->
tail
-
(
unsigned
char
*
)
skb
->
nh
.
ipv6h
-
sizeof
(
struct
ipv6hdr
);
sizeof
(
struct
ipv6hdr
);
mldlen
=
skb
->
tail
-
skb
->
h
.
raw
;
mldlen
=
skb
->
tail
-
skb
->
h
.
raw
;
...
@@ -1329,9 +1329,9 @@ static void mld_sendpack(struct sk_buff *skb)
...
@@ -1329,9 +1329,9 @@ static void mld_sendpack(struct sk_buff *skb)
dev_queue_xmit
);
dev_queue_xmit
);
if
(
!
err
)
{
if
(
!
err
)
{
ICMP6_INC_STATS
(
idev
,
Icmp6OutMsgs
);
ICMP6_INC_STATS
(
idev
,
Icmp6OutMsgs
);
IP6_INC_STATS
(
Ip6
OutMcastPkts
);
IP6_INC_STATS
(
OutMcastPkts
);
}
else
}
else
IP6_INC_STATS
(
Ip6
OutDiscards
);
IP6_INC_STATS
(
OutDiscards
);
if
(
likely
(
idev
!=
NULL
))
if
(
likely
(
idev
!=
NULL
))
in6_dev_put
(
idev
);
in6_dev_put
(
idev
);
...
@@ -1613,7 +1613,7 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type)
...
@@ -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_ROUTERALERT
,
2
,
0
,
0
,
IPV6_TLV_PADN
,
0
};
IPV6_TLV_PADN
,
0
};
IP6_INC_STATS
(
Ip6
OutRequests
);
IP6_INC_STATS
(
OutRequests
);
snd_addr
=
addr
;
snd_addr
=
addr
;
if
(
type
==
ICMPV6_MGM_REDUCTION
)
{
if
(
type
==
ICMPV6_MGM_REDUCTION
)
{
snd_addr
=
&
all_routers
;
snd_addr
=
&
all_routers
;
...
@@ -1627,7 +1627,7 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type)
...
@@ -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
);
skb
=
sock_alloc_send_skb
(
sk
,
LL_RESERVED_SPACE
(
dev
)
+
full_len
,
1
,
&
err
);
if
(
skb
==
NULL
)
{
if
(
skb
==
NULL
)
{
IP6_INC_STATS
(
Ip6
OutDiscards
);
IP6_INC_STATS
(
OutDiscards
);
return
;
return
;
}
}
...
@@ -1672,16 +1672,16 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type)
...
@@ -1672,16 +1672,16 @@ static void igmp6_send(struct in6_addr *addr, struct net_device *dev, int type)
else
else
ICMP6_INC_STATS
(
idev
,
Icmp6OutGroupMembResponses
);
ICMP6_INC_STATS
(
idev
,
Icmp6OutGroupMembResponses
);
ICMP6_INC_STATS
(
idev
,
Icmp6OutMsgs
);
ICMP6_INC_STATS
(
idev
,
Icmp6OutMsgs
);
IP6_INC_STATS
(
Ip6
OutMcastPkts
);
IP6_INC_STATS
(
OutMcastPkts
);
}
else
}
else
IP6_INC_STATS
(
Ip6
OutDiscards
);
IP6_INC_STATS
(
OutDiscards
);
if
(
likely
(
idev
!=
NULL
))
if
(
likely
(
idev
!=
NULL
))
in6_dev_put
(
idev
);
in6_dev_put
(
idev
);
return
;
return
;
out:
out:
IP6_INC_STATS
(
Ip6
OutDiscards
);
IP6_INC_STATS
(
OutDiscards
);
kfree_skb
(
skb
);
kfree_skb
(
skb
);
}
}
...
...
net/ipv6/ndisc.c
View file @
058caf45
...
@@ -452,7 +452,7 @@ static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh,
...
@@ -452,7 +452,7 @@ static void ndisc_send_na(struct net_device *dev, struct neighbour *neigh,
skb
->
dst
=
dst
;
skb
->
dst
=
dst
;
idev
=
in6_dev_get
(
dst
->
dev
);
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
);
err
=
NF_HOOK
(
PF_INET6
,
NF_IP6_LOCAL_OUT
,
skb
,
NULL
,
dst
->
dev
,
dst_output
);
if
(
!
err
)
{
if
(
!
err
)
{
ICMP6_INC_STATS
(
idev
,
Icmp6OutNeighborAdvertisements
);
ICMP6_INC_STATS
(
idev
,
Icmp6OutNeighborAdvertisements
);
...
@@ -536,7 +536,7 @@ void ndisc_send_ns(struct net_device *dev, struct neighbour *neigh,
...
@@ -536,7 +536,7 @@ void ndisc_send_ns(struct net_device *dev, struct neighbour *neigh,
/* send it! */
/* send it! */
skb
->
dst
=
dst
;
skb
->
dst
=
dst
;
idev
=
in6_dev_get
(
dst
->
dev
);
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
);
err
=
NF_HOOK
(
PF_INET6
,
NF_IP6_LOCAL_OUT
,
skb
,
NULL
,
dst
->
dev
,
dst_output
);
if
(
!
err
)
{
if
(
!
err
)
{
ICMP6_INC_STATS
(
idev
,
Icmp6OutNeighborSolicits
);
ICMP6_INC_STATS
(
idev
,
Icmp6OutNeighborSolicits
);
...
@@ -609,7 +609,7 @@ void ndisc_send_rs(struct net_device *dev, struct in6_addr *saddr,
...
@@ -609,7 +609,7 @@ void ndisc_send_rs(struct net_device *dev, struct in6_addr *saddr,
/* send it! */
/* send it! */
skb
->
dst
=
dst
;
skb
->
dst
=
dst
;
idev
=
in6_dev_get
(
dst
->
dev
);
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
);
err
=
NF_HOOK
(
PF_INET6
,
NF_IP6_LOCAL_OUT
,
skb
,
NULL
,
dst
->
dev
,
dst_output
);
if
(
!
err
)
{
if
(
!
err
)
{
ICMP6_INC_STATS
(
idev
,
Icmp6OutRouterSolicits
);
ICMP6_INC_STATS
(
idev
,
Icmp6OutRouterSolicits
);
...
@@ -1335,7 +1335,7 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
...
@@ -1335,7 +1335,7 @@ void ndisc_send_redirect(struct sk_buff *skb, struct neighbour *neigh,
buff
->
dst
=
dst
;
buff
->
dst
=
dst
;
idev
=
in6_dev_get
(
dst
->
dev
);
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
);
err
=
NF_HOOK
(
PF_INET6
,
NF_IP6_LOCAL_OUT
,
buff
,
NULL
,
dst
->
dev
,
dst_output
);
if
(
!
err
)
{
if
(
!
err
)
{
ICMP6_INC_STATS
(
idev
,
Icmp6OutRedirects
);
ICMP6_INC_STATS
(
idev
,
Icmp6OutRedirects
);
...
...
net/ipv6/proc.c
View file @
058caf45
...
@@ -59,29 +59,29 @@ static int sockstat6_seq_show(struct seq_file *seq, void *v)
...
@@ -59,29 +59,29 @@ static int sockstat6_seq_show(struct seq_file *seq, void *v)
static
struct
snmp_item
snmp6_ipv6_list
[]
=
{
static
struct
snmp_item
snmp6_ipv6_list
[]
=
{
/* ipv6 mib according to RFC 2465 */
/* ipv6 mib according to RFC 2465 */
#define SNMP6_GEN(x) SNMP_ITEM(struct ip
v6
_mib, x, "Ip6" #x)
#define SNMP6_GEN(x) SNMP_ITEM(struct ip
stats
_mib, x, "Ip6" #x)
SNMP6_GEN
(
I
p6I
nReceives
),
SNMP6_GEN
(
InReceives
),
SNMP6_GEN
(
I
p6I
nHdrErrors
),
SNMP6_GEN
(
InHdrErrors
),
SNMP6_GEN
(
I
p6I
nTooBigErrors
),
SNMP6_GEN
(
InTooBigErrors
),
SNMP6_GEN
(
I
p6I
nNoRoutes
),
SNMP6_GEN
(
InNoRoutes
),
SNMP6_GEN
(
I
p6I
nAddrErrors
),
SNMP6_GEN
(
InAddrErrors
),
SNMP6_GEN
(
I
p6I
nUnknownProtos
),
SNMP6_GEN
(
InUnknownProtos
),
SNMP6_GEN
(
I
p6I
nTruncatedPkts
),
SNMP6_GEN
(
InTruncatedPkts
),
SNMP6_GEN
(
I
p6I
nDiscards
),
SNMP6_GEN
(
InDiscards
),
SNMP6_GEN
(
I
p6I
nDelivers
),
SNMP6_GEN
(
InDelivers
),
SNMP6_GEN
(
Ip6
OutForwDatagrams
),
SNMP6_GEN
(
OutForwDatagrams
),
SNMP6_GEN
(
Ip6
OutRequests
),
SNMP6_GEN
(
OutRequests
),
SNMP6_GEN
(
Ip6
OutDiscards
),
SNMP6_GEN
(
OutDiscards
),
SNMP6_GEN
(
Ip6
OutNoRoutes
),
SNMP6_GEN
(
OutNoRoutes
),
SNMP6_GEN
(
Ip6
ReasmTimeout
),
SNMP6_GEN
(
ReasmTimeout
),
SNMP6_GEN
(
Ip6
ReasmReqds
),
SNMP6_GEN
(
ReasmReqds
),
SNMP6_GEN
(
Ip6
ReasmOKs
),
SNMP6_GEN
(
ReasmOKs
),
SNMP6_GEN
(
Ip6
ReasmFails
),
SNMP6_GEN
(
ReasmFails
),
SNMP6_GEN
(
Ip6
FragOKs
),
SNMP6_GEN
(
FragOKs
),
SNMP6_GEN
(
Ip6
FragFails
),
SNMP6_GEN
(
FragFails
),
SNMP6_GEN
(
Ip6
FragCreates
),
SNMP6_GEN
(
FragCreates
),
SNMP6_GEN
(
I
p6I
nMcastPkts
),
SNMP6_GEN
(
InMcastPkts
),
SNMP6_GEN
(
Ip6
OutMcastPkts
),
SNMP6_GEN
(
OutMcastPkts
),
#undef SNMP6_GEN
#undef SNMP6_GEN
SNMP_ITEM_SENTINEL
SNMP_ITEM_SENTINEL
};
};
...
...
net/ipv6/raw.c
View file @
058caf45
...
@@ -535,7 +535,7 @@ static int rawv6_send_hdrinc(struct sock *sk, void *from, int length,
...
@@ -535,7 +535,7 @@ static int rawv6_send_hdrinc(struct sock *sk, void *from, int length,
if
(
err
)
if
(
err
)
goto
error_fault
;
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
,
err
=
NF_HOOK
(
PF_INET6
,
NF_IP6_LOCAL_OUT
,
skb
,
NULL
,
rt
->
u
.
dst
.
dev
,
dst_output
);
dst_output
);
if
(
err
>
0
)
if
(
err
>
0
)
...
@@ -549,7 +549,7 @@ static int rawv6_send_hdrinc(struct sock *sk, void *from, int length,
...
@@ -549,7 +549,7 @@ static int rawv6_send_hdrinc(struct sock *sk, void *from, int length,
err
=
-
EFAULT
;
err
=
-
EFAULT
;
kfree_skb
(
skb
);
kfree_skb
(
skb
);
error:
error:
IP6_INC_STATS
(
Ip6
OutDiscards
);
IP6_INC_STATS
(
OutDiscards
);
return
err
;
return
err
;
}
}
static
int
rawv6_sendmsg
(
struct
kiocb
*
iocb
,
struct
sock
*
sk
,
static
int
rawv6_sendmsg
(
struct
kiocb
*
iocb
,
struct
sock
*
sk
,
...
...
net/ipv6/reassembly.c
View file @
058caf45
...
@@ -284,7 +284,7 @@ static void ip6_evictor(void)
...
@@ -284,7 +284,7 @@ static void ip6_evictor(void)
spin_unlock
(
&
fq
->
lock
);
spin_unlock
(
&
fq
->
lock
);
fq_put
(
fq
);
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)
...
@@ -299,8 +299,8 @@ static void ip6_frag_expire(unsigned long data)
fq_kill
(
fq
);
fq_kill
(
fq
);
IP6_INC_STATS_BH
(
Ip6
ReasmTimeout
);
IP6_INC_STATS_BH
(
ReasmTimeout
);
IP6_INC_STATS_BH
(
Ip6
ReasmFails
);
IP6_INC_STATS_BH
(
ReasmFails
);
/* Send error only if the first segment arrived. */
/* Send error only if the first segment arrived. */
if
(
fq
->
last_in
&
FIRST_IN
&&
fq
->
fragments
)
{
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
...
@@ -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
);
return
ip6_frag_intern
(
hash
,
fq
);
oom:
oom:
IP6_INC_STATS_BH
(
Ip6
ReasmFails
);
IP6_INC_STATS_BH
(
ReasmFails
);
return
NULL
;
return
NULL
;
}
}
...
@@ -426,7 +426,7 @@ static void ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
...
@@ -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
)));
((
u8
*
)
(
fhdr
+
1
)
-
(
u8
*
)
(
skb
->
nh
.
ipv6h
+
1
)));
if
((
unsigned
int
)
end
>
IPV6_MAXPLEN
)
{
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
);
icmpv6_param_prob
(
skb
,
ICMPV6_HDR_FIELD
,
(
u8
*
)
&
fhdr
->
frag_off
-
skb
->
nh
.
raw
);
return
;
return
;
}
}
...
@@ -453,7 +453,7 @@ static void ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
...
@@ -453,7 +453,7 @@ static void ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
/* RFC2460 says always send parameter problem in
/* RFC2460 says always send parameter problem in
* this case. -DaveM
* this case. -DaveM
*/
*/
IP6_INC_STATS_BH
(
I
p6I
nHdrErrors
);
IP6_INC_STATS_BH
(
InHdrErrors
);
icmpv6_param_prob
(
skb
,
ICMPV6_HDR_FIELD
,
icmpv6_param_prob
(
skb
,
ICMPV6_HDR_FIELD
,
offsetof
(
struct
ipv6hdr
,
payload_len
));
offsetof
(
struct
ipv6hdr
,
payload_len
));
return
;
return
;
...
@@ -572,7 +572,7 @@ static void ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
...
@@ -572,7 +572,7 @@ static void ip6_frag_queue(struct frag_queue *fq, struct sk_buff *skb,
return
;
return
;
err:
err:
IP6_INC_STATS
(
Ip6
ReasmFails
);
IP6_INC_STATS
(
ReasmFails
);
kfree_skb
(
skb
);
kfree_skb
(
skb
);
}
}
...
@@ -666,7 +666,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff **skb_in,
...
@@ -666,7 +666,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff **skb_in,
if
(
head
->
ip_summed
==
CHECKSUM_HW
)
if
(
head
->
ip_summed
==
CHECKSUM_HW
)
head
->
csum
=
csum_partial
(
head
->
nh
.
raw
,
head
->
h
.
raw
-
head
->
nh
.
raw
,
head
->
csum
);
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
;
fq
->
fragments
=
NULL
;
*
nhoffp
=
nhoff
;
*
nhoffp
=
nhoff
;
return
1
;
return
1
;
...
@@ -679,7 +679,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff **skb_in,
...
@@ -679,7 +679,7 @@ static int ip6_frag_reasm(struct frag_queue *fq, struct sk_buff **skb_in,
if
(
net_ratelimit
())
if
(
net_ratelimit
())
printk
(
KERN_DEBUG
"ip6_frag_reasm: no memory for reassembly
\n
"
);
printk
(
KERN_DEBUG
"ip6_frag_reasm: no memory for reassembly
\n
"
);
out_fail:
out_fail:
IP6_INC_STATS_BH
(
Ip6
ReasmFails
);
IP6_INC_STATS_BH
(
ReasmFails
);
return
-
1
;
return
-
1
;
}
}
...
@@ -693,16 +693,16 @@ static int ipv6_frag_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
...
@@ -693,16 +693,16 @@ static int ipv6_frag_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
hdr
=
skb
->
nh
.
ipv6h
;
hdr
=
skb
->
nh
.
ipv6h
;
IP6_INC_STATS_BH
(
Ip6
ReasmReqds
);
IP6_INC_STATS_BH
(
ReasmReqds
);
/* Jumbo payload inhibits frag. header */
/* Jumbo payload inhibits frag. header */
if
(
hdr
->
payload_len
==
0
)
{
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
);
icmpv6_param_prob
(
skb
,
ICMPV6_HDR_FIELD
,
skb
->
h
.
raw
-
skb
->
nh
.
raw
);
return
-
1
;
return
-
1
;
}
}
if
(
!
pskb_may_pull
(
skb
,
(
skb
->
h
.
raw
-
skb
->
data
)
+
sizeof
(
struct
frag_hdr
)))
{
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
);
icmpv6_param_prob
(
skb
,
ICMPV6_HDR_FIELD
,
skb
->
h
.
raw
-
skb
->
nh
.
raw
);
return
-
1
;
return
-
1
;
}
}
...
@@ -713,7 +713,7 @@ static int ipv6_frag_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
...
@@ -713,7 +713,7 @@ static int ipv6_frag_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
if
(
!
(
fhdr
->
frag_off
&
htons
(
0xFFF9
)))
{
if
(
!
(
fhdr
->
frag_off
&
htons
(
0xFFF9
)))
{
/* It is not a fragmented frame */
/* It is not a fragmented frame */
skb
->
h
.
raw
+=
sizeof
(
struct
frag_hdr
);
skb
->
h
.
raw
+=
sizeof
(
struct
frag_hdr
);
IP6_INC_STATS_BH
(
Ip6
ReasmOKs
);
IP6_INC_STATS_BH
(
ReasmOKs
);
*
nhoffp
=
(
u8
*
)
fhdr
-
skb
->
nh
.
raw
;
*
nhoffp
=
(
u8
*
)
fhdr
-
skb
->
nh
.
raw
;
return
1
;
return
1
;
...
@@ -738,7 +738,7 @@ static int ipv6_frag_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
...
@@ -738,7 +738,7 @@ static int ipv6_frag_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
return
ret
;
return
ret
;
}
}
IP6_INC_STATS_BH
(
Ip6
ReasmFails
);
IP6_INC_STATS_BH
(
ReasmFails
);
kfree_skb
(
skb
);
kfree_skb
(
skb
);
return
-
1
;
return
-
1
;
}
}
...
...
net/ipv6/route.c
View file @
058caf45
...
@@ -1259,7 +1259,7 @@ int ipv6_route_ioctl(unsigned int cmd, void __user *arg)
...
@@ -1259,7 +1259,7 @@ int ipv6_route_ioctl(unsigned int cmd, void __user *arg)
int
ip6_pkt_discard
(
struct
sk_buff
*
skb
)
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
);
icmpv6_send
(
skb
,
ICMPV6_DEST_UNREACH
,
ICMPV6_NOROUTE
,
0
,
skb
->
dev
);
kfree_skb
(
skb
);
kfree_skb
(
skb
);
return
0
;
return
0
;
...
...
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