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
Kirill Smelkov
linux
Commits
104360f2
Commit
104360f2
authored
Jun 08, 2004
by
Hideaki Yoshifuji
Committed by
David S. Miller
Jun 08, 2004
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPV6]: Add IP6CB.
parent
b608d6a2
Changes
8
Hide whitespace changes
Inline
Side-by-side
Showing
8 changed files
with
22 additions
and
29 deletions
+22
-29
include/linux/ipv6.h
include/linux/ipv6.h
+2
-0
net/ipv6/datagram.c
net/ipv6/datagram.c
+5
-9
net/ipv6/exthdrs.c
net/ipv6/exthdrs.c
+5
-5
net/ipv6/ip6_input.c
net/ipv6/ip6_input.c
+1
-1
net/ipv6/ip6_output.c
net/ipv6/ip6_output.c
+1
-1
net/ipv6/raw.c
net/ipv6/raw.c
+2
-4
net/ipv6/tcp_ipv6.c
net/ipv6/tcp_ipv6.c
+4
-5
net/ipv6/udp.c
net/ipv6/udp.c
+2
-4
No files found.
include/linux/ipv6.h
View file @
104360f2
...
...
@@ -192,6 +192,8 @@ struct inet6_skb_parm
__u16
dst1
;
};
#define IP6CB(skb) ((struct inet6_skb_parm*)((skb)->cb))
struct
ipv6_pinfo
{
struct
in6_addr
saddr
;
struct
in6_addr
rcv_saddr
;
...
...
net/ipv6/datagram.c
View file @
104360f2
...
...
@@ -145,10 +145,8 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len)
(
struct
in6_addr
*
)(
skb
->
nh
.
raw
+
serr
->
addr_offset
));
if
(
np
->
sndflow
)
sin
->
sin6_flowinfo
=
*
(
u32
*
)(
skb
->
nh
.
raw
+
serr
->
addr_offset
-
24
)
&
IPV6_FLOWINFO_MASK
;
if
(
ipv6_addr_type
(
&
sin
->
sin6_addr
)
&
IPV6_ADDR_LINKLOCAL
)
{
struct
inet6_skb_parm
*
opt
=
(
struct
inet6_skb_parm
*
)
skb
->
cb
;
sin
->
sin6_scope_id
=
opt
->
iif
;
}
if
(
ipv6_addr_type
(
&
sin
->
sin6_addr
)
&
IPV6_ADDR_LINKLOCAL
)
sin
->
sin6_scope_id
=
IP6CB
(
skb
)
->
iif
;
}
else
{
ipv6_addr_set
(
&
sin
->
sin6_addr
,
0
,
0
,
htonl
(
0xffff
),
...
...
@@ -167,10 +165,8 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len)
ipv6_addr_copy
(
&
sin
->
sin6_addr
,
&
skb
->
nh
.
ipv6h
->
saddr
);
if
(
np
->
rxopt
.
all
)
datagram_recv_ctl
(
sk
,
msg
,
skb
);
if
(
ipv6_addr_type
(
&
sin
->
sin6_addr
)
&
IPV6_ADDR_LINKLOCAL
)
{
struct
inet6_skb_parm
*
opt
=
(
struct
inet6_skb_parm
*
)
skb
->
cb
;
sin
->
sin6_scope_id
=
opt
->
iif
;
}
if
(
ipv6_addr_type
(
&
sin
->
sin6_addr
)
&
IPV6_ADDR_LINKLOCAL
)
sin
->
sin6_scope_id
=
IP6CB
(
skb
)
->
iif
;
}
else
{
struct
inet_opt
*
inet
=
inet_sk
(
sk
);
...
...
@@ -211,7 +207,7 @@ int ipv6_recv_error(struct sock *sk, struct msghdr *msg, int len)
int
datagram_recv_ctl
(
struct
sock
*
sk
,
struct
msghdr
*
msg
,
struct
sk_buff
*
skb
)
{
struct
ipv6_pinfo
*
np
=
inet6_sk
(
sk
);
struct
inet6_skb_parm
*
opt
=
(
struct
inet6_skb_parm
*
)
skb
->
cb
;
struct
inet6_skb_parm
*
opt
=
IP6CB
(
skb
)
;
if
(
np
->
rxopt
.
bits
.
rxinfo
)
{
struct
in6_pktinfo
src_info
;
...
...
net/ipv6/exthdrs.c
View file @
104360f2
...
...
@@ -155,7 +155,7 @@ static struct tlvtype_proc tlvprocdestopt_lst[] = {
static
int
ipv6_destopt_rcv
(
struct
sk_buff
**
skbp
,
unsigned
int
*
nhoffp
)
{
struct
sk_buff
*
skb
=
*
skbp
;
struct
inet6_skb_parm
*
opt
=
(
struct
inet6_skb_parm
*
)
skb
->
cb
;
struct
inet6_skb_parm
*
opt
=
IP6CB
(
skb
)
;
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
)))
{
...
...
@@ -217,7 +217,7 @@ void __init ipv6_nodata_init(void)
static
int
ipv6_rthdr_rcv
(
struct
sk_buff
**
skbp
,
unsigned
int
*
nhoffp
)
{
struct
sk_buff
*
skb
=
*
skbp
;
struct
inet6_skb_parm
*
opt
=
(
struct
inet6_skb_parm
*
)
skb
->
cb
;
struct
inet6_skb_parm
*
opt
=
IP6CB
(
skb
)
;
struct
in6_addr
*
addr
;
struct
in6_addr
daddr
;
int
n
,
i
;
...
...
@@ -288,7 +288,7 @@ static int ipv6_rthdr_rcv(struct sk_buff **skbp, unsigned int *nhoffp)
return
-
1
;
}
*
skbp
=
skb
=
skb2
;
opt
=
(
struct
inet6_skb_parm
*
)
skb2
->
cb
;
opt
=
IP6CB
(
skb2
)
;
hdr
=
(
struct
ipv6_rt_hdr
*
)
skb2
->
h
.
raw
;
}
...
...
@@ -418,7 +418,7 @@ ipv6_invert_rthdr(struct sock *sk, struct ipv6_rt_hdr *hdr)
static
int
ipv6_hop_ra
(
struct
sk_buff
*
skb
,
int
optoff
)
{
if
(
skb
->
nh
.
raw
[
optoff
+
1
]
==
2
)
{
((
struct
inet6_skb_parm
*
)
skb
->
c
b
)
->
ra
=
optoff
;
IP6CB
(
sk
b
)
->
ra
=
optoff
;
return
1
;
}
LIMIT_NETDEBUG
(
...
...
@@ -482,7 +482,7 @@ static struct tlvtype_proc tlvprochopopt_lst[] = {
int
ipv6_parse_hopopts
(
struct
sk_buff
*
skb
,
int
nhoff
)
{
((
struct
inet6_skb_parm
*
)
skb
->
c
b
)
->
hop
=
sizeof
(
struct
ipv6hdr
);
IP6CB
(
sk
b
)
->
hop
=
sizeof
(
struct
ipv6hdr
);
if
(
ip6_parse_tlv
(
tlvprochopopt_lst
,
skb
))
return
sizeof
(
struct
ipv6hdr
);
return
-
1
;
...
...
net/ipv6/ip6_input.c
View file @
104360f2
...
...
@@ -74,7 +74,7 @@ int ipv6_rcv(struct sk_buff *skb, struct net_device *dev, struct packet_type *pt
/* Store incoming device index. When the packet will
be queued, we cannot refer to skb->dev anymore.
*/
((
struct
inet6_skb_parm
*
)
skb
->
c
b
)
->
iif
=
dev
->
ifindex
;
IP6CB
(
sk
b
)
->
iif
=
dev
->
ifindex
;
if
(
skb
->
len
<
sizeof
(
struct
ipv6hdr
))
goto
err
;
...
...
net/ipv6/ip6_output.c
View file @
104360f2
...
...
@@ -349,7 +349,7 @@ int ip6_forward(struct sk_buff *skb)
{
struct
dst_entry
*
dst
=
skb
->
dst
;
struct
ipv6hdr
*
hdr
=
skb
->
nh
.
ipv6h
;
struct
inet6_skb_parm
*
opt
=
(
struct
inet6_skb_parm
*
)
skb
->
cb
;
struct
inet6_skb_parm
*
opt
=
IP6CB
(
skb
)
;
if
(
ipv6_devconf
.
forwarding
==
0
)
goto
error
;
...
...
net/ipv6/raw.c
View file @
104360f2
...
...
@@ -409,10 +409,8 @@ static int rawv6_recvmsg(struct kiocb *iocb, struct sock *sk,
ipv6_addr_copy
(
&
sin6
->
sin6_addr
,
&
skb
->
nh
.
ipv6h
->
saddr
);
sin6
->
sin6_flowinfo
=
0
;
sin6
->
sin6_scope_id
=
0
;
if
(
ipv6_addr_type
(
&
sin6
->
sin6_addr
)
&
IPV6_ADDR_LINKLOCAL
)
{
struct
inet6_skb_parm
*
opt
=
(
struct
inet6_skb_parm
*
)
skb
->
cb
;
sin6
->
sin6_scope_id
=
opt
->
iif
;
}
if
(
ipv6_addr_type
(
&
sin6
->
sin6_addr
)
&
IPV6_ADDR_LINKLOCAL
)
sin6
->
sin6_scope_id
=
IP6CB
(
skb
)
->
iif
;
}
sock_recv_timestamp
(
msg
,
sk
,
skb
);
...
...
net/ipv6/tcp_ipv6.c
View file @
104360f2
...
...
@@ -536,8 +536,7 @@ static int tcp_v6_hash_connect(struct sock *sk)
static
__inline__
int
tcp_v6_iif
(
struct
sk_buff
*
skb
)
{
struct
inet6_skb_parm
*
opt
=
(
struct
inet6_skb_parm
*
)
skb
->
cb
;
return
opt
->
iif
;
return
IP6CB
(
skb
)
->
iif
;
}
static
int
tcp_v6_connect
(
struct
sock
*
sk
,
struct
sockaddr
*
uaddr
,
...
...
@@ -879,7 +878,7 @@ static int tcp_v6_send_synack(struct sock *sk, struct open_request *req,
np
->
rxopt
.
bits
.
srcrt
==
2
&&
req
->
af
.
v6_req
.
pktopts
)
{
struct
sk_buff
*
pktopts
=
req
->
af
.
v6_req
.
pktopts
;
struct
inet6_skb_parm
*
rxopt
=
(
struct
inet6_skb_parm
*
)
pktopts
->
cb
;
struct
inet6_skb_parm
*
rxopt
=
IP6CB
(
pktopts
)
;
if
(
rxopt
->
srcrt
)
opt
=
ipv6_invert_rthdr
(
sk
,
(
struct
ipv6_rt_hdr
*
)(
pktopts
->
nh
.
raw
+
rxopt
->
srcrt
));
}
...
...
@@ -932,7 +931,7 @@ static struct or_calltable or_ipv6 = {
static
int
ipv6_opt_accepted
(
struct
sock
*
sk
,
struct
sk_buff
*
skb
)
{
struct
ipv6_pinfo
*
np
=
inet6_sk
(
sk
);
struct
inet6_skb_parm
*
opt
=
(
struct
inet6_skb_parm
*
)
skb
->
cb
;
struct
inet6_skb_parm
*
opt
=
IP6CB
(
skb
)
;
if
(
np
->
rxopt
.
all
)
{
if
((
opt
->
hop
&&
np
->
rxopt
.
bits
.
hopopts
)
||
...
...
@@ -1305,7 +1304,7 @@ static struct sock * tcp_v6_syn_recv_sock(struct sock *sk, struct sk_buff *skb,
if
(
np
->
rxopt
.
bits
.
srcrt
==
2
&&
opt
==
NULL
&&
req
->
af
.
v6_req
.
pktopts
)
{
struct
inet6_skb_parm
*
rxopt
=
(
struct
inet6_skb_parm
*
)
req
->
af
.
v6_req
.
pktopts
->
cb
;
struct
inet6_skb_parm
*
rxopt
=
IP6CB
(
req
->
af
.
v6_req
.
pktopts
)
;
if
(
rxopt
->
srcrt
)
opt
=
ipv6_invert_rthdr
(
sk
,
(
struct
ipv6_rt_hdr
*
)(
req
->
af
.
v6_req
.
pktopts
->
nh
.
raw
+
rxopt
->
srcrt
));
}
...
...
net/ipv6/udp.c
View file @
104360f2
...
...
@@ -432,10 +432,8 @@ static int udpv6_recvmsg(struct kiocb *iocb, struct sock *sk,
if
(
np
->
rxopt
.
all
)
datagram_recv_ctl
(
sk
,
msg
,
skb
);
if
(
ipv6_addr_type
(
&
sin6
->
sin6_addr
)
&
IPV6_ADDR_LINKLOCAL
)
{
struct
inet6_skb_parm
*
opt
=
(
struct
inet6_skb_parm
*
)
skb
->
cb
;
sin6
->
sin6_scope_id
=
opt
->
iif
;
}
if
(
ipv6_addr_type
(
&
sin6
->
sin6_addr
)
&
IPV6_ADDR_LINKLOCAL
)
sin6
->
sin6_scope_id
=
IP6CB
(
skb
)
->
iif
;
}
}
err
=
copied
;
...
...
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