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
b7461116
Commit
b7461116
authored
Mar 02, 2003
by
James Morris
Committed by
David S. Miller
Mar 02, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPSEC]: Add family argument to compile_policy.
parent
3cbcab99
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
22 additions
and
4 deletions
+22
-4
include/net/xfrm.h
include/net/xfrm.h
+1
-1
net/ipv4/xfrm_state.c
net/ipv4/xfrm_state.c
+1
-1
net/ipv4/xfrm_user.c
net/ipv4/xfrm_user.c
+17
-1
net/key/af_key.c
net/key/af_key.c
+3
-1
No files found.
include/net/xfrm.h
View file @
b7461116
...
...
@@ -223,7 +223,7 @@ struct xfrm_mgr
char
*
id
;
int
(
*
notify
)(
struct
xfrm_state
*
x
,
int
event
);
int
(
*
acquire
)(
struct
xfrm_state
*
x
,
struct
xfrm_tmpl
*
,
struct
xfrm_policy
*
xp
,
int
dir
);
struct
xfrm_policy
*
(
*
compile_policy
)(
int
opt
,
u8
*
data
,
int
len
,
int
*
dir
);
struct
xfrm_policy
*
(
*
compile_policy
)(
u16
family
,
int
opt
,
u8
*
data
,
int
len
,
int
*
dir
);
};
extern
int
xfrm_register_km
(
struct
xfrm_mgr
*
km
);
...
...
net/ipv4/xfrm_state.c
View file @
b7461116
...
...
@@ -680,7 +680,7 @@ int xfrm_user_policy(struct sock *sk, int optname, u8 *optval, int optlen)
err
=
-
EINVAL
;
read_lock
(
&
xfrm_km_lock
);
list_for_each_entry
(
km
,
&
xfrm_km_list
,
list
)
{
pol
=
km
->
compile_policy
(
optname
,
data
,
optlen
,
&
err
);
pol
=
km
->
compile_policy
(
sk
->
family
,
optname
,
data
,
optlen
,
&
err
);
if
(
err
>=
0
)
break
;
}
...
...
net/ipv4/xfrm_user.c
View file @
b7461116
...
...
@@ -538,6 +538,21 @@ static int verify_newpolicy_info(struct xfrm_userpolicy_info *p)
return
-
EINVAL
;
};
switch
(
p
->
family
)
{
case
AF_INET
:
break
;
case
AF_INET6
:
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
break
;
#else
return
-
EAFNOSUPPORT
;
#endif
default:
return
-
EINVAL
;
};
return
verify_policy_dir
(
p
->
dir
);
}
...
...
@@ -1057,7 +1072,8 @@ static int xfrm_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *xt,
/* User gives us xfrm_user_policy_info followed by an array of 0
* or more templates.
*/
struct
xfrm_policy
*
xfrm_compile_policy
(
int
opt
,
u8
*
data
,
int
len
,
int
*
dir
)
struct
xfrm_policy
*
xfrm_compile_policy
(
u16
family
,
int
opt
,
u8
*
data
,
int
len
,
int
*
dir
)
{
struct
xfrm_userpolicy_info
*
p
=
(
struct
xfrm_userpolicy_info
*
)
data
;
struct
xfrm_user_tmpl
*
ut
=
(
struct
xfrm_user_tmpl
*
)
(
p
+
1
);
...
...
net/key/af_key.c
View file @
b7461116
...
...
@@ -2420,7 +2420,8 @@ static int pfkey_send_acquire(struct xfrm_state *x, struct xfrm_tmpl *t, struct
return
pfkey_broadcast
(
skb
,
GFP_ATOMIC
,
BROADCAST_REGISTERED
,
NULL
);
}
static
struct
xfrm_policy
*
pfkey_compile_policy
(
int
opt
,
u8
*
data
,
int
len
,
int
*
dir
)
static
struct
xfrm_policy
*
pfkey_compile_policy
(
u16
family
,
int
opt
,
u8
*
data
,
int
len
,
int
*
dir
)
{
struct
xfrm_policy
*
xp
;
struct
sadb_x_policy
*
pol
=
(
struct
sadb_x_policy
*
)
data
;
...
...
@@ -2451,6 +2452,7 @@ static struct xfrm_policy *pfkey_compile_policy(int opt, u8 *data, int len, int
xp
->
lft
.
hard_byte_limit
=
XFRM_INF
;
xp
->
lft
.
soft_packet_limit
=
XFRM_INF
;
xp
->
lft
.
hard_packet_limit
=
XFRM_INF
;
xp
->
family
=
family
;
xp
->
xfrm_nr
=
0
;
if
(
pol
->
sadb_x_policy_type
==
IPSEC_POLICY_IPSEC
&&
...
...
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