Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
38bdbd8e
K
Kernel
项目概览
openeuler
/
Kernel
大约 1 年 前同步成功
通知
5
Star
0
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
DevOps
流水线
流水线任务
计划
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
K
Kernel
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
DevOps
DevOps
流水线
流水线任务
计划
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
流水线任务
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
提交
38bdbd8e
编写于
2月 26, 2010
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
差异文件
Merge branch 'master' of
git://git.kernel.org/pub/scm/linux/kernel/git/kaber/nf-next-2.6
上级
773c3e75
6b4ff2d7
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
66 addition
and
53 deletion
+66
-53
net/ipv4/netfilter/arp_tables.c
net/ipv4/netfilter/arp_tables.c
+14
-9
net/ipv4/netfilter/ip_tables.c
net/ipv4/netfilter/ip_tables.c
+15
-10
net/ipv6/netfilter/ip6_tables.c
net/ipv6/netfilter/ip6_tables.c
+15
-10
net/netfilter/ipvs/ip_vs_lblcr.c
net/netfilter/ipvs/ip_vs_lblcr.c
+21
-23
net/netfilter/nfnetlink_log.c
net/netfilter/nfnetlink_log.c
+1
-1
未找到文件。
net/ipv4/netfilter/arp_tables.c
浏览文件 @
38bdbd8e
...
...
@@ -644,8 +644,10 @@ static int translate_table(struct xt_table_info *newinfo, void *entry0,
/* Walk through entries, checking offsets. */
xt_entry_foreach
(
iter
,
entry0
,
newinfo
->
size
)
{
ret
=
check_entry_size_and_hooks
(
iter
,
newinfo
,
entry0
,
entry0
+
repl
->
size
,
repl
->
hook_entry
,
repl
->
underflow
,
repl
->
valid_hooks
);
entry0
+
repl
->
size
,
repl
->
hook_entry
,
repl
->
underflow
,
repl
->
valid_hooks
);
if
(
ret
!=
0
)
break
;
++
i
;
...
...
@@ -730,7 +732,7 @@ static void get_counters(const struct xt_table_info *t,
i
=
0
;
xt_entry_foreach
(
iter
,
t
->
entries
[
curcpu
],
t
->
size
)
{
SET_COUNTER
(
counters
[
i
],
iter
->
counters
.
bcnt
,
iter
->
counters
.
pcnt
);
iter
->
counters
.
pcnt
);
++
i
;
}
...
...
@@ -741,7 +743,7 @@ static void get_counters(const struct xt_table_info *t,
xt_info_wrlock
(
cpu
);
xt_entry_foreach
(
iter
,
t
->
entries
[
cpu
],
t
->
size
)
{
ADD_COUNTER
(
counters
[
i
],
iter
->
counters
.
bcnt
,
iter
->
counters
.
pcnt
);
iter
->
counters
.
pcnt
);
++
i
;
}
xt_info_wrunlock
(
cpu
);
...
...
@@ -1356,8 +1358,11 @@ static int translate_compat_table(const char *name,
/* Walk through entries, checking offsets. */
xt_entry_foreach
(
iter0
,
entry0
,
total_size
)
{
ret
=
check_compat_entry_size_and_hooks
(
iter0
,
info
,
&
size
,
entry0
,
entry0
+
total_size
,
hook_entries
,
underflows
,
name
);
entry0
,
entry0
+
total_size
,
hook_entries
,
underflows
,
name
);
if
(
ret
!=
0
)
goto
out_unlock
;
++
j
;
...
...
@@ -1401,8 +1406,8 @@ static int translate_compat_table(const char *name,
pos
=
entry1
;
size
=
total_size
;
xt_entry_foreach
(
iter0
,
entry0
,
total_size
)
{
ret
=
compat_copy_entry_from_user
(
iter0
,
&
pos
,
&
size
,
name
,
newinfo
,
entry1
);
ret
=
compat_copy_entry_from_user
(
iter0
,
&
pos
,
&
size
,
name
,
newinfo
,
entry1
);
if
(
ret
!=
0
)
break
;
}
...
...
@@ -1617,7 +1622,7 @@ static int compat_copy_entries_to_user(unsigned int total_size,
size
=
total_size
;
xt_entry_foreach
(
iter
,
loc_cpu_entry
,
total_size
)
{
ret
=
compat_copy_entry_to_user
(
iter
,
&
pos
,
&
size
,
counters
,
i
++
);
&
size
,
counters
,
i
++
);
if
(
ret
!=
0
)
break
;
}
...
...
net/ipv4/netfilter/ip_tables.c
浏览文件 @
38bdbd8e
...
...
@@ -836,8 +836,10 @@ translate_table(struct net *net, struct xt_table_info *newinfo, void *entry0,
/* Walk through entries, checking offsets. */
xt_entry_foreach
(
iter
,
entry0
,
newinfo
->
size
)
{
ret
=
check_entry_size_and_hooks
(
iter
,
newinfo
,
entry0
,
entry0
+
repl
->
size
,
repl
->
hook_entry
,
repl
->
underflow
,
repl
->
valid_hooks
);
entry0
+
repl
->
size
,
repl
->
hook_entry
,
repl
->
underflow
,
repl
->
valid_hooks
);
if
(
ret
!=
0
)
return
ret
;
++
i
;
...
...
@@ -918,7 +920,7 @@ get_counters(const struct xt_table_info *t,
i
=
0
;
xt_entry_foreach
(
iter
,
t
->
entries
[
curcpu
],
t
->
size
)
{
SET_COUNTER
(
counters
[
i
],
iter
->
counters
.
bcnt
,
iter
->
counters
.
pcnt
);
iter
->
counters
.
pcnt
);
++
i
;
}
...
...
@@ -929,7 +931,7 @@ get_counters(const struct xt_table_info *t,
xt_info_wrlock
(
cpu
);
xt_entry_foreach
(
iter
,
t
->
entries
[
cpu
],
t
->
size
)
{
ADD_COUNTER
(
counters
[
i
],
iter
->
counters
.
bcnt
,
iter
->
counters
.
pcnt
);
iter
->
counters
.
pcnt
);
++
i
;
/* macro does multi eval of i */
}
xt_info_wrunlock
(
cpu
);
...
...
@@ -1540,7 +1542,7 @@ check_compat_entry_size_and_hooks(struct compat_ipt_entry *e,
j
=
0
;
xt_ematch_foreach
(
ematch
,
e
)
{
ret
=
compat_find_calc_match
(
ematch
,
name
,
&
e
->
ip
,
e
->
comefrom
,
&
off
);
&
e
->
ip
,
e
->
comefrom
,
&
off
);
if
(
ret
!=
0
)
goto
release_matches
;
++
j
;
...
...
@@ -1701,8 +1703,11 @@ translate_compat_table(struct net *net,
/* Walk through entries, checking offsets. */
xt_entry_foreach
(
iter0
,
entry0
,
total_size
)
{
ret
=
check_compat_entry_size_and_hooks
(
iter0
,
info
,
&
size
,
entry0
,
entry0
+
total_size
,
hook_entries
,
underflows
,
name
);
entry0
,
entry0
+
total_size
,
hook_entries
,
underflows
,
name
);
if
(
ret
!=
0
)
goto
out_unlock
;
++
j
;
...
...
@@ -1746,8 +1751,8 @@ translate_compat_table(struct net *net,
pos
=
entry1
;
size
=
total_size
;
xt_entry_foreach
(
iter0
,
entry0
,
total_size
)
{
ret
=
compat_copy_entry_from_user
(
iter0
,
&
pos
,
&
size
,
name
,
newinfo
,
entry1
);
ret
=
compat_copy_entry_from_user
(
iter0
,
&
pos
,
&
size
,
name
,
newinfo
,
entry1
);
if
(
ret
!=
0
)
break
;
}
...
...
@@ -1927,7 +1932,7 @@ compat_copy_entries_to_user(unsigned int total_size, struct xt_table *table,
size
=
total_size
;
xt_entry_foreach
(
iter
,
loc_cpu_entry
,
total_size
)
{
ret
=
compat_copy_entry_to_user
(
iter
,
&
pos
,
&
size
,
counters
,
i
++
);
&
size
,
counters
,
i
++
);
if
(
ret
!=
0
)
break
;
}
...
...
net/ipv6/netfilter/ip6_tables.c
浏览文件 @
38bdbd8e
...
...
@@ -866,8 +866,10 @@ translate_table(struct net *net, struct xt_table_info *newinfo, void *entry0,
/* Walk through entries, checking offsets. */
xt_entry_foreach
(
iter
,
entry0
,
newinfo
->
size
)
{
ret
=
check_entry_size_and_hooks
(
iter
,
newinfo
,
entry0
,
entry0
+
repl
->
size
,
repl
->
hook_entry
,
repl
->
underflow
,
repl
->
valid_hooks
);
entry0
+
repl
->
size
,
repl
->
hook_entry
,
repl
->
underflow
,
repl
->
valid_hooks
);
if
(
ret
!=
0
)
return
ret
;
++
i
;
...
...
@@ -948,7 +950,7 @@ get_counters(const struct xt_table_info *t,
i
=
0
;
xt_entry_foreach
(
iter
,
t
->
entries
[
curcpu
],
t
->
size
)
{
SET_COUNTER
(
counters
[
i
],
iter
->
counters
.
bcnt
,
iter
->
counters
.
pcnt
);
iter
->
counters
.
pcnt
);
++
i
;
}
...
...
@@ -959,7 +961,7 @@ get_counters(const struct xt_table_info *t,
xt_info_wrlock
(
cpu
);
xt_entry_foreach
(
iter
,
t
->
entries
[
cpu
],
t
->
size
)
{
ADD_COUNTER
(
counters
[
i
],
iter
->
counters
.
bcnt
,
iter
->
counters
.
pcnt
);
iter
->
counters
.
pcnt
);
++
i
;
}
xt_info_wrunlock
(
cpu
);
...
...
@@ -1573,7 +1575,7 @@ check_compat_entry_size_and_hooks(struct compat_ip6t_entry *e,
j
=
0
;
xt_ematch_foreach
(
ematch
,
e
)
{
ret
=
compat_find_calc_match
(
ematch
,
name
,
&
e
->
ipv6
,
e
->
comefrom
,
&
off
);
&
e
->
ipv6
,
e
->
comefrom
,
&
off
);
if
(
ret
!=
0
)
goto
release_matches
;
++
j
;
...
...
@@ -1734,8 +1736,11 @@ translate_compat_table(struct net *net,
/* Walk through entries, checking offsets. */
xt_entry_foreach
(
iter0
,
entry0
,
total_size
)
{
ret
=
check_compat_entry_size_and_hooks
(
iter0
,
info
,
&
size
,
entry0
,
entry0
+
total_size
,
hook_entries
,
underflows
,
name
);
entry0
,
entry0
+
total_size
,
hook_entries
,
underflows
,
name
);
if
(
ret
!=
0
)
goto
out_unlock
;
++
j
;
...
...
@@ -1779,8 +1784,8 @@ translate_compat_table(struct net *net,
pos
=
entry1
;
size
=
total_size
;
xt_entry_foreach
(
iter0
,
entry0
,
total_size
)
{
ret
=
compat_copy_entry_from_user
(
iter0
,
&
pos
,
&
size
,
name
,
newinfo
,
entry1
);
ret
=
compat_copy_entry_from_user
(
iter0
,
&
pos
,
&
size
,
name
,
newinfo
,
entry1
);
if
(
ret
!=
0
)
break
;
}
...
...
@@ -1960,7 +1965,7 @@ compat_copy_entries_to_user(unsigned int total_size, struct xt_table *table,
size
=
total_size
;
xt_entry_foreach
(
iter
,
loc_cpu_entry
,
total_size
)
{
ret
=
compat_copy_entry_to_user
(
iter
,
&
pos
,
&
size
,
counters
,
i
++
);
&
size
,
counters
,
i
++
);
if
(
ret
!=
0
)
break
;
}
...
...
net/netfilter/ipvs/ip_vs_lblcr.c
浏览文件 @
38bdbd8e
...
...
@@ -45,6 +45,7 @@
#include <linux/kernel.h>
#include <linux/skbuff.h>
#include <linux/jiffies.h>
#include <linux/list.h>
/* for sysctl */
#include <linux/fs.h>
...
...
@@ -85,25 +86,25 @@ static int sysctl_ip_vs_lblcr_expiration = 24*60*60*HZ;
/*
* IPVS destination set structure and operations
*/
struct
ip_vs_dest_
list
{
struct
ip_vs_dest_list
*
nex
t
;
/* list link */
struct
ip_vs_dest_
set_elem
{
struct
list_head
lis
t
;
/* list link */
struct
ip_vs_dest
*
dest
;
/* destination server */
};
struct
ip_vs_dest_set
{
atomic_t
size
;
/* set size */
unsigned
long
lastmod
;
/* last modified time */
struct
ip_vs_dest_list
*
list
;
/* destination list */
struct
list_head
list
;
/* destination list */
rwlock_t
lock
;
/* lock for this list */
};
static
struct
ip_vs_dest_
list
*
static
struct
ip_vs_dest_
set_elem
*
ip_vs_dest_set_insert
(
struct
ip_vs_dest_set
*
set
,
struct
ip_vs_dest
*
dest
)
{
struct
ip_vs_dest_
list
*
e
;
struct
ip_vs_dest_
set_elem
*
e
;
for
(
e
=
set
->
list
;
e
!=
NULL
;
e
=
e
->
nex
t
)
{
list_for_each_entry
(
e
,
&
set
->
list
,
lis
t
)
{
if
(
e
->
dest
==
dest
)
/* already existed */
return
NULL
;
...
...
@@ -118,9 +119,7 @@ ip_vs_dest_set_insert(struct ip_vs_dest_set *set, struct ip_vs_dest *dest)
atomic_inc
(
&
dest
->
refcnt
);
e
->
dest
=
dest
;
/* link it to the list */
e
->
next
=
set
->
list
;
set
->
list
=
e
;
list_add
(
&
e
->
list
,
&
set
->
list
);
atomic_inc
(
&
set
->
size
);
set
->
lastmod
=
jiffies
;
...
...
@@ -130,34 +129,33 @@ ip_vs_dest_set_insert(struct ip_vs_dest_set *set, struct ip_vs_dest *dest)
static
void
ip_vs_dest_set_erase
(
struct
ip_vs_dest_set
*
set
,
struct
ip_vs_dest
*
dest
)
{
struct
ip_vs_dest_
list
*
e
,
**
ep
;
struct
ip_vs_dest_
set_elem
*
e
;
for
(
ep
=&
set
->
list
,
e
=*
ep
;
e
!=
NULL
;
e
=*
ep
)
{
list_for_each_entry
(
e
,
&
set
->
list
,
list
)
{
if
(
e
->
dest
==
dest
)
{
/* HIT */
*
ep
=
e
->
next
;
atomic_dec
(
&
set
->
size
);
set
->
lastmod
=
jiffies
;
atomic_dec
(
&
e
->
dest
->
refcnt
);
list_del
(
&
e
->
list
);
kfree
(
e
);
break
;
}
ep
=
&
e
->
next
;
}
}
static
void
ip_vs_dest_set_eraseall
(
struct
ip_vs_dest_set
*
set
)
{
struct
ip_vs_dest_
list
*
e
,
*
*
ep
;
struct
ip_vs_dest_
set_elem
*
e
,
*
ep
;
write_lock
(
&
set
->
lock
);
for
(
ep
=&
set
->
list
,
e
=*
ep
;
e
!=
NULL
;
e
=*
ep
)
{
*
ep
=
e
->
next
;
list_for_each_entry_safe
(
e
,
ep
,
&
set
->
list
,
list
)
{
/*
* We don't kfree dest because it is refered either
* by its service or by the trash dest list.
*/
atomic_dec
(
&
e
->
dest
->
refcnt
);
list_del
(
&
e
->
list
);
kfree
(
e
);
}
write_unlock
(
&
set
->
lock
);
...
...
@@ -166,7 +164,7 @@ static void ip_vs_dest_set_eraseall(struct ip_vs_dest_set *set)
/* get weighted least-connection node in the destination set */
static
inline
struct
ip_vs_dest
*
ip_vs_dest_set_min
(
struct
ip_vs_dest_set
*
set
)
{
register
struct
ip_vs_dest_
list
*
e
;
register
struct
ip_vs_dest_
set_elem
*
e
;
struct
ip_vs_dest
*
dest
,
*
least
;
int
loh
,
doh
;
...
...
@@ -174,7 +172,7 @@ static inline struct ip_vs_dest *ip_vs_dest_set_min(struct ip_vs_dest_set *set)
return
NULL
;
/* select the first destination server, whose weight > 0 */
for
(
e
=
set
->
list
;
e
!=
NULL
;
e
=
e
->
nex
t
)
{
list_for_each_entry
(
e
,
&
set
->
list
,
lis
t
)
{
least
=
e
->
dest
;
if
(
least
->
flags
&
IP_VS_DEST_F_OVERLOAD
)
continue
;
...
...
@@ -190,7 +188,7 @@ static inline struct ip_vs_dest *ip_vs_dest_set_min(struct ip_vs_dest_set *set)
/* find the destination with the weighted least load */
nextstage:
for
(
e
=
e
->
next
;
e
!=
NULL
;
e
=
e
->
nex
t
)
{
list_for_each_entry
(
e
,
&
set
->
list
,
lis
t
)
{
dest
=
e
->
dest
;
if
(
dest
->
flags
&
IP_VS_DEST_F_OVERLOAD
)
continue
;
...
...
@@ -220,7 +218,7 @@ static inline struct ip_vs_dest *ip_vs_dest_set_min(struct ip_vs_dest_set *set)
/* get weighted most-connection node in the destination set */
static
inline
struct
ip_vs_dest
*
ip_vs_dest_set_max
(
struct
ip_vs_dest_set
*
set
)
{
register
struct
ip_vs_dest_
list
*
e
;
register
struct
ip_vs_dest_
set_elem
*
e
;
struct
ip_vs_dest
*
dest
,
*
most
;
int
moh
,
doh
;
...
...
@@ -228,7 +226,7 @@ static inline struct ip_vs_dest *ip_vs_dest_set_max(struct ip_vs_dest_set *set)
return
NULL
;
/* select the first destination server, whose weight > 0 */
for
(
e
=
set
->
list
;
e
!=
NULL
;
e
=
e
->
nex
t
)
{
list_for_each_entry
(
e
,
&
set
->
list
,
lis
t
)
{
most
=
e
->
dest
;
if
(
atomic_read
(
&
most
->
weight
)
>
0
)
{
moh
=
atomic_read
(
&
most
->
activeconns
)
*
50
...
...
@@ -240,7 +238,7 @@ static inline struct ip_vs_dest *ip_vs_dest_set_max(struct ip_vs_dest_set *set)
/* find the destination with the weighted most load */
nextstage:
for
(
e
=
e
->
next
;
e
!=
NULL
;
e
=
e
->
nex
t
)
{
list_for_each_entry
(
e
,
&
set
->
list
,
lis
t
)
{
dest
=
e
->
dest
;
doh
=
atomic_read
(
&
dest
->
activeconns
)
*
50
+
atomic_read
(
&
dest
->
inactconns
);
...
...
@@ -389,7 +387,7 @@ ip_vs_lblcr_new(struct ip_vs_lblcr_table *tbl, const union nf_inet_addr *daddr,
/* initilize its dest set */
atomic_set
(
&
(
en
->
set
.
size
),
0
);
en
->
set
.
list
=
NULL
;
INIT_LIST_HEAD
(
&
en
->
set
.
list
)
;
rwlock_init
(
&
en
->
set
.
lock
);
ip_vs_lblcr_hash
(
tbl
,
en
);
...
...
net/netfilter/nfnetlink_log.c
浏览文件 @
38bdbd8e
...
...
@@ -768,7 +768,7 @@ nfulnl_recv_config(struct sock *ctnl, struct sk_buff *skb,
}
instance_destroy
(
inst
);
goto
out
;
goto
out
_put
;
default:
ret
=
-
ENOTSUPP
;
break
;
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录