Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
214e005b
cloud-kernel
项目概览
openanolis
/
cloud-kernel
大约 1 年 前同步成功
通知
158
Star
36
Fork
7
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
10
列表
看板
标记
里程碑
合并请求
2
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
cloud-kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
10
Issue
10
列表
看板
标记
里程碑
合并请求
2
合并请求
2
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
214e005b
编写于
2月 24, 2011
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
xfrm: Pass km_event pointers around as const when possible.
Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
55ae22d0
变更
4
隐藏空白更改
内联
并排
Showing
4 changed file
with
26 addition
and
26 deletion
+26
-26
include/net/xfrm.h
include/net/xfrm.h
+4
-4
net/key/af_key.c
net/key/af_key.c
+8
-8
net/xfrm/xfrm_state.c
net/xfrm/xfrm_state.c
+2
-2
net/xfrm/xfrm_user.c
net/xfrm/xfrm_user.c
+12
-12
未找到文件。
include/net/xfrm.h
浏览文件 @
214e005b
...
...
@@ -284,8 +284,8 @@ struct xfrm_policy_afinfo {
extern
int
xfrm_policy_register_afinfo
(
struct
xfrm_policy_afinfo
*
afinfo
);
extern
int
xfrm_policy_unregister_afinfo
(
struct
xfrm_policy_afinfo
*
afinfo
);
extern
void
km_policy_notify
(
struct
xfrm_policy
*
xp
,
int
dir
,
struct
km_event
*
c
);
extern
void
km_state_notify
(
struct
xfrm_state
*
x
,
struct
km_event
*
c
);
extern
void
km_policy_notify
(
struct
xfrm_policy
*
xp
,
int
dir
,
const
struct
km_event
*
c
);
extern
void
km_state_notify
(
struct
xfrm_state
*
x
,
const
struct
km_event
*
c
);
struct
xfrm_tmpl
;
extern
int
km_query
(
struct
xfrm_state
*
x
,
struct
xfrm_tmpl
*
t
,
struct
xfrm_policy
*
pol
);
...
...
@@ -548,11 +548,11 @@ struct xfrm_migrate {
struct
xfrm_mgr
{
struct
list_head
list
;
char
*
id
;
int
(
*
notify
)(
struct
xfrm_state
*
x
,
struct
km_event
*
c
);
int
(
*
notify
)(
struct
xfrm_state
*
x
,
const
struct
km_event
*
c
);
int
(
*
acquire
)(
struct
xfrm_state
*
x
,
struct
xfrm_tmpl
*
,
struct
xfrm_policy
*
xp
,
int
dir
);
struct
xfrm_policy
*
(
*
compile_policy
)(
struct
sock
*
sk
,
int
opt
,
u8
*
data
,
int
len
,
int
*
dir
);
int
(
*
new_mapping
)(
struct
xfrm_state
*
x
,
xfrm_address_t
*
ipaddr
,
__be16
sport
);
int
(
*
notify_policy
)(
struct
xfrm_policy
*
x
,
int
dir
,
struct
km_event
*
c
);
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
);
};
...
...
net/key/af_key.c
浏览文件 @
214e005b
...
...
@@ -1429,7 +1429,7 @@ static inline int event2keytype(int event)
}
/* ADD/UPD/DEL */
static
int
key_notify_sa
(
struct
xfrm_state
*
x
,
struct
km_event
*
c
)
static
int
key_notify_sa
(
struct
xfrm_state
*
x
,
const
struct
km_event
*
c
)
{
struct
sk_buff
*
skb
;
struct
sadb_msg
*
hdr
;
...
...
@@ -1688,7 +1688,7 @@ static int unicast_flush_resp(struct sock *sk, struct sadb_msg *ihdr)
return
pfkey_broadcast
(
skb
,
GFP_ATOMIC
,
BROADCAST_ONE
,
sk
,
sock_net
(
sk
));
}
static
int
key_notify_sa_flush
(
struct
km_event
*
c
)
static
int
key_notify_sa_flush
(
const
struct
km_event
*
c
)
{
struct
sk_buff
*
skb
;
struct
sadb_msg
*
hdr
;
...
...
@@ -2123,7 +2123,7 @@ static int pfkey_xfrm_policy2msg(struct sk_buff *skb, struct xfrm_policy *xp, in
return
0
;
}
static
int
key_notify_policy
(
struct
xfrm_policy
*
xp
,
int
dir
,
struct
km_event
*
c
)
static
int
key_notify_policy
(
struct
xfrm_policy
*
xp
,
int
dir
,
const
struct
km_event
*
c
)
{
struct
sk_buff
*
out_skb
;
struct
sadb_msg
*
out_hdr
;
...
...
@@ -2660,7 +2660,7 @@ static int pfkey_spddump(struct sock *sk, struct sk_buff *skb, struct sadb_msg *
return
pfkey_do_dump
(
pfk
);
}
static
int
key_notify_policy_flush
(
struct
km_event
*
c
)
static
int
key_notify_policy_flush
(
const
struct
km_event
*
c
)
{
struct
sk_buff
*
skb_out
;
struct
sadb_msg
*
hdr
;
...
...
@@ -2914,12 +2914,12 @@ static void dump_esp_combs(struct sk_buff *skb, struct xfrm_tmpl *t)
}
}
static
int
key_notify_policy_expire
(
struct
xfrm_policy
*
xp
,
struct
km_event
*
c
)
static
int
key_notify_policy_expire
(
struct
xfrm_policy
*
xp
,
const
struct
km_event
*
c
)
{
return
0
;
}
static
int
key_notify_sa_expire
(
struct
xfrm_state
*
x
,
struct
km_event
*
c
)
static
int
key_notify_sa_expire
(
struct
xfrm_state
*
x
,
const
struct
km_event
*
c
)
{
struct
sk_buff
*
out_skb
;
struct
sadb_msg
*
out_hdr
;
...
...
@@ -2949,7 +2949,7 @@ static int key_notify_sa_expire(struct xfrm_state *x, struct km_event *c)
return
0
;
}
static
int
pfkey_send_notify
(
struct
xfrm_state
*
x
,
struct
km_event
*
c
)
static
int
pfkey_send_notify
(
struct
xfrm_state
*
x
,
const
struct
km_event
*
c
)
{
struct
net
*
net
=
x
?
xs_net
(
x
)
:
c
->
net
;
struct
netns_pfkey
*
net_pfkey
=
net_generic
(
net
,
pfkey_net_id
);
...
...
@@ -2976,7 +2976,7 @@ static int pfkey_send_notify(struct xfrm_state *x, struct km_event *c)
return
0
;
}
static
int
pfkey_send_policy_notify
(
struct
xfrm_policy
*
xp
,
int
dir
,
struct
km_event
*
c
)
static
int
pfkey_send_policy_notify
(
struct
xfrm_policy
*
xp
,
int
dir
,
const
struct
km_event
*
c
)
{
if
(
xp
&&
xp
->
type
!=
XFRM_POLICY_TYPE_MAIN
)
return
0
;
...
...
net/xfrm/xfrm_state.c
浏览文件 @
214e005b
...
...
@@ -1727,7 +1727,7 @@ void xfrm_replay_advance(struct xfrm_state *x, __be32 net_seq)
static
LIST_HEAD
(
xfrm_km_list
);
static
DEFINE_RWLOCK
(
xfrm_km_lock
);
void
km_policy_notify
(
struct
xfrm_policy
*
xp
,
int
dir
,
struct
km_event
*
c
)
void
km_policy_notify
(
struct
xfrm_policy
*
xp
,
int
dir
,
const
struct
km_event
*
c
)
{
struct
xfrm_mgr
*
km
;
...
...
@@ -1738,7 +1738,7 @@ void km_policy_notify(struct xfrm_policy *xp, int dir, struct km_event *c)
read_unlock
(
&
xfrm_km_lock
);
}
void
km_state_notify
(
struct
xfrm_state
*
x
,
struct
km_event
*
c
)
void
km_state_notify
(
struct
xfrm_state
*
x
,
const
struct
km_event
*
c
)
{
struct
xfrm_mgr
*
km
;
read_lock
(
&
xfrm_km_lock
);
...
...
net/xfrm/xfrm_user.c
浏览文件 @
214e005b
...
...
@@ -1582,7 +1582,7 @@ static inline size_t xfrm_aevent_msgsize(void)
+
nla_total_size
(
4
);
/* XFRM_AE_ETHR */
}
static
int
build_aevent
(
struct
sk_buff
*
skb
,
struct
xfrm_state
*
x
,
struct
km_event
*
c
)
static
int
build_aevent
(
struct
sk_buff
*
skb
,
struct
xfrm_state
*
x
,
const
struct
km_event
*
c
)
{
struct
xfrm_aevent_id
*
id
;
struct
nlmsghdr
*
nlh
;
...
...
@@ -2220,7 +2220,7 @@ static inline size_t xfrm_expire_msgsize(void)
+
nla_total_size
(
sizeof
(
struct
xfrm_mark
));
}
static
int
build_expire
(
struct
sk_buff
*
skb
,
struct
xfrm_state
*
x
,
struct
km_event
*
c
)
static
int
build_expire
(
struct
sk_buff
*
skb
,
struct
xfrm_state
*
x
,
const
struct
km_event
*
c
)
{
struct
xfrm_user_expire
*
ue
;
struct
nlmsghdr
*
nlh
;
...
...
@@ -2242,7 +2242,7 @@ static int build_expire(struct sk_buff *skb, struct xfrm_state *x, struct km_eve
return
-
EMSGSIZE
;
}
static
int
xfrm_exp_state_notify
(
struct
xfrm_state
*
x
,
struct
km_event
*
c
)
static
int
xfrm_exp_state_notify
(
struct
xfrm_state
*
x
,
const
struct
km_event
*
c
)
{
struct
net
*
net
=
xs_net
(
x
);
struct
sk_buff
*
skb
;
...
...
@@ -2259,7 +2259,7 @@ static int xfrm_exp_state_notify(struct xfrm_state *x, struct km_event *c)
return
nlmsg_multicast
(
net
->
xfrm
.
nlsk
,
skb
,
0
,
XFRMNLGRP_EXPIRE
,
GFP_ATOMIC
);
}
static
int
xfrm_aevent_state_notify
(
struct
xfrm_state
*
x
,
struct
km_event
*
c
)
static
int
xfrm_aevent_state_notify
(
struct
xfrm_state
*
x
,
const
struct
km_event
*
c
)
{
struct
net
*
net
=
xs_net
(
x
);
struct
sk_buff
*
skb
;
...
...
@@ -2274,7 +2274,7 @@ static int xfrm_aevent_state_notify(struct xfrm_state *x, struct km_event *c)
return
nlmsg_multicast
(
net
->
xfrm
.
nlsk
,
skb
,
0
,
XFRMNLGRP_AEVENTS
,
GFP_ATOMIC
);
}
static
int
xfrm_notify_sa_flush
(
struct
km_event
*
c
)
static
int
xfrm_notify_sa_flush
(
const
struct
km_event
*
c
)
{
struct
net
*
net
=
c
->
net
;
struct
xfrm_usersa_flush
*
p
;
...
...
@@ -2330,7 +2330,7 @@ static inline size_t xfrm_sa_len(struct xfrm_state *x)
return
l
;
}
static
int
xfrm_notify_sa
(
struct
xfrm_state
*
x
,
struct
km_event
*
c
)
static
int
xfrm_notify_sa
(
struct
xfrm_state
*
x
,
const
struct
km_event
*
c
)
{
struct
net
*
net
=
xs_net
(
x
);
struct
xfrm_usersa_info
*
p
;
...
...
@@ -2387,7 +2387,7 @@ static int xfrm_notify_sa(struct xfrm_state *x, struct km_event *c)
return
-
1
;
}
static
int
xfrm_send_state_notify
(
struct
xfrm_state
*
x
,
struct
km_event
*
c
)
static
int
xfrm_send_state_notify
(
struct
xfrm_state
*
x
,
const
struct
km_event
*
c
)
{
switch
(
c
->
event
)
{
...
...
@@ -2546,7 +2546,7 @@ static inline size_t xfrm_polexpire_msgsize(struct xfrm_policy *xp)
}
static
int
build_polexpire
(
struct
sk_buff
*
skb
,
struct
xfrm_policy
*
xp
,
int
dir
,
struct
km_event
*
c
)
int
dir
,
const
struct
km_event
*
c
)
{
struct
xfrm_user_polexpire
*
upe
;
struct
nlmsghdr
*
nlh
;
...
...
@@ -2576,7 +2576,7 @@ static int build_polexpire(struct sk_buff *skb, struct xfrm_policy *xp,
return
-
EMSGSIZE
;
}
static
int
xfrm_exp_policy_notify
(
struct
xfrm_policy
*
xp
,
int
dir
,
struct
km_event
*
c
)
static
int
xfrm_exp_policy_notify
(
struct
xfrm_policy
*
xp
,
int
dir
,
const
struct
km_event
*
c
)
{
struct
net
*
net
=
xp_net
(
xp
);
struct
sk_buff
*
skb
;
...
...
@@ -2591,7 +2591,7 @@ static int xfrm_exp_policy_notify(struct xfrm_policy *xp, int dir, struct km_eve
return
nlmsg_multicast
(
net
->
xfrm
.
nlsk
,
skb
,
0
,
XFRMNLGRP_EXPIRE
,
GFP_ATOMIC
);
}
static
int
xfrm_notify_policy
(
struct
xfrm_policy
*
xp
,
int
dir
,
struct
km_event
*
c
)
static
int
xfrm_notify_policy
(
struct
xfrm_policy
*
xp
,
int
dir
,
const
struct
km_event
*
c
)
{
struct
net
*
net
=
xp_net
(
xp
);
struct
xfrm_userpolicy_info
*
p
;
...
...
@@ -2656,7 +2656,7 @@ static int xfrm_notify_policy(struct xfrm_policy *xp, int dir, struct km_event *
return
-
1
;
}
static
int
xfrm_notify_policy_flush
(
struct
km_event
*
c
)
static
int
xfrm_notify_policy_flush
(
const
struct
km_event
*
c
)
{
struct
net
*
net
=
c
->
net
;
struct
nlmsghdr
*
nlh
;
...
...
@@ -2681,7 +2681,7 @@ static int xfrm_notify_policy_flush(struct km_event *c)
return
-
1
;
}
static
int
xfrm_send_policy_notify
(
struct
xfrm_policy
*
xp
,
int
dir
,
struct
km_event
*
c
)
static
int
xfrm_send_policy_notify
(
struct
xfrm_policy
*
xp
,
int
dir
,
const
struct
km_event
*
c
)
{
switch
(
c
->
event
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录