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
20db7173
Commit
20db7173
authored
May 03, 2003
by
James Morris
Committed by
David S. Miller
May 03, 2003
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPSEC]: Consolidate some output code into xfrm_check_output.
parent
fbbcf1fe
Changes
9
Hide whitespace changes
Inline
Side-by-side
Showing
9 changed files
with
63 additions
and
28 deletions
+63
-28
include/net/xfrm.h
include/net/xfrm.h
+5
-0
net/ipv4/ah.c
net/ipv4/ah.c
+2
-6
net/ipv4/esp.c
net/ipv4/esp.c
+2
-7
net/ipv4/ipcomp.c
net/ipv4/ipcomp.c
+2
-7
net/ipv6/ah6.c
net/ipv6/ah6.c
+2
-3
net/ipv6/esp6.c
net/ipv6/esp6.c
+2
-4
net/netsyms.c
net/netsyms.c
+1
-0
net/xfrm/Makefile
net/xfrm/Makefile
+1
-1
net/xfrm/xfrm_output.c
net/xfrm/xfrm_output.c
+46
-0
No files found.
include/net/xfrm.h
View file @
20db7173
...
@@ -484,6 +484,10 @@ xfrm_selector_match(struct xfrm_selector *sel, struct flowi *fl,
...
@@ -484,6 +484,10 @@ xfrm_selector_match(struct xfrm_selector *sel, struct flowi *fl,
return
0
;
return
0
;
}
}
/* placeholder until xfrm6_tunnel.c is written */
static
inline
int
xfrm6_tunnel_check_size
(
struct
sk_buff
*
skb
)
{
return
0
;
}
/* A struct encoding bundle of transformations to apply to some set of flow.
/* A struct encoding bundle of transformations to apply to some set of flow.
*
*
* dst->child points to the next element of bundle.
* dst->child points to the next element of bundle.
...
@@ -756,6 +760,7 @@ extern void xfrm_state_flush(u8 proto);
...
@@ -756,6 +760,7 @@ extern void xfrm_state_flush(u8 proto);
extern
int
xfrm_replay_check
(
struct
xfrm_state
*
x
,
u32
seq
);
extern
int
xfrm_replay_check
(
struct
xfrm_state
*
x
,
u32
seq
);
extern
void
xfrm_replay_advance
(
struct
xfrm_state
*
x
,
u32
seq
);
extern
void
xfrm_replay_advance
(
struct
xfrm_state
*
x
,
u32
seq
);
extern
int
xfrm_check_selectors
(
struct
xfrm_state
**
x
,
int
n
,
struct
flowi
*
fl
);
extern
int
xfrm_check_selectors
(
struct
xfrm_state
**
x
,
int
n
,
struct
flowi
*
fl
);
extern
int
xfrm_check_output
(
struct
xfrm_state
*
x
,
struct
sk_buff
*
skb
,
unsigned
short
family
);
extern
int
xfrm4_rcv
(
struct
sk_buff
*
skb
);
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
);
...
...
net/ipv4/ah.c
View file @
20db7173
...
@@ -72,12 +72,8 @@ static int ah_output(struct sk_buff *skb)
...
@@ -72,12 +72,8 @@ 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
)
err
=
xfrm_check_output
(
x
,
skb
,
AF_INET
);
goto
error
;
if
(
err
)
if
(
x
->
props
.
mode
)
if
((
err
=
xfrm4_tunnel_check_size
(
skb
))
!=
0
)
goto
error
;
if
((
err
=
xfrm_state_check_space
(
x
,
skb
))
!=
0
)
goto
error
;
goto
error
;
iph
=
skb
->
nh
.
iph
;
iph
=
skb
->
nh
.
iph
;
...
...
net/ipv4/esp.c
View file @
20db7173
...
@@ -47,14 +47,9 @@ int esp_output(struct sk_buff *skb)
...
@@ -47,14 +47,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
)
err
=
xfrm_check_output
(
x
,
skb
,
AF_INET
);
if
(
err
)
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
)
goto
error
;
err
=
-
ENOMEM
;
err
=
-
ENOMEM
;
/* Strip IP header in transport mode. Save it. */
/* Strip IP header in transport mode. Save it. */
...
...
net/ipv4/ipcomp.c
View file @
20db7173
...
@@ -173,13 +173,8 @@ static int ipcomp_output(struct sk_buff *skb)
...
@@ -173,13 +173,8 @@ static int ipcomp_output(struct sk_buff *skb)
}
}
spin_lock_bh
(
&
x
->
lock
);
spin_lock_bh
(
&
x
->
lock
);
err
=
xfrm_check_output
(
x
,
skb
,
AF_INET
);
if
((
err
=
xfrm_state_check_expire
(
x
))
!=
0
)
if
(
err
)
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
)
goto
error
;
goto
error
;
/* Don't bother compressing */
/* Don't bother compressing */
...
...
net/ipv6/ah6.c
View file @
20db7173
...
@@ -65,9 +65,8 @@ int ah6_output(struct sk_buff *skb)
...
@@ -65,9 +65,8 @@ int ah6_output(struct sk_buff *skb)
}
}
spin_lock_bh
(
&
x
->
lock
);
spin_lock_bh
(
&
x
->
lock
);
if
((
err
=
xfrm_state_check_expire
(
x
))
!=
0
)
err
=
xfrm_check_output
(
x
,
skb
,
AF_INET
);
goto
error
;
if
(
err
)
if
((
err
=
xfrm_state_check_space
(
x
,
skb
))
!=
0
)
goto
error
;
goto
error
;
if
(
x
->
props
.
mode
)
{
if
(
x
->
props
.
mode
)
{
...
...
net/ipv6/esp6.c
View file @
20db7173
...
@@ -126,11 +126,9 @@ int esp6_output(struct sk_buff *skb)
...
@@ -126,11 +126,9 @@ int esp6_output(struct sk_buff *skb)
}
}
spin_lock_bh
(
&
x
->
lock
);
spin_lock_bh
(
&
x
->
lock
);
if
((
err
=
xfrm_state_check_expire
(
x
))
!=
0
)
err
=
xfrm_check_output
(
x
,
skb
,
AF_INET6
);
if
(
err
)
goto
error
;
goto
error
;
if
((
err
=
xfrm_state_check_space
(
x
,
skb
))
!=
0
)
goto
error
;
err
=
-
ENOMEM
;
err
=
-
ENOMEM
;
/* Strip IP header in transport mode. Save it. */
/* Strip IP header in transport mode. Save it. */
...
...
net/netsyms.c
View file @
20db7173
...
@@ -314,6 +314,7 @@ EXPORT_SYMBOL(xfrm_state_put_afinfo);
...
@@ -314,6 +314,7 @@ EXPORT_SYMBOL(xfrm_state_put_afinfo);
EXPORT_SYMBOL
(
xfrm_replay_check
);
EXPORT_SYMBOL
(
xfrm_replay_check
);
EXPORT_SYMBOL
(
xfrm_replay_advance
);
EXPORT_SYMBOL
(
xfrm_replay_advance
);
EXPORT_SYMBOL
(
xfrm_check_selectors
);
EXPORT_SYMBOL
(
xfrm_check_selectors
);
EXPORT_SYMBOL
(
xfrm_check_output
);
EXPORT_SYMBOL
(
__secpath_destroy
);
EXPORT_SYMBOL
(
__secpath_destroy
);
EXPORT_SYMBOL
(
xfrm_get_acqseq
);
EXPORT_SYMBOL
(
xfrm_get_acqseq
);
EXPORT_SYMBOL
(
xfrm_parse_spi
);
EXPORT_SYMBOL
(
xfrm_parse_spi
);
...
...
net/xfrm/Makefile
View file @
20db7173
...
@@ -2,6 +2,6 @@
...
@@ -2,6 +2,6 @@
# Makefile for the XFRM subsystem.
# Makefile for the XFRM subsystem.
#
#
obj-y
:=
xfrm_policy.o xfrm_state.o xfrm_input.o xfrm_algo.o
obj-y
:=
xfrm_policy.o xfrm_state.o xfrm_input.o xfrm_algo.o
xfrm_output.o
obj-$(CONFIG_XFRM_USER)
+=
xfrm_user.o
obj-$(CONFIG_XFRM_USER)
+=
xfrm_user.o
net/xfrm/xfrm_output.c
0 → 100644
View file @
20db7173
/*
* generic xfrm output routines
*
* Copyright (c) 2003 James Morris <jmorris@intercode.com.au>
*
* This program is free software; you can redistribute it and/or modify it
* under the terms of the GNU General Public License as published by the Free
* Software Foundation; either version 2 of the License, or (at your option)
* any later version.
*/
#include <linux/config.h>
#include <linux/kernel.h>
#include <linux/skbuff.h>
#include <net/xfrm.h>
int
xfrm_check_output
(
struct
xfrm_state
*
x
,
struct
sk_buff
*
skb
,
unsigned
short
family
)
{
int
err
;
err
=
xfrm_state_check_expire
(
x
);
if
(
err
)
goto
out
;
if
(
x
->
props
.
mode
)
{
switch
(
family
)
{
case
AF_INET
:
err
=
xfrm4_tunnel_check_size
(
skb
);
break
;
case
AF_INET6
:
err
=
xfrm6_tunnel_check_size
(
skb
);
break
;
default:
err
=
-
EINVAL
;
}
if
(
err
)
goto
out
;
}
err
=
xfrm_state_check_space
(
x
,
skb
);
out:
return
err
;
}
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