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
0d88c833
Commit
0d88c833
authored
Nov 20, 2002
by
David S. Miller
Committed by
Jeff Garzik
Nov 20, 2002
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[XFRM_USER]: Index xfrma array correctly.
parent
2cc7289b
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
14 additions
and
14 deletions
+14
-14
net/ipv4/xfrm_user.c
net/ipv4/xfrm_user.c
+14
-14
No files found.
net/ipv4/xfrm_user.c
View file @
0d88c833
...
@@ -23,7 +23,7 @@ static struct sock *xfrm_nl;
...
@@ -23,7 +23,7 @@ static struct sock *xfrm_nl;
static
int
verify_one_alg
(
struct
rtattr
**
xfrma
,
enum
xfrm_attr_type_t
type
)
static
int
verify_one_alg
(
struct
rtattr
**
xfrma
,
enum
xfrm_attr_type_t
type
)
{
{
struct
rtattr
*
rt
=
xfrma
[
type
];
struct
rtattr
*
rt
=
xfrma
[
type
-
1
];
struct
xfrm_algo
*
algp
;
struct
xfrm_algo
*
algp
;
if
(
!
rt
)
if
(
!
rt
)
...
@@ -73,23 +73,23 @@ static int verify_newsa_info(struct xfrm_usersa_info *p,
...
@@ -73,23 +73,23 @@ static int verify_newsa_info(struct xfrm_usersa_info *p,
err
=
-
EINVAL
;
err
=
-
EINVAL
;
switch
(
p
->
id
.
proto
)
{
switch
(
p
->
id
.
proto
)
{
case
IPPROTO_AH
:
case
IPPROTO_AH
:
if
(
!
xfrma
[
XFRMA_ALG_AUTH
]
||
if
(
!
xfrma
[
XFRMA_ALG_AUTH
-
1
]
||
xfrma
[
XFRMA_ALG_CRYPT
]
||
xfrma
[
XFRMA_ALG_CRYPT
-
1
]
||
xfrma
[
XFRMA_ALG_COMP
])
xfrma
[
XFRMA_ALG_COMP
-
1
])
goto
out
;
goto
out
;
break
;
break
;
case
IPPROTO_ESP
:
case
IPPROTO_ESP
:
if
((
!
xfrma
[
XFRMA_ALG_AUTH
]
&&
if
((
!
xfrma
[
XFRMA_ALG_AUTH
-
1
]
&&
!
xfrma
[
XFRMA_ALG_CRYPT
])
||
!
xfrma
[
XFRMA_ALG_CRYPT
-
1
])
||
xfrma
[
XFRMA_ALG_COMP
])
xfrma
[
XFRMA_ALG_COMP
-
1
])
goto
out
;
goto
out
;
break
;
break
;
case
IPPROTO_COMP
:
case
IPPROTO_COMP
:
if
(
!
xfrma
[
XFRMA_ALG_COMP
]
||
if
(
!
xfrma
[
XFRMA_ALG_COMP
-
1
]
||
xfrma
[
XFRMA_ALG_AUTH
]
||
xfrma
[
XFRMA_ALG_AUTH
-
1
]
||
xfrma
[
XFRMA_ALG_CRYPT
])
xfrma
[
XFRMA_ALG_CRYPT
-
1
])
goto
out
;
goto
out
;
break
;
break
;
...
@@ -162,11 +162,11 @@ static struct xfrm_state *xfrm_state_construct(struct xfrm_usersa_info *p,
...
@@ -162,11 +162,11 @@ static struct xfrm_state *xfrm_state_construct(struct xfrm_usersa_info *p,
copy_from_user_state
(
x
,
p
);
copy_from_user_state
(
x
,
p
);
if
((
err
=
attach_one_algo
(
&
x
->
aalg
,
xfrma
[
XFRMA_ALG_AUTH
])))
if
((
err
=
attach_one_algo
(
&
x
->
aalg
,
xfrma
[
XFRMA_ALG_AUTH
-
1
])))
goto
error
;
goto
error
;
if
((
err
=
attach_one_algo
(
&
x
->
ealg
,
xfrma
[
XFRMA_ALG_CRYPT
])))
if
((
err
=
attach_one_algo
(
&
x
->
ealg
,
xfrma
[
XFRMA_ALG_CRYPT
-
1
])))
goto
error
;
goto
error
;
if
((
err
=
attach_one_algo
(
&
x
->
calg
,
xfrma
[
XFRMA_ALG_COMP
])))
if
((
err
=
attach_one_algo
(
&
x
->
calg
,
xfrma
[
XFRMA_ALG_COMP
-
1
])))
goto
error
;
goto
error
;
err
=
-
ENOENT
;
err
=
-
ENOENT
;
...
@@ -485,7 +485,7 @@ static void copy_templates(struct xfrm_policy *xp, struct xfrm_user_tmpl *ut,
...
@@ -485,7 +485,7 @@ static void copy_templates(struct xfrm_policy *xp, struct xfrm_user_tmpl *ut,
static
int
copy_user_tmpl
(
struct
xfrm_policy
*
pol
,
struct
rtattr
**
xfrma
)
static
int
copy_user_tmpl
(
struct
xfrm_policy
*
pol
,
struct
rtattr
**
xfrma
)
{
{
struct
rtattr
*
rt
=
xfrma
[
XFRMA_TMPL
];
struct
rtattr
*
rt
=
xfrma
[
XFRMA_TMPL
-
1
];
struct
xfrm_user_tmpl
*
utmpl
;
struct
xfrm_user_tmpl
*
utmpl
;
int
nr
;
int
nr
;
...
...
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