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
dbb2fd93
Commit
dbb2fd93
authored
Feb 18, 2003
by
David S. Miller
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
[IPSEC]: Move xfrm6 policy code to net/ipv4/xfrm_policy.c
parent
8cc0743a
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
with
44 additions
and
45 deletions
+44
-45
net/ipv4/xfrm_policy.c
net/ipv4/xfrm_policy.c
+44
-0
net/ipv6/Makefile
net/ipv6/Makefile
+0
-2
net/ipv6/xfrm_policy.c
net/ipv6/xfrm_policy.c
+0
-43
No files found.
net/ipv4/xfrm_policy.c
View file @
dbb2fd93
#include <linux/config.h>
#include <net/xfrm.h>
#include <net/ip.h>
...
...
@@ -198,6 +199,49 @@ struct xfrm_type *xfrm_get_type(u8 proto)
return
type
;
}
#if defined(CONFIG_IPV6) || defined(CONFIG_IPV6_MODULE)
static
struct
xfrm_type
*
xfrm6_type_map
[
256
];
static
rwlock_t
xfrm6_type_lock
=
RW_LOCK_UNLOCKED
;
int
xfrm6_register_type
(
struct
xfrm_type
*
type
)
{
int
err
=
0
;
write_lock
(
&
xfrm6_type_lock
);
if
(
xfrm6_type_map
[
type
->
proto
]
==
NULL
)
xfrm6_type_map
[
type
->
proto
]
=
type
;
else
err
=
-
EEXIST
;
write_unlock
(
&
xfrm6_type_lock
);
return
err
;
}
int
xfrm6_unregister_type
(
struct
xfrm_type
*
type
)
{
int
err
=
0
;
write_lock
(
&
xfrm6_type_lock
);
if
(
xfrm6_type_map
[
type
->
proto
]
!=
type
)
err
=
-
ENOENT
;
else
xfrm6_type_map
[
type
->
proto
]
=
NULL
;
write_unlock
(
&
xfrm6_type_lock
);
return
err
;
}
struct
xfrm_type
*
xfrm6_get_type
(
u8
proto
)
{
struct
xfrm_type
*
type
;
read_lock
(
&
xfrm6_type_lock
);
type
=
xfrm6_type_map
[
proto
];
if
(
type
&&
!
try_module_get
(
type
->
owner
))
type
=
NULL
;
read_unlock
(
&
xfrm6_type_lock
);
return
type
;
}
#endif
/* CONFIG_IPV6 || CONFIG_IPV6_MODULE */
void
xfrm_put_type
(
struct
xfrm_type
*
type
)
{
module_put
(
type
->
owner
);
...
...
net/ipv6/Makefile
View file @
dbb2fd93
...
...
@@ -11,5 +11,3 @@ ipv6-objs := af_inet6.o ip6_output.o ip6_input.o addrconf.o sit.o \
ip6_flowlabel.o ipv6_syms.o
obj-$(CONFIG_NETFILTER)
+=
netfilter/
obj-y
+=
xfrm_policy.o
net/ipv6/xfrm_policy.c
deleted
100644 → 0
View file @
8cc0743a
#include <net/xfrm.h>
#include <net/ip.h>
static
struct
xfrm_type
*
xfrm6_type_map
[
256
];
static
rwlock_t
xfrm6_type_lock
=
RW_LOCK_UNLOCKED
;
int
xfrm6_register_type
(
struct
xfrm_type
*
type
)
{
int
err
=
0
;
write_lock
(
&
xfrm6_type_lock
);
if
(
xfrm6_type_map
[
type
->
proto
]
==
NULL
)
xfrm6_type_map
[
type
->
proto
]
=
type
;
else
err
=
-
EEXIST
;
write_unlock
(
&
xfrm6_type_lock
);
return
err
;
}
int
xfrm6_unregister_type
(
struct
xfrm_type
*
type
)
{
int
err
=
0
;
write_lock
(
&
xfrm6_type_lock
);
if
(
xfrm6_type_map
[
type
->
proto
]
!=
type
)
err
=
-
ENOENT
;
else
xfrm6_type_map
[
type
->
proto
]
=
NULL
;
write_unlock
(
&
xfrm6_type_lock
);
return
err
;
}
struct
xfrm_type
*
xfrm6_get_type
(
u8
proto
)
{
struct
xfrm_type
*
type
;
read_lock
(
&
xfrm6_type_lock
);
type
=
xfrm6_type_map
[
proto
];
if
(
type
&&
!
try_module_get
(
type
->
owner
))
type
=
NULL
;
read_unlock
(
&
xfrm6_type_lock
);
return
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