Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xiphi1978
linux
提交
183cad12
L
linux
项目概览
xiphi1978
/
linux
通知
2
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
L
linux
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
183cad12
编写于
2月 24, 2011
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
xfrm: Const'ify pointer args to km_migrate() and implementations.
Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
dd701754
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
34 addition
and
30 deletion
+34
-30
include/net/xfrm.h
include/net/xfrm.h
+8
-4
net/key/af_key.c
net/key/af_key.c
+11
-11
net/xfrm/xfrm_state.c
net/xfrm/xfrm_state.c
+3
-3
net/xfrm/xfrm_user.c
net/xfrm/xfrm_user.c
+12
-12
未找到文件。
include/net/xfrm.h
浏览文件 @
183cad12
...
...
@@ -556,7 +556,11 @@ struct xfrm_mgr {
int
(
*
new_mapping
)(
struct
xfrm_state
*
x
,
xfrm_address_t
*
ipaddr
,
__be16
sport
);
int
(
*
notify_policy
)(
struct
xfrm_policy
*
x
,
int
dir
,
const
struct
km_event
*
c
);
int
(
*
report
)(
struct
net
*
net
,
u8
proto
,
struct
xfrm_selector
*
sel
,
xfrm_address_t
*
addr
);
int
(
*
migrate
)(
struct
xfrm_selector
*
sel
,
u8
dir
,
u8
type
,
struct
xfrm_migrate
*
m
,
int
num_bundles
,
struct
xfrm_kmaddress
*
k
);
int
(
*
migrate
)(
const
struct
xfrm_selector
*
sel
,
u8
dir
,
u8
type
,
const
struct
xfrm_migrate
*
m
,
int
num_bundles
,
const
struct
xfrm_kmaddress
*
k
);
};
extern
int
xfrm_register_km
(
struct
xfrm_mgr
*
km
);
...
...
@@ -1483,9 +1487,9 @@ struct xfrm_state *xfrm_find_acq(struct net *net, struct xfrm_mark *mark,
extern
int
xfrm_sk_policy_insert
(
struct
sock
*
sk
,
int
dir
,
struct
xfrm_policy
*
pol
);
#ifdef CONFIG_XFRM_MIGRATE
extern
int
km_migrate
(
struct
xfrm_selector
*
sel
,
u8
dir
,
u8
type
,
struct
xfrm_migrate
*
m
,
int
num_bundles
,
struct
xfrm_kmaddress
*
k
);
extern
int
km_migrate
(
const
struct
xfrm_selector
*
sel
,
u8
dir
,
u8
type
,
const
struct
xfrm_migrate
*
m
,
int
num_bundles
,
const
struct
xfrm_kmaddress
*
k
);
extern
struct
xfrm_state
*
xfrm_migrate_state_find
(
struct
xfrm_migrate
*
m
);
extern
struct
xfrm_state
*
xfrm_state_migrate
(
struct
xfrm_state
*
x
,
struct
xfrm_migrate
*
m
);
...
...
net/key/af_key.c
浏览文件 @
183cad12
...
...
@@ -690,7 +690,7 @@ static inline int pfkey_mode_to_xfrm(int mode)
}
}
static
unsigned
int
pfkey_sockaddr_fill
(
xfrm_address_t
*
xaddr
,
__be16
port
,
static
unsigned
int
pfkey_sockaddr_fill
(
const
xfrm_address_t
*
xaddr
,
__be16
port
,
struct
sockaddr
*
sa
,
unsigned
short
family
)
{
...
...
@@ -3318,7 +3318,7 @@ static int pfkey_send_new_mapping(struct xfrm_state *x, xfrm_address_t *ipaddr,
#ifdef CONFIG_NET_KEY_MIGRATE
static
int
set_sadb_address
(
struct
sk_buff
*
skb
,
int
sasize
,
int
type
,
struct
xfrm_selector
*
sel
)
const
struct
xfrm_selector
*
sel
)
{
struct
sadb_address
*
addr
;
addr
=
(
struct
sadb_address
*
)
skb_put
(
skb
,
sizeof
(
struct
sadb_address
)
+
sasize
);
...
...
@@ -3348,7 +3348,7 @@ static int set_sadb_address(struct sk_buff *skb, int sasize, int type,
}
static
int
set_sadb_kmaddress
(
struct
sk_buff
*
skb
,
struct
xfrm_kmaddress
*
k
)
static
int
set_sadb_kmaddress
(
struct
sk_buff
*
skb
,
const
struct
xfrm_kmaddress
*
k
)
{
struct
sadb_x_kmaddress
*
kma
;
u8
*
sa
;
...
...
@@ -3376,7 +3376,7 @@ static int set_sadb_kmaddress(struct sk_buff *skb, struct xfrm_kmaddress *k)
static
int
set_ipsecrequest
(
struct
sk_buff
*
skb
,
uint8_t
proto
,
uint8_t
mode
,
int
level
,
uint32_t
reqid
,
uint8_t
family
,
xfrm_address_t
*
src
,
xfrm_address_t
*
dst
)
const
xfrm_address_t
*
src
,
const
xfrm_address_t
*
dst
)
{
struct
sadb_x_ipsecrequest
*
rq
;
u8
*
sa
;
...
...
@@ -3404,9 +3404,9 @@ static int set_ipsecrequest(struct sk_buff *skb,
#endif
#ifdef CONFIG_NET_KEY_MIGRATE
static
int
pfkey_send_migrate
(
struct
xfrm_selector
*
sel
,
u8
dir
,
u8
type
,
struct
xfrm_migrate
*
m
,
int
num_bundles
,
struct
xfrm_kmaddress
*
k
)
static
int
pfkey_send_migrate
(
const
struct
xfrm_selector
*
sel
,
u8
dir
,
u8
type
,
const
struct
xfrm_migrate
*
m
,
int
num_bundles
,
const
struct
xfrm_kmaddress
*
k
)
{
int
i
;
int
sasize_sel
;
...
...
@@ -3415,7 +3415,7 @@ static int pfkey_send_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
struct
sk_buff
*
skb
;
struct
sadb_msg
*
hdr
;
struct
sadb_x_policy
*
pol
;
struct
xfrm_migrate
*
mp
;
const
struct
xfrm_migrate
*
mp
;
if
(
type
!=
XFRM_POLICY_TYPE_MAIN
)
return
0
;
...
...
@@ -3513,9 +3513,9 @@ static int pfkey_send_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
return
-
EINVAL
;
}
#else
static
int
pfkey_send_migrate
(
struct
xfrm_selector
*
sel
,
u8
dir
,
u8
type
,
struct
xfrm_migrate
*
m
,
int
num_bundles
,
struct
xfrm_kmaddress
*
k
)
static
int
pfkey_send_migrate
(
const
struct
xfrm_selector
*
sel
,
u8
dir
,
u8
type
,
const
struct
xfrm_migrate
*
m
,
int
num_bundles
,
const
struct
xfrm_kmaddress
*
k
)
{
return
-
ENOPROTOOPT
;
}
...
...
net/xfrm/xfrm_state.c
浏览文件 @
183cad12
...
...
@@ -1819,9 +1819,9 @@ void km_policy_expired(struct xfrm_policy *pol, int dir, int hard, u32 pid)
EXPORT_SYMBOL
(
km_policy_expired
);
#ifdef CONFIG_XFRM_MIGRATE
int
km_migrate
(
struct
xfrm_selector
*
sel
,
u8
dir
,
u8
type
,
struct
xfrm_migrate
*
m
,
int
num_migrate
,
struct
xfrm_kmaddress
*
k
)
int
km_migrate
(
const
struct
xfrm_selector
*
sel
,
u8
dir
,
u8
type
,
const
struct
xfrm_migrate
*
m
,
int
num_migrate
,
const
struct
xfrm_kmaddress
*
k
)
{
int
err
=
-
EINVAL
;
int
ret
;
...
...
net/xfrm/xfrm_user.c
浏览文件 @
183cad12
...
...
@@ -1986,7 +1986,7 @@ static int xfrm_do_migrate(struct sk_buff *skb, struct nlmsghdr *nlh,
#endif
#ifdef CONFIG_XFRM_MIGRATE
static
int
copy_to_user_migrate
(
struct
xfrm_migrate
*
m
,
struct
sk_buff
*
skb
)
static
int
copy_to_user_migrate
(
const
struct
xfrm_migrate
*
m
,
struct
sk_buff
*
skb
)
{
struct
xfrm_user_migrate
um
;
...
...
@@ -2004,7 +2004,7 @@ static int copy_to_user_migrate(struct xfrm_migrate *m, struct sk_buff *skb)
return
nla_put
(
skb
,
XFRMA_MIGRATE
,
sizeof
(
um
),
&
um
);
}
static
int
copy_to_user_kmaddress
(
struct
xfrm_kmaddress
*
k
,
struct
sk_buff
*
skb
)
static
int
copy_to_user_kmaddress
(
const
struct
xfrm_kmaddress
*
k
,
struct
sk_buff
*
skb
)
{
struct
xfrm_user_kmaddress
uk
;
...
...
@@ -2025,11 +2025,11 @@ static inline size_t xfrm_migrate_msgsize(int num_migrate, int with_kma)
+
userpolicy_type_attrsize
();
}
static
int
build_migrate
(
struct
sk_buff
*
skb
,
struct
xfrm_migrate
*
m
,
int
num_migrate
,
struct
xfrm_kmaddress
*
k
,
struct
xfrm_selector
*
sel
,
u8
dir
,
u8
type
)
static
int
build_migrate
(
struct
sk_buff
*
skb
,
const
struct
xfrm_migrate
*
m
,
int
num_migrate
,
const
struct
xfrm_kmaddress
*
k
,
const
struct
xfrm_selector
*
sel
,
u8
dir
,
u8
type
)
{
struct
xfrm_migrate
*
mp
;
const
struct
xfrm_migrate
*
mp
;
struct
xfrm_userpolicy_id
*
pol_id
;
struct
nlmsghdr
*
nlh
;
int
i
;
...
...
@@ -2061,9 +2061,9 @@ static int build_migrate(struct sk_buff *skb, struct xfrm_migrate *m,
return
-
EMSGSIZE
;
}
static
int
xfrm_send_migrate
(
struct
xfrm_selector
*
sel
,
u8
dir
,
u8
type
,
struct
xfrm_migrate
*
m
,
int
num_migrate
,
struct
xfrm_kmaddress
*
k
)
static
int
xfrm_send_migrate
(
const
struct
xfrm_selector
*
sel
,
u8
dir
,
u8
type
,
const
struct
xfrm_migrate
*
m
,
int
num_migrate
,
const
struct
xfrm_kmaddress
*
k
)
{
struct
net
*
net
=
&
init_net
;
struct
sk_buff
*
skb
;
...
...
@@ -2079,9 +2079,9 @@ static int xfrm_send_migrate(struct xfrm_selector *sel, u8 dir, u8 type,
return
nlmsg_multicast
(
net
->
xfrm
.
nlsk
,
skb
,
0
,
XFRMNLGRP_MIGRATE
,
GFP_ATOMIC
);
}
#else
static
int
xfrm_send_migrate
(
struct
xfrm_selector
*
sel
,
u8
dir
,
u8
type
,
struct
xfrm_migrate
*
m
,
int
num_migrate
,
struct
xfrm_kmaddress
*
k
)
static
int
xfrm_send_migrate
(
const
struct
xfrm_selector
*
sel
,
u8
dir
,
u8
type
,
const
struct
xfrm_migrate
*
m
,
int
num_migrate
,
const
struct
xfrm_kmaddress
*
k
)
{
return
-
ENOPROTOOPT
;
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录