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
c46236ee
Commit
c46236ee
authored
Jul 20, 2003
by
Herbert Xu
Committed by
David S. Miller
Jul 20, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPSEC]: Make reqids 32-bits.
parent
94c3cc00
Changes
7
Show whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
18 additions
and
15 deletions
+18
-15
include/linux/pfkeyv2.h
include/linux/pfkeyv2.h
+3
-1
include/linux/xfrm.h
include/linux/xfrm.h
+2
-2
include/net/xfrm.h
include/net/xfrm.h
+4
-4
net/ipv4/xfrm4_state.c
net/ipv4/xfrm4_state.c
+1
-1
net/ipv6/xfrm6_state.c
net/ipv6/xfrm6_state.c
+1
-1
net/key/af_key.c
net/key/af_key.c
+6
-5
net/xfrm/xfrm_state.c
net/xfrm/xfrm_state.c
+1
-1
No files found.
include/linux/pfkeyv2.h
View file @
c46236ee
...
@@ -190,7 +190,9 @@ struct sadb_x_ipsecrequest {
...
@@ -190,7 +190,9 @@ struct sadb_x_ipsecrequest {
uint16_t
sadb_x_ipsecrequest_proto
;
uint16_t
sadb_x_ipsecrequest_proto
;
uint8_t
sadb_x_ipsecrequest_mode
;
uint8_t
sadb_x_ipsecrequest_mode
;
uint8_t
sadb_x_ipsecrequest_level
;
uint8_t
sadb_x_ipsecrequest_level
;
uint16_t
sadb_x_ipsecrequest_reqid
;
uint16_t
sadb_x_ipsecrequest_reserved1
;
uint32_t
sadb_x_ipsecrequest_reqid
;
uint32_t
sadb_x_ipsecrequest_reserved2
;
}
__attribute__
((
packed
));
}
__attribute__
((
packed
));
/* sizeof(struct sadb_x_ipsecrequest) == 16 */
/* sizeof(struct sadb_x_ipsecrequest) == 16 */
...
...
include/linux/xfrm.h
View file @
c46236ee
...
@@ -126,7 +126,7 @@ enum
...
@@ -126,7 +126,7 @@ enum
struct
xfrm_user_tmpl
{
struct
xfrm_user_tmpl
{
struct
xfrm_id
id
;
struct
xfrm_id
id
;
xfrm_address_t
saddr
;
xfrm_address_t
saddr
;
__u
16
reqid
;
__u
32
reqid
;
__u8
mode
;
__u8
mode
;
__u8
share
;
__u8
share
;
__u8
optional
;
__u8
optional
;
...
@@ -162,8 +162,8 @@ struct xfrm_usersa_info {
...
@@ -162,8 +162,8 @@ struct xfrm_usersa_info {
struct
xfrm_lifetime_cur
curlft
;
struct
xfrm_lifetime_cur
curlft
;
struct
xfrm_stats
stats
;
struct
xfrm_stats
stats
;
__u32
seq
;
__u32
seq
;
__u32
reqid
;
__u16
family
;
__u16
family
;
__u16
reqid
;
__u8
mode
;
/* 0=transport,1=tunnel */
__u8
mode
;
/* 0=transport,1=tunnel */
__u8
replay_window
;
__u8
replay_window
;
};
};
...
...
include/net/xfrm.h
View file @
c46236ee
...
@@ -104,10 +104,10 @@ struct xfrm_state
...
@@ -104,10 +104,10 @@ struct xfrm_state
/* Parameters of this state. */
/* Parameters of this state. */
struct
{
struct
{
u32
reqid
;
u8
mode
;
u8
mode
;
u8
replay_window
;
u8
replay_window
;
u8
aalgo
,
ealgo
,
calgo
;
u8
aalgo
,
ealgo
,
calgo
;
u16
reqid
;
u16
family
;
u16
family
;
xfrm_address_t
saddr
;
xfrm_address_t
saddr
;
int
header_len
;
int
header_len
;
...
@@ -193,7 +193,7 @@ struct xfrm_state_afinfo {
...
@@ -193,7 +193,7 @@ struct xfrm_state_afinfo {
struct
xfrm_tmpl
*
tmpl
,
struct
xfrm_tmpl
*
tmpl
,
xfrm_address_t
*
daddr
,
xfrm_address_t
*
saddr
);
xfrm_address_t
*
daddr
,
xfrm_address_t
*
saddr
);
struct
xfrm_state
*
(
*
state_lookup
)(
xfrm_address_t
*
daddr
,
u32
spi
,
u8
proto
);
struct
xfrm_state
*
(
*
state_lookup
)(
xfrm_address_t
*
daddr
,
u32
spi
,
u8
proto
);
struct
xfrm_state
*
(
*
find_acq
)(
u8
mode
,
u
16
reqid
,
u8
proto
,
struct
xfrm_state
*
(
*
find_acq
)(
u8
mode
,
u
32
reqid
,
u8
proto
,
xfrm_address_t
*
daddr
,
xfrm_address_t
*
saddr
,
xfrm_address_t
*
daddr
,
xfrm_address_t
*
saddr
,
int
create
);
int
create
);
};
};
...
@@ -244,7 +244,7 @@ struct xfrm_tmpl
...
@@ -244,7 +244,7 @@ struct xfrm_tmpl
/* Source address of tunnel. Ignored, if it is not a tunnel. */
/* Source address of tunnel. Ignored, if it is not a tunnel. */
xfrm_address_t
saddr
;
xfrm_address_t
saddr
;
__u
16
reqid
;
__u
32
reqid
;
/* Mode: transport/tunnel */
/* Mode: transport/tunnel */
__u8
mode
;
__u8
mode
;
...
@@ -801,7 +801,7 @@ struct xfrm_policy *xfrm_policy_byid(int dir, u32 id, int delete);
...
@@ -801,7 +801,7 @@ struct xfrm_policy *xfrm_policy_byid(int dir, u32 id, int delete);
void
xfrm_policy_flush
(
void
);
void
xfrm_policy_flush
(
void
);
u32
xfrm_get_acqseq
(
void
);
u32
xfrm_get_acqseq
(
void
);
void
xfrm_alloc_spi
(
struct
xfrm_state
*
x
,
u32
minspi
,
u32
maxspi
);
void
xfrm_alloc_spi
(
struct
xfrm_state
*
x
,
u32
minspi
,
u32
maxspi
);
struct
xfrm_state
*
xfrm_find_acq
(
u8
mode
,
u
16
reqid
,
u8
proto
,
struct
xfrm_state
*
xfrm_find_acq
(
u8
mode
,
u
32
reqid
,
u8
proto
,
xfrm_address_t
*
daddr
,
xfrm_address_t
*
saddr
,
xfrm_address_t
*
daddr
,
xfrm_address_t
*
saddr
,
int
create
,
unsigned
short
family
);
int
create
,
unsigned
short
family
);
extern
void
xfrm_policy_flush
(
void
);
extern
void
xfrm_policy_flush
(
void
);
...
...
net/ipv4/xfrm4_state.c
View file @
c46236ee
...
@@ -58,7 +58,7 @@ __xfrm4_state_lookup(xfrm_address_t *daddr, u32 spi, u8 proto)
...
@@ -58,7 +58,7 @@ __xfrm4_state_lookup(xfrm_address_t *daddr, u32 spi, u8 proto)
}
}
static
struct
xfrm_state
*
static
struct
xfrm_state
*
__xfrm4_find_acq
(
u8
mode
,
u
16
reqid
,
u8
proto
,
__xfrm4_find_acq
(
u8
mode
,
u
32
reqid
,
u8
proto
,
xfrm_address_t
*
daddr
,
xfrm_address_t
*
saddr
,
xfrm_address_t
*
daddr
,
xfrm_address_t
*
saddr
,
int
create
)
int
create
)
{
{
...
...
net/ipv6/xfrm6_state.c
View file @
c46236ee
...
@@ -65,7 +65,7 @@ __xfrm6_state_lookup(xfrm_address_t *daddr, u32 spi, u8 proto)
...
@@ -65,7 +65,7 @@ __xfrm6_state_lookup(xfrm_address_t *daddr, u32 spi, u8 proto)
}
}
static
struct
xfrm_state
*
static
struct
xfrm_state
*
__xfrm6_find_acq
(
u8
mode
,
u
16
reqid
,
u8
proto
,
__xfrm6_find_acq
(
u8
mode
,
u
32
reqid
,
u8
proto
,
xfrm_address_t
*
daddr
,
xfrm_address_t
*
saddr
,
xfrm_address_t
*
daddr
,
xfrm_address_t
*
saddr
,
int
create
)
int
create
)
{
{
...
...
net/key/af_key.c
View file @
c46236ee
...
@@ -1099,7 +1099,7 @@ static int pfkey_getspi(struct sock *sk, struct sk_buff *skb, struct sadb_msg *h
...
@@ -1099,7 +1099,7 @@ static int pfkey_getspi(struct sock *sk, struct sk_buff *skb, struct sadb_msg *h
struct
sadb_msg
*
out_hdr
;
struct
sadb_msg
*
out_hdr
;
struct
xfrm_state
*
x
=
NULL
;
struct
xfrm_state
*
x
=
NULL
;
u8
mode
;
u8
mode
;
u
16
reqid
;
u
32
reqid
;
u8
proto
;
u8
proto
;
unsigned
short
family
;
unsigned
short
family
;
xfrm_address_t
*
xsaddr
=
NULL
,
*
xdaddr
=
NULL
;
xfrm_address_t
*
xsaddr
=
NULL
,
*
xdaddr
=
NULL
;
...
@@ -1496,7 +1496,7 @@ static int pfkey_promisc(struct sock *sk, struct sk_buff *skb, struct sadb_msg *
...
@@ -1496,7 +1496,7 @@ static int pfkey_promisc(struct sock *sk, struct sk_buff *skb, struct sadb_msg *
static
int
check_reqid
(
struct
xfrm_policy
*
xp
,
int
dir
,
int
count
,
void
*
ptr
)
static
int
check_reqid
(
struct
xfrm_policy
*
xp
,
int
dir
,
int
count
,
void
*
ptr
)
{
{
int
i
;
int
i
;
u
16
reqid
=
*
(
u16
*
)
ptr
;
u
32
reqid
=
*
(
u32
*
)
ptr
;
for
(
i
=
0
;
i
<
xp
->
xfrm_nr
;
i
++
)
{
for
(
i
=
0
;
i
<
xp
->
xfrm_nr
;
i
++
)
{
if
(
xp
->
xfrm_vec
[
i
].
reqid
==
reqid
)
if
(
xp
->
xfrm_vec
[
i
].
reqid
==
reqid
)
...
@@ -1505,10 +1505,10 @@ static int check_reqid(struct xfrm_policy *xp, int dir, int count, void *ptr)
...
@@ -1505,10 +1505,10 @@ static int check_reqid(struct xfrm_policy *xp, int dir, int count, void *ptr)
return
0
;
return
0
;
}
}
static
u
16
gen_reqid
(
void
)
static
u
32
gen_reqid
(
void
)
{
{
u
16
start
;
u
32
start
;
static
u
16
reqid
=
IPSEC_MANUAL_REQID_MAX
;
static
u
32
reqid
=
IPSEC_MANUAL_REQID_MAX
;
start
=
reqid
;
start
=
reqid
;
do
{
do
{
...
@@ -1771,6 +1771,7 @@ static void pfkey_xfrm_policy2msg(struct sk_buff *skb, struct xfrm_policy *xp, i
...
@@ -1771,6 +1771,7 @@ static void pfkey_xfrm_policy2msg(struct sk_buff *skb, struct xfrm_policy *xp, i
size
-=
2
*
socklen
;
size
-=
2
*
socklen
;
rq
=
(
void
*
)
skb_put
(
skb
,
req_size
);
rq
=
(
void
*
)
skb_put
(
skb
,
req_size
);
pol
->
sadb_x_policy_len
+=
req_size
/
8
;
pol
->
sadb_x_policy_len
+=
req_size
/
8
;
memset
(
rq
,
0
,
sizeof
(
*
rq
));
rq
->
sadb_x_ipsecrequest_len
=
req_size
;
rq
->
sadb_x_ipsecrequest_len
=
req_size
;
rq
->
sadb_x_ipsecrequest_proto
=
t
->
id
.
proto
;
rq
->
sadb_x_ipsecrequest_proto
=
t
->
id
.
proto
;
rq
->
sadb_x_ipsecrequest_mode
=
t
->
mode
+
1
;
rq
->
sadb_x_ipsecrequest_mode
=
t
->
mode
+
1
;
...
...
net/xfrm/xfrm_state.c
View file @
c46236ee
...
@@ -554,7 +554,7 @@ xfrm_state_lookup(xfrm_address_t *daddr, u32 spi, u8 proto,
...
@@ -554,7 +554,7 @@ xfrm_state_lookup(xfrm_address_t *daddr, u32 spi, u8 proto,
}
}
struct
xfrm_state
*
struct
xfrm_state
*
xfrm_find_acq
(
u8
mode
,
u
16
reqid
,
u8
proto
,
xfrm_find_acq
(
u8
mode
,
u
32
reqid
,
u8
proto
,
xfrm_address_t
*
daddr
,
xfrm_address_t
*
saddr
,
xfrm_address_t
*
daddr
,
xfrm_address_t
*
saddr
,
int
create
,
unsigned
short
family
)
int
create
,
unsigned
short
family
)
{
{
...
...
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