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
5f8bbb8f
Commit
5f8bbb8f
authored
Apr 12, 2003
by
James Morris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPSEC]: Fix handling of uncompressable packets in tunnel mode.
parent
002293d6
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
6 deletions
+11
-6
net/ipv4/ipcomp.c
net/ipv4/ipcomp.c
+11
-6
No files found.
net/ipv4/ipcomp.c
View file @
5f8bbb8f
...
@@ -132,8 +132,7 @@ static int ipcomp_compress(struct xfrm_state *x, struct sk_buff *skb)
...
@@ -132,8 +132,7 @@ static int ipcomp_compress(struct xfrm_state *x, struct sk_buff *skb)
return
err
;
return
err
;
}
}
static
void
ipcomp_tunnel_encap
(
struct
xfrm_state
*
x
,
static
void
ipcomp_tunnel_encap
(
struct
xfrm_state
*
x
,
struct
sk_buff
*
skb
)
struct
sk_buff
*
skb
,
int
compress
)
{
{
struct
dst_entry
*
dst
=
skb
->
dst
;
struct
dst_entry
*
dst
=
skb
->
dst
;
struct
iphdr
*
iph
,
*
top_iph
;
struct
iphdr
*
iph
,
*
top_iph
;
...
@@ -147,7 +146,6 @@ static void ipcomp_tunnel_encap(struct xfrm_state *x,
...
@@ -147,7 +146,6 @@ static void ipcomp_tunnel_encap(struct xfrm_state *x,
if
(
!
(
iph
->
frag_off
&
htons
(
IP_DF
)))
if
(
!
(
iph
->
frag_off
&
htons
(
IP_DF
)))
__ip_select_ident
(
top_iph
,
dst
,
0
);
__ip_select_ident
(
top_iph
,
dst
,
0
);
top_iph
->
ttl
=
iph
->
ttl
;
top_iph
->
ttl
=
iph
->
ttl
;
top_iph
->
protocol
=
compress
?
IPPROTO_COMP
:
IPPROTO_IPIP
;
top_iph
->
check
=
0
;
top_iph
->
check
=
0
;
top_iph
->
saddr
=
x
->
props
.
saddr
.
a4
;
top_iph
->
saddr
=
x
->
props
.
saddr
.
a4
;
top_iph
->
daddr
=
x
->
id
.
daddr
.
a4
;
top_iph
->
daddr
=
x
->
id
.
daddr
.
a4
;
...
@@ -184,15 +182,16 @@ static int ipcomp_output(struct sk_buff *skb)
...
@@ -184,15 +182,16 @@ static int ipcomp_output(struct sk_buff *skb)
/* Don't bother compressing */
/* Don't bother compressing */
if
(
skb
->
len
<
ipcd
->
threshold
)
{
if
(
skb
->
len
<
ipcd
->
threshold
)
{
if
(
x
->
props
.
mode
)
{
if
(
x
->
props
.
mode
)
{
ipcomp_tunnel_encap
(
x
,
skb
,
0
);
ipcomp_tunnel_encap
(
x
,
skb
);
iph
=
skb
->
nh
.
iph
;
iph
=
skb
->
nh
.
iph
;
iph
->
protocol
=
IPPROTO_IPIP
;
ip_send_check
(
iph
);
ip_send_check
(
iph
);
}
}
goto
out_ok
;
goto
out_ok
;
}
}
if
(
x
->
props
.
mode
)
if
(
x
->
props
.
mode
)
ipcomp_tunnel_encap
(
x
,
skb
,
1
);
ipcomp_tunnel_encap
(
x
,
skb
);
if
((
skb_is_nonlinear
(
skb
)
||
skb_cloned
(
skb
))
&&
if
((
skb_is_nonlinear
(
skb
)
||
skb_cloned
(
skb
))
&&
skb_linearize
(
skb
,
GFP_ATOMIC
)
!=
0
)
{
skb_linearize
(
skb
,
GFP_ATOMIC
)
!=
0
)
{
...
@@ -202,8 +201,14 @@ static int ipcomp_output(struct sk_buff *skb)
...
@@ -202,8 +201,14 @@ static int ipcomp_output(struct sk_buff *skb)
err
=
ipcomp_compress
(
x
,
skb
);
err
=
ipcomp_compress
(
x
,
skb
);
if
(
err
)
{
if
(
err
)
{
if
(
err
==
-
EMSGSIZE
)
if
(
err
==
-
EMSGSIZE
)
{
if
(
x
->
props
.
mode
)
{
iph
=
skb
->
nh
.
iph
;
iph
->
protocol
=
IPPROTO_IPIP
;
ip_send_check
(
iph
);
}
goto
out_ok
;
goto
out_ok
;
}
goto
error
;
goto
error
;
}
}
...
...
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