Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
xiphi1978
linux
提交
fd0ec0e6
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,发现更多精彩内容 >>
提交
fd0ec0e6
编写于
7月 10, 2009
作者:
J
Jan Engelhardt
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
netfilter: xtables: consolidate code into xt_request_find_match
Signed-off-by:
N
Jan Engelhardt
<
jengelh@medozas.de
>
上级
d2a7b6ba
变更
5
显示空白变更内容
内联
并排
Showing
5 changed file
with
30 addition
and
24 deletion
+30
-24
include/linux/netfilter/x_tables.h
include/linux/netfilter/x_tables.h
+2
-0
net/bridge/netfilter/ebtables.c
net/bridge/netfilter/ebtables.c
+1
-4
net/ipv4/netfilter/ip_tables.c
net/ipv4/netfilter/ip_tables.c
+8
-10
net/ipv6/netfilter/ip6_tables.c
net/ipv6/netfilter/ip6_tables.c
+8
-10
net/netfilter/x_tables.c
net/netfilter/x_tables.c
+11
-0
未找到文件。
include/linux/netfilter/x_tables.h
浏览文件 @
fd0ec0e6
...
...
@@ -436,6 +436,8 @@ extern struct xt_table_info *xt_replace_table(struct xt_table *table,
extern
struct
xt_match
*
xt_find_match
(
u8
af
,
const
char
*
name
,
u8
revision
);
extern
struct
xt_target
*
xt_find_target
(
u8
af
,
const
char
*
name
,
u8
revision
);
extern
struct
xt_match
*
xt_request_find_match
(
u8
af
,
const
char
*
name
,
u8
revision
);
extern
struct
xt_target
*
xt_request_find_target
(
u8
af
,
const
char
*
name
,
u8
revision
);
extern
int
xt_find_revision
(
u8
af
,
const
char
*
name
,
u8
revision
,
...
...
net/bridge/netfilter/ebtables.c
浏览文件 @
fd0ec0e6
...
...
@@ -361,12 +361,9 @@ ebt_check_match(struct ebt_entry_match *m, struct xt_mtchk_param *par,
left
-
sizeof
(
struct
ebt_entry_match
)
<
m
->
match_size
)
return
-
EINVAL
;
match
=
try_then_request_module
(
xt_find_match
(
NFPROTO_BRIDGE
,
m
->
u
.
name
,
0
),
"ebt_%s"
,
m
->
u
.
name
);
match
=
xt_request_find_match
(
NFPROTO_BRIDGE
,
m
->
u
.
name
,
0
);
if
(
IS_ERR
(
match
))
return
PTR_ERR
(
match
);
if
(
match
==
NULL
)
return
-
ENOENT
;
m
->
u
.
match
=
match
;
par
->
match
=
match
;
...
...
net/ipv4/netfilter/ip_tables.c
浏览文件 @
fd0ec0e6
...
...
@@ -629,12 +629,11 @@ find_check_match(struct ipt_entry_match *m, struct xt_mtchk_param *par)
struct
xt_match
*
match
;
int
ret
;
match
=
try_then_request_module
(
xt_find_match
(
AF_INET
,
m
->
u
.
user
.
name
,
m
->
u
.
user
.
revision
),
"ipt_%s"
,
m
->
u
.
user
.
name
);
if
(
IS_ERR
(
match
)
||
!
match
)
{
match
=
xt_request_find_match
(
NFPROTO_IPV4
,
m
->
u
.
user
.
name
,
m
->
u
.
user
.
revision
);
if
(
IS_ERR
(
match
))
{
duprintf
(
"find_check_match: `%s' not found
\n
"
,
m
->
u
.
user
.
name
);
return
match
?
PTR_ERR
(
match
)
:
-
ENOENT
;
return
PTR_ERR
(
match
)
;
}
m
->
u
.
kernel
.
match
=
match
;
...
...
@@ -1472,13 +1471,12 @@ compat_find_calc_match(struct ipt_entry_match *m,
{
struct
xt_match
*
match
;
match
=
try_then_request_module
(
xt_find_match
(
AF_INET
,
m
->
u
.
user
.
name
,
m
->
u
.
user
.
revision
),
"ipt_%s"
,
m
->
u
.
user
.
name
);
if
(
IS_ERR
(
match
)
||
!
match
)
{
match
=
xt_request_find_match
(
NFPROTO_IPV4
,
m
->
u
.
user
.
name
,
m
->
u
.
user
.
revision
);
if
(
IS_ERR
(
match
))
{
duprintf
(
"compat_check_calc_match: `%s' not found
\n
"
,
m
->
u
.
user
.
name
);
return
match
?
PTR_ERR
(
match
)
:
-
ENOENT
;
return
PTR_ERR
(
match
)
;
}
m
->
u
.
kernel
.
match
=
match
;
*
size
+=
xt_compat_match_offset
(
match
);
...
...
net/ipv6/netfilter/ip6_tables.c
浏览文件 @
fd0ec0e6
...
...
@@ -660,12 +660,11 @@ find_check_match(struct ip6t_entry_match *m, struct xt_mtchk_param *par)
struct
xt_match
*
match
;
int
ret
;
match
=
try_then_request_module
(
xt_find_match
(
AF_INET6
,
m
->
u
.
user
.
name
,
m
->
u
.
user
.
revision
),
"ip6t_%s"
,
m
->
u
.
user
.
name
);
if
(
IS_ERR
(
match
)
||
!
match
)
{
match
=
xt_request_find_match
(
NFPROTO_IPV6
,
m
->
u
.
user
.
name
,
m
->
u
.
user
.
revision
);
if
(
IS_ERR
(
match
))
{
duprintf
(
"find_check_match: `%s' not found
\n
"
,
m
->
u
.
user
.
name
);
return
match
?
PTR_ERR
(
match
)
:
-
ENOENT
;
return
PTR_ERR
(
match
)
;
}
m
->
u
.
kernel
.
match
=
match
;
...
...
@@ -1506,13 +1505,12 @@ compat_find_calc_match(struct ip6t_entry_match *m,
{
struct
xt_match
*
match
;
match
=
try_then_request_module
(
xt_find_match
(
AF_INET6
,
m
->
u
.
user
.
name
,
m
->
u
.
user
.
revision
),
"ip6t_%s"
,
m
->
u
.
user
.
name
);
if
(
IS_ERR
(
match
)
||
!
match
)
{
match
=
xt_request_find_match
(
NFPROTO_IPV6
,
m
->
u
.
user
.
name
,
m
->
u
.
user
.
revision
);
if
(
IS_ERR
(
match
))
{
duprintf
(
"compat_check_calc_match: `%s' not found
\n
"
,
m
->
u
.
user
.
name
);
return
match
?
PTR_ERR
(
match
)
:
-
ENOENT
;
return
PTR_ERR
(
match
)
;
}
m
->
u
.
kernel
.
match
=
match
;
*
size
+=
xt_compat_match_offset
(
match
);
...
...
net/netfilter/x_tables.c
浏览文件 @
fd0ec0e6
...
...
@@ -214,6 +214,17 @@ struct xt_match *xt_find_match(u8 af, const char *name, u8 revision)
}
EXPORT_SYMBOL
(
xt_find_match
);
struct
xt_match
*
xt_request_find_match
(
uint8_t
nfproto
,
const
char
*
name
,
uint8_t
revision
)
{
struct
xt_match
*
match
;
match
=
try_then_request_module
(
xt_find_match
(
nfproto
,
name
,
revision
),
"%st_%s"
,
xt_prefix
[
nfproto
],
name
);
return
(
match
!=
NULL
)
?
match
:
ERR_PTR
(
-
ENOENT
);
}
EXPORT_SYMBOL_GPL
(
xt_request_find_match
);
/* Find target, grabs ref. Returns ERR_PTR() on error. */
struct
xt_target
*
xt_find_target
(
u8
af
,
const
char
*
name
,
u8
revision
)
{
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录