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
35c353ea
Commit
35c353ea
authored
Mar 30, 2003
by
Tom Lendacky
Committed by
David S. Miller
Mar 30, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPSEC]: Use "sizeof" for header sizes.
parent
101f27ac
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
6 additions
and
6 deletions
+6
-6
net/ipv4/ah.c
net/ipv4/ah.c
+3
-3
net/ipv4/esp.c
net/ipv4/esp.c
+1
-1
net/ipv6/ah6.c
net/ipv6/ah6.c
+1
-1
net/ipv6/esp6.c
net/ipv6/esp6.c
+1
-1
No files found.
net/ipv4/ah.c
View file @
35c353ea
...
...
@@ -18,7 +18,7 @@
static
int
ip_clear_mutable_options
(
struct
iphdr
*
iph
,
u32
*
daddr
)
{
unsigned
char
*
optptr
=
(
unsigned
char
*
)(
iph
+
1
);
int
l
=
iph
->
ihl
*
4
-
20
;
int
l
=
iph
->
ihl
*
4
-
sizeof
(
struct
iphdr
)
;
int
optlen
;
while
(
l
>
0
)
{
...
...
@@ -132,7 +132,7 @@ static int ah_output(struct sk_buff *skb)
top_iph
->
frag_off
=
iph
->
frag_off
;
top_iph
->
daddr
=
iph
->
daddr
;
if
(
iph
->
ihl
!=
5
)
memcpy
(
top_iph
+
1
,
iph
+
1
,
iph
->
ihl
*
5
-
20
);
memcpy
(
top_iph
+
1
,
iph
+
1
,
iph
->
ihl
*
4
-
sizeof
(
struct
iphdr
)
);
}
ip_send_check
(
top_iph
);
...
...
@@ -288,7 +288,7 @@ static int ah_init_state(struct xfrm_state *x, void *args)
x
->
props
.
header_len
=
XFRM_ALIGN8
(
ahp
->
icv_trunc_len
+
AH_HLEN_NOICV
);
if
(
x
->
props
.
mode
)
x
->
props
.
header_len
+=
20
;
x
->
props
.
header_len
+=
sizeof
(
struct
iphdr
)
;
x
->
data
=
ahp
;
return
0
;
...
...
net/ipv4/esp.c
View file @
35c353ea
...
...
@@ -367,7 +367,7 @@ int esp_init_state(struct xfrm_state *x, void *args)
crypto_cipher_setkey
(
esp
->
conf
.
tfm
,
esp
->
conf
.
key
,
esp
->
conf
.
key_len
);
x
->
props
.
header_len
=
8
+
esp
->
conf
.
ivlen
;
if
(
x
->
props
.
mode
)
x
->
props
.
header_len
+=
20
;
x
->
props
.
header_len
+=
sizeof
(
struct
iphdr
)
;
x
->
data
=
esp
;
x
->
props
.
trailer_len
=
esp4_get_max_size
(
x
,
0
)
-
x
->
props
.
header_len
;
return
0
;
...
...
net/ipv6/ah6.c
View file @
35c353ea
...
...
@@ -287,7 +287,7 @@ static int ah6_init_state(struct xfrm_state *x, void *args)
x
->
props
.
header_len
=
XFRM_ALIGN8
(
ahp
->
icv_trunc_len
+
AH_HLEN_NOICV
);
if
(
x
->
props
.
mode
)
x
->
props
.
header_len
+=
40
;
x
->
props
.
header_len
+=
sizeof
(
struct
ipv6hdr
)
;
x
->
data
=
ahp
;
return
0
;
...
...
net/ipv6/esp6.c
View file @
35c353ea
...
...
@@ -468,7 +468,7 @@ int esp6_init_state(struct xfrm_state *x, void *args)
crypto_cipher_setkey
(
esp
->
conf
.
tfm
,
esp
->
conf
.
key
,
esp
->
conf
.
key_len
);
x
->
props
.
header_len
=
8
+
esp
->
conf
.
ivlen
;
if
(
x
->
props
.
mode
)
x
->
props
.
header_len
+=
40
;
/* XXX ext hdr */
x
->
props
.
header_len
+=
sizeof
(
struct
ipv6hdr
);
x
->
data
=
esp
;
return
0
;
...
...
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