Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
8f8a3715
K
Kernel
项目概览
openeuler
/
Kernel
1 年多 前同步成功
通知
8
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看板
提交
8f8a3715
编写于
4月 03, 2015
作者:
D
David S. Miller
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
netfilter: Pass nf_hook_state through ip6t_do_table().
Signed-off-by:
N
David S. Miller
<
davem@davemloft.net
>
上级
8fe22382
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
17 addition
and
22 deletion
+17
-22
include/linux/netfilter_ipv6/ip6_tables.h
include/linux/netfilter_ipv6/ip6_tables.h
+1
-2
net/ipv6/netfilter/ip6_tables.c
net/ipv6/netfilter/ip6_tables.c
+6
-7
net/ipv6/netfilter/ip6table_filter.c
net/ipv6/netfilter/ip6table_filter.c
+1
-2
net/ipv6/netfilter/ip6table_mangle.c
net/ipv6/netfilter/ip6table_mangle.c
+6
-6
net/ipv6/netfilter/ip6table_nat.c
net/ipv6/netfilter/ip6table_nat.c
+1
-2
net/ipv6/netfilter/ip6table_raw.c
net/ipv6/netfilter/ip6table_raw.c
+1
-2
net/ipv6/netfilter/ip6table_security.c
net/ipv6/netfilter/ip6table_security.c
+1
-1
未找到文件。
include/linux/netfilter_ipv6/ip6_tables.h
浏览文件 @
8f8a3715
...
...
@@ -31,8 +31,7 @@ extern struct xt_table *ip6t_register_table(struct net *net,
extern
void
ip6t_unregister_table
(
struct
net
*
net
,
struct
xt_table
*
table
);
extern
unsigned
int
ip6t_do_table
(
struct
sk_buff
*
skb
,
unsigned
int
hook
,
const
struct
net_device
*
in
,
const
struct
net_device
*
out
,
const
struct
nf_hook_state
*
state
,
struct
xt_table
*
table
);
/* Check for an extension */
...
...
net/ipv6/netfilter/ip6_tables.c
浏览文件 @
8f8a3715
...
...
@@ -317,8 +317,7 @@ ip6t_next_entry(const struct ip6t_entry *entry)
unsigned
int
ip6t_do_table
(
struct
sk_buff
*
skb
,
unsigned
int
hook
,
const
struct
net_device
*
in
,
const
struct
net_device
*
out
,
const
struct
nf_hook_state
*
state
,
struct
xt_table
*
table
)
{
static
const
char
nulldevname
[
IFNAMSIZ
]
__attribute__
((
aligned
(
sizeof
(
long
))));
...
...
@@ -333,8 +332,8 @@ ip6t_do_table(struct sk_buff *skb,
unsigned
int
addend
;
/* Initialization */
indev
=
in
?
in
->
name
:
nulldevname
;
outdev
=
out
?
out
->
name
:
nulldevname
;
indev
=
state
->
in
?
state
->
in
->
name
:
nulldevname
;
outdev
=
state
->
out
?
state
->
out
->
name
:
nulldevname
;
/* We handle fragments by dealing with the first fragment as
* if it was a normal packet. All other fragments are treated
* normally, except that they will NEVER match rules that ask
...
...
@@ -342,8 +341,8 @@ ip6t_do_table(struct sk_buff *skb,
* rule is also a fragment-specific rule, non-fragments won't
* match it. */
acpar
.
hotdrop
=
false
;
acpar
.
in
=
in
;
acpar
.
out
=
out
;
acpar
.
in
=
state
->
in
;
acpar
.
out
=
state
->
out
;
acpar
.
family
=
NFPROTO_IPV6
;
acpar
.
hooknum
=
hook
;
...
...
@@ -393,7 +392,7 @@ ip6t_do_table(struct sk_buff *skb,
#if IS_ENABLED(CONFIG_NETFILTER_XT_TARGET_TRACE)
/* The packet is traced: log it */
if
(
unlikely
(
skb
->
nf_trace
))
trace_packet
(
skb
,
hook
,
in
,
out
,
trace_packet
(
skb
,
hook
,
state
->
in
,
state
->
out
,
table
->
name
,
private
,
e
);
#endif
/* Standard target? */
...
...
net/ipv6/netfilter/ip6table_filter.c
浏览文件 @
8f8a3715
...
...
@@ -37,8 +37,7 @@ ip6table_filter_hook(const struct nf_hook_ops *ops, struct sk_buff *skb,
{
const
struct
net
*
net
=
dev_net
(
state
->
in
?
state
->
in
:
state
->
out
);
return
ip6t_do_table
(
skb
,
ops
->
hooknum
,
state
->
in
,
state
->
out
,
net
->
ipv6
.
ip6table_filter
);
return
ip6t_do_table
(
skb
,
ops
->
hooknum
,
state
,
net
->
ipv6
.
ip6table_filter
);
}
static
struct
nf_hook_ops
*
filter_ops
__read_mostly
;
...
...
net/ipv6/netfilter/ip6table_mangle.c
浏览文件 @
8f8a3715
...
...
@@ -32,7 +32,7 @@ static const struct xt_table packet_mangler = {
};
static
unsigned
int
ip6t_mangle_out
(
struct
sk_buff
*
skb
,
const
struct
n
et_device
*
out
)
ip6t_mangle_out
(
struct
sk_buff
*
skb
,
const
struct
n
f_hook_state
*
state
)
{
unsigned
int
ret
;
struct
in6_addr
saddr
,
daddr
;
...
...
@@ -57,8 +57,8 @@ ip6t_mangle_out(struct sk_buff *skb, const struct net_device *out)
/* flowlabel and prio (includes version, which shouldn't change either */
flowlabel
=
*
((
u_int32_t
*
)
ipv6_hdr
(
skb
));
ret
=
ip6t_do_table
(
skb
,
NF_INET_LOCAL_OUT
,
NULL
,
out
,
dev_net
(
out
)
->
ipv6
.
ip6table_mangle
);
ret
=
ip6t_do_table
(
skb
,
NF_INET_LOCAL_OUT
,
state
,
dev_net
(
state
->
out
)
->
ipv6
.
ip6table_mangle
);
if
(
ret
!=
NF_DROP
&&
ret
!=
NF_STOLEN
&&
(
!
ipv6_addr_equal
(
&
ipv6_hdr
(
skb
)
->
saddr
,
&
saddr
)
||
...
...
@@ -80,12 +80,12 @@ ip6table_mangle_hook(const struct nf_hook_ops *ops, struct sk_buff *skb,
const
struct
nf_hook_state
*
state
)
{
if
(
ops
->
hooknum
==
NF_INET_LOCAL_OUT
)
return
ip6t_mangle_out
(
skb
,
state
->
out
);
return
ip6t_mangle_out
(
skb
,
state
);
if
(
ops
->
hooknum
==
NF_INET_POST_ROUTING
)
return
ip6t_do_table
(
skb
,
ops
->
hooknum
,
state
->
in
,
state
->
out
,
return
ip6t_do_table
(
skb
,
ops
->
hooknum
,
state
,
dev_net
(
state
->
out
)
->
ipv6
.
ip6table_mangle
);
/* INPUT/FORWARD */
return
ip6t_do_table
(
skb
,
ops
->
hooknum
,
state
->
in
,
state
->
out
,
return
ip6t_do_table
(
skb
,
ops
->
hooknum
,
state
,
dev_net
(
state
->
in
)
->
ipv6
.
ip6table_mangle
);
}
...
...
net/ipv6/netfilter/ip6table_nat.c
浏览文件 @
8f8a3715
...
...
@@ -37,8 +37,7 @@ static unsigned int ip6table_nat_do_chain(const struct nf_hook_ops *ops,
{
struct
net
*
net
=
nf_ct_net
(
ct
);
return
ip6t_do_table
(
skb
,
ops
->
hooknum
,
state
->
in
,
state
->
out
,
net
->
ipv6
.
ip6table_nat
);
return
ip6t_do_table
(
skb
,
ops
->
hooknum
,
state
,
net
->
ipv6
.
ip6table_nat
);
}
static
unsigned
int
ip6table_nat_fn
(
const
struct
nf_hook_ops
*
ops
,
...
...
net/ipv6/netfilter/ip6table_raw.c
浏览文件 @
8f8a3715
...
...
@@ -24,8 +24,7 @@ ip6table_raw_hook(const struct nf_hook_ops *ops, struct sk_buff *skb,
{
const
struct
net
*
net
=
dev_net
(
state
->
in
?
state
->
in
:
state
->
out
);
return
ip6t_do_table
(
skb
,
ops
->
hooknum
,
state
->
in
,
state
->
out
,
net
->
ipv6
.
ip6table_raw
);
return
ip6t_do_table
(
skb
,
ops
->
hooknum
,
state
,
net
->
ipv6
.
ip6table_raw
);
}
static
struct
nf_hook_ops
*
rawtable_ops
__read_mostly
;
...
...
net/ipv6/netfilter/ip6table_security.c
浏览文件 @
8f8a3715
...
...
@@ -41,7 +41,7 @@ ip6table_security_hook(const struct nf_hook_ops *ops, struct sk_buff *skb,
{
const
struct
net
*
net
=
dev_net
(
state
->
in
?
state
->
in
:
state
->
out
);
return
ip6t_do_table
(
skb
,
ops
->
hooknum
,
state
->
in
,
state
->
out
,
return
ip6t_do_table
(
skb
,
ops
->
hooknum
,
state
,
net
->
ipv6
.
ip6table_security
);
}
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录