Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openanolis
cloud-kernel
提交
e807e566
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,发现更多精彩内容 >>
提交
e807e566
编写于
2月 24, 2012
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
git://1984.lsi.us.es/net
上级
bff52857
7d367e06
变更
3
隐藏空白更改
内联
并排
Showing
3 changed file
with
39 addition
and
12 deletion
+39
-12
include/net/netfilter/nf_conntrack.h
include/net/netfilter/nf_conntrack.h
+1
-1
net/netfilter/nf_conntrack_core.c
net/netfilter/nf_conntrack_core.c
+34
-4
net/netfilter/nf_conntrack_netlink.c
net/netfilter/nf_conntrack_netlink.c
+4
-7
未找到文件。
include/net/netfilter/nf_conntrack.h
浏览文件 @
e807e566
...
...
@@ -209,7 +209,7 @@ extern struct nf_conntrack_tuple_hash *
__nf_conntrack_find
(
struct
net
*
net
,
u16
zone
,
const
struct
nf_conntrack_tuple
*
tuple
);
extern
void
nf_conntrack_hash
_insert
(
struct
nf_conn
*
ct
);
extern
int
nf_conntrack_hash_check
_insert
(
struct
nf_conn
*
ct
);
extern
void
nf_ct_delete_from_lists
(
struct
nf_conn
*
ct
);
extern
void
nf_ct_insert_dying_list
(
struct
nf_conn
*
ct
);
...
...
net/netfilter/nf_conntrack_core.c
浏览文件 @
e807e566
...
...
@@ -404,19 +404,49 @@ static void __nf_conntrack_hash_insert(struct nf_conn *ct,
&
net
->
ct
.
hash
[
repl_hash
]);
}
void
nf_conntrack_hash_insert
(
struct
nf_conn
*
ct
)
int
nf_conntrack_hash_check_insert
(
struct
nf_conn
*
ct
)
{
struct
net
*
net
=
nf_ct_net
(
ct
);
unsigned
int
hash
,
repl_hash
;
struct
nf_conntrack_tuple_hash
*
h
;
struct
hlist_nulls_node
*
n
;
u16
zone
;
zone
=
nf_ct_zone
(
ct
);
hash
=
hash_conntrack
(
net
,
zone
,
&
ct
->
tuplehash
[
IP_CT_DIR_ORIGINAL
].
tuple
);
repl_hash
=
hash_conntrack
(
net
,
zone
,
&
ct
->
tuplehash
[
IP_CT_DIR_REPLY
].
tuple
);
hash
=
hash_conntrack
(
net
,
zone
,
&
ct
->
tuplehash
[
IP_CT_DIR_ORIGINAL
].
tuple
);
repl_hash
=
hash_conntrack
(
net
,
zone
,
&
ct
->
tuplehash
[
IP_CT_DIR_REPLY
].
tuple
);
spin_lock_bh
(
&
nf_conntrack_lock
);
/* See if there's one in the list already, including reverse */
hlist_nulls_for_each_entry
(
h
,
n
,
&
net
->
ct
.
hash
[
hash
],
hnnode
)
if
(
nf_ct_tuple_equal
(
&
ct
->
tuplehash
[
IP_CT_DIR_ORIGINAL
].
tuple
,
&
h
->
tuple
)
&&
zone
==
nf_ct_zone
(
nf_ct_tuplehash_to_ctrack
(
h
)))
goto
out
;
hlist_nulls_for_each_entry
(
h
,
n
,
&
net
->
ct
.
hash
[
repl_hash
],
hnnode
)
if
(
nf_ct_tuple_equal
(
&
ct
->
tuplehash
[
IP_CT_DIR_REPLY
].
tuple
,
&
h
->
tuple
)
&&
zone
==
nf_ct_zone
(
nf_ct_tuplehash_to_ctrack
(
h
)))
goto
out
;
add_timer
(
&
ct
->
timeout
);
nf_conntrack_get
(
&
ct
->
ct_general
);
__nf_conntrack_hash_insert
(
ct
,
hash
,
repl_hash
);
NF_CT_STAT_INC
(
net
,
insert
);
spin_unlock_bh
(
&
nf_conntrack_lock
);
return
0
;
out:
NF_CT_STAT_INC
(
net
,
insert_failed
);
spin_unlock_bh
(
&
nf_conntrack_lock
);
return
-
EEXIST
;
}
EXPORT_SYMBOL_GPL
(
nf_conntrack_hash_insert
);
EXPORT_SYMBOL_GPL
(
nf_conntrack_hash_
check_
insert
);
/* Confirm a connection given skb; places it in hash table */
int
...
...
net/netfilter/nf_conntrack_netlink.c
浏览文件 @
e807e566
...
...
@@ -1465,11 +1465,10 @@ ctnetlink_create_conntrack(struct net *net, u16 zone,
if
(
tstamp
)
tstamp
->
start
=
ktime_to_ns
(
ktime_get_real
());
add_timer
(
&
ct
->
timeout
);
spin_lock_bh
(
&
nf_conntrack_lock
);
nf_conntrack_hash_insert
(
ct
);
nf_conntrack_get
(
&
ct
->
ct_general
);
spin_unlock_bh
(
&
nf_conntrack_lock
);
err
=
nf_conntrack_hash_check_insert
(
ct
);
if
(
err
<
0
)
goto
err2
;
rcu_read_unlock
();
return
ct
;
...
...
@@ -1511,12 +1510,10 @@ ctnetlink_new_conntrack(struct sock *ctnl, struct sk_buff *skb,
return
err
;
}
spin_lock_bh
(
&
nf_conntrack_lock
);
if
(
cda
[
CTA_TUPLE_ORIG
])
h
=
nf_conntrack_find_get
(
net
,
zone
,
&
otuple
);
else
if
(
cda
[
CTA_TUPLE_REPLY
])
h
=
nf_conntrack_find_get
(
net
,
zone
,
&
rtuple
);
spin_unlock_bh
(
&
nf_conntrack_lock
);
if
(
h
==
NULL
)
{
err
=
-
ENOENT
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录