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
9f8fbf30
Commit
9f8fbf30
authored
Apr 30, 2003
by
James Morris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPSEC]: pmtu discovery support at local tunnel gateway.
parent
700a4acb
Changes
7
Hide whitespace changes
Inline
Side-by-side
Showing
7 changed files
with
46 additions
and
2 deletions
+46
-2
include/net/ip.h
include/net/ip.h
+1
-0
include/net/xfrm.h
include/net/xfrm.h
+1
-0
net/ipv4/ah.c
net/ipv4/ah.c
+3
-0
net/ipv4/esp.c
net/ipv4/esp.c
+3
-0
net/ipv4/ipcomp.c
net/ipv4/ipcomp.c
+3
-0
net/ipv4/xfrm4_tunnel.c
net/ipv4/xfrm4_tunnel.c
+34
-2
net/netsyms.c
net/netsyms.c
+1
-0
No files found.
include/net/ip.h
View file @
9f8fbf30
...
@@ -47,6 +47,7 @@ struct inet_skb_parm
...
@@ -47,6 +47,7 @@ struct inet_skb_parm
#define IPSKB_MASQUERADED 1
#define IPSKB_MASQUERADED 1
#define IPSKB_TRANSLATED 2
#define IPSKB_TRANSLATED 2
#define IPSKB_FORWARDED 4
#define IPSKB_FORWARDED 4
#define IPSKB_XFRM_TUNNEL_SIZE 8
};
};
struct
ipcm_cookie
struct
ipcm_cookie
...
...
include/net/xfrm.h
View file @
9f8fbf30
...
@@ -760,6 +760,7 @@ extern int xfrm4_rcv(struct sk_buff *skb);
...
@@ -760,6 +760,7 @@ extern int xfrm4_rcv(struct sk_buff *skb);
extern
int
xfrm4_rcv_encap
(
struct
sk_buff
*
skb
,
__u16
encap_type
);
extern
int
xfrm4_rcv_encap
(
struct
sk_buff
*
skb
,
__u16
encap_type
);
extern
int
xfrm4_tunnel_register
(
struct
xfrm_tunnel
*
handler
);
extern
int
xfrm4_tunnel_register
(
struct
xfrm_tunnel
*
handler
);
extern
int
xfrm4_tunnel_deregister
(
struct
xfrm_tunnel
*
handler
);
extern
int
xfrm4_tunnel_deregister
(
struct
xfrm_tunnel
*
handler
);
extern
int
xfrm4_tunnel_check_size
(
struct
sk_buff
*
skb
);
extern
int
xfrm6_rcv
(
struct
sk_buff
**
pskb
,
unsigned
int
*
nhoffp
);
extern
int
xfrm6_rcv
(
struct
sk_buff
**
pskb
,
unsigned
int
*
nhoffp
);
extern
int
xfrm6_clear_mutable_options
(
struct
sk_buff
*
skb
,
u16
*
nh_offset
,
int
dir
);
extern
int
xfrm6_clear_mutable_options
(
struct
sk_buff
*
skb
,
u16
*
nh_offset
,
int
dir
);
extern
int
xfrm_user_policy
(
struct
sock
*
sk
,
int
optname
,
u8
*
optval
,
int
optlen
);
extern
int
xfrm_user_policy
(
struct
sock
*
sk
,
int
optname
,
u8
*
optval
,
int
optlen
);
...
...
net/ipv4/ah.c
View file @
9f8fbf30
...
@@ -74,6 +74,9 @@ static int ah_output(struct sk_buff *skb)
...
@@ -74,6 +74,9 @@ static int ah_output(struct sk_buff *skb)
spin_lock_bh
(
&
x
->
lock
);
spin_lock_bh
(
&
x
->
lock
);
if
((
err
=
xfrm_state_check_expire
(
x
))
!=
0
)
if
((
err
=
xfrm_state_check_expire
(
x
))
!=
0
)
goto
error
;
goto
error
;
if
(
x
->
props
.
mode
)
if
((
err
=
xfrm4_tunnel_check_size
(
skb
))
!=
0
)
goto
error
;
if
((
err
=
xfrm_state_check_space
(
x
,
skb
))
!=
0
)
if
((
err
=
xfrm_state_check_space
(
x
,
skb
))
!=
0
)
goto
error
;
goto
error
;
...
...
net/ipv4/esp.c
View file @
9f8fbf30
...
@@ -49,6 +49,9 @@ int esp_output(struct sk_buff *skb)
...
@@ -49,6 +49,9 @@ int esp_output(struct sk_buff *skb)
spin_lock_bh
(
&
x
->
lock
);
spin_lock_bh
(
&
x
->
lock
);
if
((
err
=
xfrm_state_check_expire
(
x
))
!=
0
)
if
((
err
=
xfrm_state_check_expire
(
x
))
!=
0
)
goto
error
;
goto
error
;
if
(
x
->
props
.
mode
)
if
((
err
=
xfrm4_tunnel_check_size
(
skb
))
!=
0
)
goto
error
;
if
((
err
=
xfrm_state_check_space
(
x
,
skb
))
!=
0
)
if
((
err
=
xfrm_state_check_space
(
x
,
skb
))
!=
0
)
goto
error
;
goto
error
;
...
...
net/ipv4/ipcomp.c
View file @
9f8fbf30
...
@@ -176,6 +176,9 @@ static int ipcomp_output(struct sk_buff *skb)
...
@@ -176,6 +176,9 @@ static int ipcomp_output(struct sk_buff *skb)
if
((
err
=
xfrm_state_check_expire
(
x
))
!=
0
)
if
((
err
=
xfrm_state_check_expire
(
x
))
!=
0
)
goto
error
;
goto
error
;
if
(
x
->
props
.
mode
)
if
((
err
=
xfrm4_tunnel_check_size
(
skb
))
!=
0
)
goto
error
;
if
((
err
=
xfrm_state_check_space
(
x
,
skb
))
!=
0
)
if
((
err
=
xfrm_state_check_space
(
x
,
skb
))
!=
0
)
goto
error
;
goto
error
;
...
...
net/ipv4/xfrm4_tunnel.c
View file @
9f8fbf30
...
@@ -9,13 +9,40 @@
...
@@ -9,13 +9,40 @@
#include <net/icmp.h>
#include <net/icmp.h>
#include <net/inet_ecn.h>
#include <net/inet_ecn.h>
int
xfrm4_tunnel_check_size
(
struct
sk_buff
*
skb
)
{
int
mtu
,
ret
=
0
;
struct
dst_entry
*
dst
;
struct
iphdr
*
iph
=
skb
->
nh
.
iph
;
if
(
IPCB
(
skb
)
->
flags
&
IPSKB_XFRM_TUNNEL_SIZE
)
goto
out
;
IPCB
(
skb
)
->
flags
|=
IPSKB_XFRM_TUNNEL_SIZE
;
if
(
!
(
iph
->
frag_off
&
htons
(
IP_DF
)))
goto
out
;
dst
=
skb
->
dst
;
mtu
=
dst_pmtu
(
dst
)
-
dst
->
header_len
-
dst
->
trailer_len
;
if
(
skb
->
len
>
mtu
)
{
icmp_send
(
skb
,
ICMP_DEST_UNREACH
,
ICMP_FRAG_NEEDED
,
htonl
(
mtu
));
ret
=
-
EMSGSIZE
;
}
out:
return
ret
;
}
static
int
ipip_output
(
struct
sk_buff
*
skb
)
static
int
ipip_output
(
struct
sk_buff
*
skb
)
{
{
struct
dst_entry
*
dst
=
skb
->
dst
;
struct
dst_entry
*
dst
=
skb
->
dst
;
struct
xfrm_state
*
x
=
dst
->
xfrm
;
struct
xfrm_state
*
x
=
dst
->
xfrm
;
struct
iphdr
*
iph
,
*
top_iph
;
struct
iphdr
*
iph
,
*
top_iph
;
int
tos
;
int
tos
,
err
;
if
((
err
=
xfrm4_tunnel_check_size
(
skb
))
!=
0
)
goto
error_nolock
;
iph
=
skb
->
nh
.
iph
;
iph
=
skb
->
nh
.
iph
;
spin_lock_bh
(
&
x
->
lock
);
spin_lock_bh
(
&
x
->
lock
);
...
@@ -46,9 +73,14 @@ static int ipip_output(struct sk_buff *skb)
...
@@ -46,9 +73,14 @@ static int ipip_output(struct sk_buff *skb)
if
((
skb
->
dst
=
dst_pop
(
dst
))
==
NULL
)
{
if
((
skb
->
dst
=
dst_pop
(
dst
))
==
NULL
)
{
kfree_skb
(
skb
);
kfree_skb
(
skb
);
return
-
EHOSTUNREACH
;
err
=
-
EHOSTUNREACH
;
goto
error_nolock
;
}
}
return
NET_XMIT_BYPASS
;
return
NET_XMIT_BYPASS
;
error_nolock:
kfree_skb
(
skb
);
return
err
;
}
}
static
inline
void
ipip_ecn_decapsulate
(
struct
iphdr
*
outer_iph
,
struct
sk_buff
*
skb
)
static
inline
void
ipip_ecn_decapsulate
(
struct
iphdr
*
outer_iph
,
struct
sk_buff
*
skb
)
...
...
net/netsyms.c
View file @
9f8fbf30
...
@@ -320,6 +320,7 @@ EXPORT_SYMBOL(xfrm_parse_spi);
...
@@ -320,6 +320,7 @@ EXPORT_SYMBOL(xfrm_parse_spi);
EXPORT_SYMBOL
(
xfrm4_rcv
);
EXPORT_SYMBOL
(
xfrm4_rcv
);
EXPORT_SYMBOL
(
xfrm4_tunnel_register
);
EXPORT_SYMBOL
(
xfrm4_tunnel_register
);
EXPORT_SYMBOL
(
xfrm4_tunnel_deregister
);
EXPORT_SYMBOL
(
xfrm4_tunnel_deregister
);
EXPORT_SYMBOL
(
xfrm4_tunnel_check_size
);
EXPORT_SYMBOL
(
xfrm_register_type
);
EXPORT_SYMBOL
(
xfrm_register_type
);
EXPORT_SYMBOL
(
xfrm_unregister_type
);
EXPORT_SYMBOL
(
xfrm_unregister_type
);
EXPORT_SYMBOL
(
xfrm_get_type
);
EXPORT_SYMBOL
(
xfrm_get_type
);
...
...
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