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
e76726c2
Commit
e76726c2
authored
Mar 20, 2003
by
Tom Lendacky
Committed by
David S. Miller
Mar 20, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPSEC]: Add IPV6_{IPSEC,XFRM}_POLICY socket option support.
parent
c667ab2c
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
43 additions
and
4 deletions
+43
-4
include/linux/in6.h
include/linux/in6.h
+3
-0
net/ipv4/xfrm_user.c
net/ipv4/xfrm_user.c
+18
-2
net/ipv6/ipv6_sockglue.c
net/ipv6/ipv6_sockglue.c
+5
-0
net/key/af_key.c
net/key/af_key.c
+17
-2
No files found.
include/linux/in6.h
View file @
e76726c2
...
...
@@ -180,5 +180,8 @@ struct in6_flowlabel_req
#define IPV6_FLOWLABEL_MGR 32
#define IPV6_FLOWINFO_SEND 33
#define IPV6_IPSEC_POLICY 34
#define IPV6_XFRM_POLICY 35
#endif
net/ipv4/xfrm_user.c
View file @
e76726c2
...
...
@@ -1086,10 +1086,26 @@ struct xfrm_policy *xfrm_compile_policy(u16 family, int opt,
struct
xfrm_policy
*
xp
;
int
nr
;
if
(
opt
!=
IP_XFRM_POLICY
)
{
*
dir
=
-
EOPNOTSUPP
;
switch
(
family
)
{
case
AF_INET
:
if
(
opt
!=
IP_XFRM_POLICY
)
{
*
dir
=
-
EOPNOTSUPP
;
return
NULL
;
}
break
;
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
case
AF_INET6
:
if
(
opt
!=
IPV6_XFRM_POLICY
)
{
*
dir
=
-
EOPNOTSUPP
;
return
NULL
;
}
break
;
#endif
default:
*
dir
=
-
EINVAL
;
return
NULL
;
}
*
dir
=
-
EINVAL
;
if
(
len
<
sizeof
(
*
p
)
||
...
...
net/ipv6/ipv6_sockglue.c
View file @
e76726c2
...
...
@@ -47,6 +47,7 @@
#include <net/inet_common.h>
#include <net/tcp.h>
#include <net/udp.h>
#include <net/xfrm.h>
#include <asm/uaccess.h>
...
...
@@ -404,6 +405,10 @@ int ipv6_setsockopt(struct sock *sk, int level, int optname, char *optval,
case
IPV6_FLOWLABEL_MGR
:
retv
=
ipv6_flowlabel_opt
(
sk
,
optval
,
optlen
);
break
;
case
IPV6_IPSEC_POLICY
:
case
IPV6_XFRM_POLICY
:
retv
=
xfrm_user_policy
(
sk
,
optname
,
optval
,
optlen
);
break
;
#ifdef CONFIG_NETFILTER
default:
...
...
net/key/af_key.c
View file @
e76726c2
...
...
@@ -2416,8 +2416,23 @@ static struct xfrm_policy *pfkey_compile_policy(u16 family, int opt,
struct
xfrm_policy
*
xp
;
struct
sadb_x_policy
*
pol
=
(
struct
sadb_x_policy
*
)
data
;
if
(
opt
!=
IP_IPSEC_POLICY
)
{
*
dir
=
-
EOPNOTSUPP
;
switch
(
family
)
{
case
AF_INET
:
if
(
opt
!=
IP_IPSEC_POLICY
)
{
*
dir
=
-
EOPNOTSUPP
;
return
NULL
;
}
break
;
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
case
AF_INET6
:
if
(
opt
!=
IPV6_IPSEC_POLICY
)
{
*
dir
=
-
EOPNOTSUPP
;
return
NULL
;
}
break
;
#endif
default:
*
dir
=
-
EINVAL
;
return
NULL
;
}
...
...
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