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
1518d875
Commit
1518d875
authored
Apr 02, 2003
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPSEC]: Clean up decap state, minimize its size.
parent
a27a61ff
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
17 additions
and
8 deletions
+17
-8
include/net/xfrm.h
include/net/xfrm.h
+1
-1
net/ipv4/esp.c
net/ipv4/esp.c
+16
-7
No files found.
include/net/xfrm.h
View file @
1518d875
...
@@ -509,8 +509,8 @@ struct xfrm_dst
...
@@ -509,8 +509,8 @@ struct xfrm_dst
* check
* check
*/
*/
struct
xfrm_decap_state
{
struct
xfrm_decap_state
{
char
decap_data
[
20
];
__u16
decap_type
;
__u16
decap_type
;
char
decap_data
[
30
];
};
};
struct
sec_decap_state
{
struct
sec_decap_state
{
...
...
net/ipv4/esp.c
View file @
1518d875
...
@@ -12,11 +12,11 @@
...
@@ -12,11 +12,11 @@
#define MAX_SG_ONSTACK 4
#define MAX_SG_ONSTACK 4
/* encapsulation data for use when post-processing the decapsulation */
/* decapsulation data for use when post-processing */
struct
esp_encap_data
{
struct
esp_decap_data
{
__u8
proto
;
xfrm_address_t
saddr
;
xfrm_address_t
saddr
;
__u16
sport
;
__u16
sport
;
__u8
proto
;
};
};
int
esp_output
(
struct
sk_buff
*
skb
)
int
esp_output
(
struct
sk_buff
*
skb
)
...
@@ -285,10 +285,10 @@ int esp_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struct sk_bu
...
@@ -285,10 +285,10 @@ int esp_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struct sk_bu
/* ... check padding bits here. Silly. :-) */
/* ... check padding bits here. Silly. :-) */
if
(
x
->
encap
&&
decap
&&
decap
->
decap_type
)
{
if
(
x
->
encap
&&
decap
&&
decap
->
decap_type
)
{
struct
esp_
en
cap_data
*
encap_data
;
struct
esp_
de
cap_data
*
encap_data
;
struct
udphdr
*
uh
=
(
struct
udphdr
*
)
(
iph
+
1
);
struct
udphdr
*
uh
=
(
struct
udphdr
*
)
(
iph
+
1
);
encap_data
=
(
struct
esp_
en
cap_data
*
)
(
decap
->
decap_data
);
encap_data
=
(
struct
esp_
de
cap_data
*
)
(
decap
->
decap_data
);
encap_data
->
proto
=
0
;
encap_data
->
proto
=
0
;
switch
(
decap
->
decap_type
)
{
switch
(
decap
->
decap_type
)
{
...
@@ -338,10 +338,10 @@ int esp_post_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struct
...
@@ -338,10 +338,10 @@ int esp_post_input(struct xfrm_state *x, struct xfrm_decap_state *decap, struct
if
(
x
->
encap
)
{
if
(
x
->
encap
)
{
struct
xfrm_encap_tmpl
*
encap
;
struct
xfrm_encap_tmpl
*
encap
;
struct
esp_
en
cap_data
*
decap_data
;
struct
esp_
de
cap_data
*
decap_data
;
encap
=
x
->
encap
;
encap
=
x
->
encap
;
decap_data
=
(
struct
esp_
en
cap_data
*
)(
decap
->
decap_data
);
decap_data
=
(
struct
esp_
de
cap_data
*
)(
decap
->
decap_data
);
/* first, make sure that the decap type == the encap type */
/* first, make sure that the decap type == the encap type */
if
(
encap
->
encap_type
!=
decap
->
decap_type
)
if
(
encap
->
encap_type
!=
decap
->
decap_type
)
...
@@ -569,6 +569,15 @@ static struct inet_protocol esp4_protocol = {
...
@@ -569,6 +569,15 @@ static struct inet_protocol esp4_protocol = {
int
__init
esp4_init
(
void
)
int
__init
esp4_init
(
void
)
{
{
struct
xfrm_decap_state
decap
;
if
(
sizeof
(
struct
esp_decap_data
)
<
sizeof
(
decap
.
decap_data
))
{
extern
void
decap_data_too_small
(
void
);
decap_data_too_small
();
}
SET_MODULE_OWNER
(
&
esp_type
);
SET_MODULE_OWNER
(
&
esp_type
);
if
(
xfrm_register_type
(
&
esp_type
,
AF_INET
)
<
0
)
{
if
(
xfrm_register_type
(
&
esp_type
,
AF_INET
)
<
0
)
{
printk
(
KERN_INFO
"ip esp init: can't add xfrm type
\n
"
);
printk
(
KERN_INFO
"ip esp init: can't add xfrm type
\n
"
);
...
...
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