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
967463ef
Commit
967463ef
authored
Feb 12, 2003
by
Tom Lendacky
Committed by
David S. Miller
Feb 12, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPSEC]: Make sure to clear sin_zero in AF_KEY.
parent
de8c10fc
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
26 additions
and
19 deletions
+26
-19
net/key/af_key.c
net/key/af_key.c
+26
-19
No files found.
net/key/af_key.c
View file @
967463ef
...
...
@@ -563,6 +563,7 @@ static struct sk_buff * pfkey_xfrm_state2msg(struct xfrm_state *x, int add_keys,
struct
sadb_address
*
addr
;
struct
sadb_key
*
key
;
struct
sadb_x_sa2
*
sa2
;
struct
sockaddr_in
*
sin
;
int
size
;
int
auth_key_size
=
0
;
int
encrypt_key_size
=
0
;
...
...
@@ -675,9 +676,11 @@ static struct sk_buff * pfkey_xfrm_state2msg(struct xfrm_state *x, int add_keys,
addr
->
sadb_address_proto
=
0
;
addr
->
sadb_address_prefixlen
=
32
;
/* XXX */
addr
->
sadb_address_reserved
=
0
;
((
struct
sockaddr_in
*
)(
addr
+
1
))
->
sin_family
=
AF_INET
;
((
struct
sockaddr_in
*
)(
addr
+
1
))
->
sin_addr
.
s_addr
=
x
->
props
.
saddr
.
xfrm4_addr
;
sin
=
(
struct
sockaddr_in
*
)
(
addr
+
1
);
sin
->
sin_family
=
AF_INET
;
sin
->
sin_addr
.
s_addr
=
x
->
props
.
saddr
.
xfrm4_addr
;
sin
->
sin_port
=
0
;
memset
(
sin
->
sin_zero
,
0
,
sizeof
(
sin
->
sin_zero
));
/* dst address */
addr
=
(
struct
sadb_address
*
)
skb_put
(
skb
,
sizeof
(
struct
sadb_address
)
+
sizeof
(
struct
sockaddr_in
));
...
...
@@ -688,9 +691,11 @@ static struct sk_buff * pfkey_xfrm_state2msg(struct xfrm_state *x, int add_keys,
addr
->
sadb_address_proto
=
0
;
addr
->
sadb_address_prefixlen
=
32
;
/* XXX */
addr
->
sadb_address_reserved
=
0
;
((
struct
sockaddr_in
*
)(
addr
+
1
))
->
sin_family
=
AF_INET
;
((
struct
sockaddr_in
*
)(
addr
+
1
))
->
sin_addr
.
s_addr
=
x
->
id
.
daddr
.
xfrm4_addr
;
sin
=
(
struct
sockaddr_in
*
)
(
addr
+
1
);
sin
->
sin_family
=
AF_INET
;
sin
->
sin_addr
.
s_addr
=
x
->
id
.
daddr
.
xfrm4_addr
;
sin
->
sin_port
=
0
;
memset
(
sin
->
sin_zero
,
0
,
sizeof
(
sin
->
sin_zero
));
if
(
x
->
sel
.
saddr
.
xfrm4_addr
!=
x
->
props
.
saddr
.
xfrm4_addr
)
{
addr
=
(
struct
sadb_address
*
)
skb_put
(
skb
,
...
...
@@ -702,11 +707,11 @@ static struct sk_buff * pfkey_xfrm_state2msg(struct xfrm_state *x, int add_keys,
addr
->
sadb_address_proto
=
pfkey_proto_from_xfrm
(
x
->
sel
.
proto
);
addr
->
sadb_address_prefixlen
=
x
->
sel
.
prefixlen_s
;
addr
->
sadb_address_reserved
=
0
;
((
struct
sockaddr_in
*
)(
addr
+
1
))
->
sin_family
=
AF_INET
;
((
struct
sockaddr_in
*
)(
addr
+
1
))
->
sin_addr
.
s_addr
=
x
->
sel
.
saddr
.
xfrm4_addr
;
((
struct
sockaddr_in
*
)(
addr
+
1
))
->
sin_port
=
x
->
sel
.
sport
;
sin
=
(
struct
sockaddr_in
*
)(
addr
+
1
)
;
sin
->
sin_family
=
AF_INET
;
sin
->
sin_addr
.
s_addr
=
x
->
sel
.
saddr
.
xfrm4_addr
;
sin
->
sin_port
=
x
->
sel
.
sport
;
memset
(
sin
->
sin_zero
,
0
,
sizeof
(
sin
->
sin_zero
))
;
}
/* auth key */
...
...
@@ -2060,10 +2065,11 @@ static int pfkey_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *t, struct
addr
->
sadb_address_proto
=
0
;
addr
->
sadb_address_prefixlen
=
32
;
addr
->
sadb_address_reserved
=
0
;
((
struct
sockaddr_in
*
)(
addr
+
1
))
->
sin_family
=
AF_INET
;
((
struct
sockaddr_in
*
)(
addr
+
1
))
->
sin_addr
.
s_addr
=
x
->
props
.
saddr
.
xfrm4_addr
;
((
struct
sockaddr_in
*
)(
addr
+
1
))
->
sin_port
=
0
;
sin
=
(
struct
sockaddr_in
*
)(
addr
+
1
);
sin
->
sin_family
=
AF_INET
;
sin
->
sin_addr
.
s_addr
=
x
->
props
.
saddr
.
xfrm4_addr
;
sin
->
sin_port
=
0
;
memset
(
sin
->
sin_zero
,
0
,
sizeof
(
sin
->
sin_zero
));
/* dst address */
addr
=
(
struct
sadb_address
*
)
skb_put
(
skb
,
...
...
@@ -2075,10 +2081,11 @@ static int pfkey_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *t, struct
addr
->
sadb_address_proto
=
0
;
addr
->
sadb_address_prefixlen
=
32
;
addr
->
sadb_address_reserved
=
0
;
((
struct
sockaddr_in
*
)(
addr
+
1
))
->
sin_family
=
AF_INET
;
((
struct
sockaddr_in
*
)(
addr
+
1
))
->
sin_addr
.
s_addr
=
x
->
id
.
daddr
.
xfrm4_addr
;
((
struct
sockaddr_in
*
)(
addr
+
1
))
->
sin_port
=
0
;
sin
=
(
struct
sockaddr_in
*
)(
addr
+
1
);
sin
->
sin_family
=
AF_INET
;
sin
->
sin_addr
.
s_addr
=
x
->
id
.
daddr
.
xfrm4_addr
;
sin
->
sin_port
=
0
;
memset
(
sin
->
sin_zero
,
0
,
sizeof
(
sin
->
sin_zero
));
pol
=
(
struct
sadb_x_policy
*
)
skb_put
(
skb
,
sizeof
(
struct
sadb_x_policy
));
pol
->
sadb_x_policy_len
=
sizeof
(
struct
sadb_x_policy
)
/
sizeof
(
uint64_t
);
...
...
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