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
5d45d09c
Commit
5d45d09c
authored
Jan 17, 2005
by
David S. Miller
Browse files
Options
Browse Files
Download
Plain Diff
Merge
bk://kernel.bkbits.net/acme/connection_sock-2.6
into nuts.davemloft.net:/disk1/BK/net-2.6
parents
4a4cda7b
aced97aa
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
32 additions
and
32 deletions
+32
-32
include/linux/ipv6.h
include/linux/ipv6.h
+11
-12
net/ipv6/raw.c
net/ipv6/raw.c
+21
-20
No files found.
include/linux/ipv6.h
View file @
5d45d09c
...
...
@@ -247,27 +247,26 @@ struct ipv6_pinfo {
}
cork
;
};
struct
raw6_opt
{
/* WARNING: don't change the layout of the members in {raw,udp,tcp}6_sock! */
struct
raw6_sock
{
/* inet_sock has to be the first member of raw6_sock */
struct
inet_sock
inet
;
__u32
checksum
;
/* perform checksum */
__u32
offset
;
/* checksum offset */
struct
icmp6_filter
filter
;
};
/* WARNING: don't change the layout of the members in {raw,udp,tcp}6_sock! */
struct
raw6_sock
{
struct
inet_sock
inet
;
struct
raw6_opt
raw6
;
struct
ipv6_pinfo
inet6
;
/* ipv6_pinfo has to be the last member of raw6_sock, see inet6_sk_generic */
struct
ipv6_pinfo
inet6
;
};
struct
udp6_sock
{
struct
udp_sock
udp
;
/* ipv6_pinfo has to be the last member of udp6_sock, see inet6_sk_generic */
struct
ipv6_pinfo
inet6
;
};
struct
tcp6_sock
{
struct
tcp_sock
tcp
;
/* ipv6_pinfo has to be the last member of tcp6_sock, see inet6_sk_generic */
struct
ipv6_pinfo
inet6
;
};
...
...
@@ -277,9 +276,9 @@ static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk)
return
inet_sk
(
__sk
)
->
pinet6
;
}
static
inline
struct
raw6_
opt
*
raw6_sk
(
const
struct
sock
*
__
sk
)
static
inline
struct
raw6_
sock
*
raw6_sk
(
const
struct
sock
*
sk
)
{
return
&
((
struct
raw6_sock
*
)
__sk
)
->
raw6
;
return
(
struct
raw6_sock
*
)
sk
;
}
static
inline
void
inet_sk_copy_descendant
(
struct
sock
*
sk_to
,
...
...
@@ -304,7 +303,7 @@ static inline struct ipv6_pinfo * inet6_sk(const struct sock *__sk)
return
NULL
;
}
static
inline
struct
raw6_
opt
*
raw6_sk
(
const
struct
sock
*
__
sk
)
static
inline
struct
raw6_
sock
*
raw6_sk
(
const
struct
sock
*
sk
)
{
return
NULL
;
}
...
...
net/ipv6/raw.c
View file @
5d45d09c
...
...
@@ -115,10 +115,10 @@ struct sock *__raw_v6_lookup(struct sock *sk, unsigned short num,
static
__inline__
int
icmpv6_filter
(
struct
sock
*
sk
,
struct
sk_buff
*
skb
)
{
struct
icmp6hdr
*
icmph
;
struct
raw6_
opt
*
opt
=
raw6_sk
(
sk
);
struct
raw6_
sock
*
rp
=
raw6_sk
(
sk
);
if
(
pskb_may_pull
(
skb
,
sizeof
(
struct
icmp6hdr
)))
{
__u32
*
data
=
&
opt
->
filter
.
data
[
0
];
__u32
*
data
=
&
rp
->
filter
.
data
[
0
];
int
bit_nr
;
icmph
=
(
struct
icmp6hdr
*
)
skb
->
data
;
...
...
@@ -315,14 +315,14 @@ static inline int rawv6_rcv_skb(struct sock * sk, struct sk_buff * skb)
int
rawv6_rcv
(
struct
sock
*
sk
,
struct
sk_buff
*
skb
)
{
struct
inet_sock
*
inet
=
inet_sk
(
sk
);
struct
raw6_
opt
*
raw_opt
=
raw6_sk
(
sk
);
struct
raw6_
sock
*
rp
=
raw6_sk
(
sk
);
if
(
!
xfrm6_policy_check
(
sk
,
XFRM_POLICY_IN
,
skb
))
{
kfree_skb
(
skb
);
return
NET_RX_DROP
;
}
if
(
!
r
aw_opt
->
checksum
)
if
(
!
r
p
->
checksum
)
skb
->
ip_summed
=
CHECKSUM_UNNECESSARY
;
if
(
skb
->
ip_summed
!=
CHECKSUM_UNNECESSARY
)
{
...
...
@@ -451,21 +451,22 @@ static int rawv6_recvmsg(struct kiocb *iocb, struct sock *sk,
goto
out_free
;
}
static
int
rawv6_push_pending_frames
(
struct
sock
*
sk
,
struct
flowi
*
fl
,
struct
raw6_opt
*
opt
,
int
len
)
static
int
rawv6_push_pending_frames
(
struct
sock
*
sk
,
struct
flowi
*
fl
,
struct
raw6_sock
*
rp
,
int
len
)
{
struct
sk_buff
*
skb
;
int
err
=
0
;
u16
*
csum
;
u32
tmp_csum
;
if
(
!
opt
->
checksum
)
if
(
!
rp
->
checksum
)
goto
send
;
if
((
skb
=
skb_peek
(
&
sk
->
sk_write_queue
))
==
NULL
)
goto
out
;
if
(
opt
->
offset
+
1
<
len
)
csum
=
(
u16
*
)(
skb
->
h
.
raw
+
opt
->
offset
);
if
(
rp
->
offset
+
1
<
len
)
csum
=
(
u16
*
)(
skb
->
h
.
raw
+
rp
->
offset
);
else
{
err
=
-
EINVAL
;
goto
out
;
...
...
@@ -609,7 +610,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
struct
in6_addr
*
daddr
,
*
final_p
=
NULL
,
final
;
struct
inet_sock
*
inet
=
inet_sk
(
sk
);
struct
ipv6_pinfo
*
np
=
inet6_sk
(
sk
);
struct
raw6_
opt
*
raw_opt
=
raw6_sk
(
sk
);
struct
raw6_
sock
*
rp
=
raw6_sk
(
sk
);
struct
ipv6_txoptions
*
opt
=
NULL
;
struct
ip6_flowlabel
*
flowlabel
=
NULL
;
struct
dst_entry
*
dst
=
NULL
;
...
...
@@ -771,7 +772,7 @@ static int rawv6_sendmsg(struct kiocb *iocb, struct sock *sk,
if
(
err
)
ip6_flush_pending_frames
(
sk
);
else
if
(
!
(
msg
->
msg_flags
&
MSG_MORE
))
err
=
rawv6_push_pending_frames
(
sk
,
&
fl
,
r
aw_opt
,
len
);
err
=
rawv6_push_pending_frames
(
sk
,
&
fl
,
r
p
,
len
);
}
done:
ip6_dst_store
(
sk
,
dst
,
...
...
@@ -838,7 +839,7 @@ static int rawv6_geticmpfilter(struct sock *sk, int level, int optname,
static
int
rawv6_setsockopt
(
struct
sock
*
sk
,
int
level
,
int
optname
,
char
__user
*
optval
,
int
optlen
)
{
struct
raw6_
opt
*
opt
=
raw6_sk
(
sk
);
struct
raw6_
sock
*
rp
=
raw6_sk
(
sk
);
int
val
;
switch
(
level
)
{
...
...
@@ -868,10 +869,10 @@ static int rawv6_setsockopt(struct sock *sk, int level, int optname,
if
(
val
>
0
&&
(
val
&
1
))
return
(
-
EINVAL
);
if
(
val
<
0
)
{
opt
->
checksum
=
0
;
rp
->
checksum
=
0
;
}
else
{
opt
->
checksum
=
1
;
opt
->
offset
=
val
;
rp
->
checksum
=
1
;
rp
->
offset
=
val
;
}
return
0
;
...
...
@@ -885,7 +886,7 @@ static int rawv6_setsockopt(struct sock *sk, int level, int optname,
static
int
rawv6_getsockopt
(
struct
sock
*
sk
,
int
level
,
int
optname
,
char
__user
*
optval
,
int
__user
*
optlen
)
{
struct
raw6_
opt
*
opt
=
raw6_sk
(
sk
);
struct
raw6_
sock
*
rp
=
raw6_sk
(
sk
);
int
val
,
len
;
switch
(
level
)
{
...
...
@@ -910,10 +911,10 @@ static int rawv6_getsockopt(struct sock *sk, int level, int optname,
switch
(
optname
)
{
case
IPV6_CHECKSUM
:
if
(
opt
->
checksum
==
0
)
if
(
rp
->
checksum
==
0
)
val
=
-
1
;
else
val
=
opt
->
offset
;
val
=
rp
->
offset
;
break
;
default:
...
...
@@ -966,9 +967,9 @@ static void rawv6_close(struct sock *sk, long timeout)
static
int
rawv6_init_sk
(
struct
sock
*
sk
)
{
if
(
inet_sk
(
sk
)
->
num
==
IPPROTO_ICMPV6
)
{
struct
raw6_
opt
*
opt
=
raw6_sk
(
sk
);
opt
->
checksum
=
1
;
opt
->
offset
=
2
;
struct
raw6_
sock
*
rp
=
raw6_sk
(
sk
);
rp
->
checksum
=
1
;
rp
->
offset
=
2
;
}
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