Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
openeuler
Kernel
提交
d0b0268f
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看板
提交
d0b0268f
编写于
2月 10, 2010
作者:
P
Patrick McHardy
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
netfilter: ctnetlink: add missing netlink attribute policies
Signed-off-by:
N
Patrick McHardy
<
kaber@trash.net
>
上级
42107f50
变更
1
隐藏空白更改
内联
并排
Showing
1 changed file
with
36 addition
and
5 deletion
+36
-5
net/netfilter/nf_conntrack_netlink.c
net/netfilter/nf_conntrack_netlink.c
+36
-5
未找到文件。
net/netfilter/nf_conntrack_netlink.c
浏览文件 @
d0b0268f
...
...
@@ -708,6 +708,11 @@ ctnetlink_parse_tuple_proto(struct nlattr *attr,
return
ret
;
}
static
const
struct
nla_policy
tuple_nla_policy
[
CTA_TUPLE_MAX
+
1
]
=
{
[
CTA_TUPLE_IP
]
=
{
.
type
=
NLA_NESTED
},
[
CTA_TUPLE_PROTO
]
=
{
.
type
=
NLA_NESTED
},
};
static
int
ctnetlink_parse_tuple
(
const
struct
nlattr
*
const
cda
[],
struct
nf_conntrack_tuple
*
tuple
,
...
...
@@ -718,7 +723,7 @@ ctnetlink_parse_tuple(const struct nlattr * const cda[],
memset
(
tuple
,
0
,
sizeof
(
*
tuple
));
nla_parse_nested
(
tb
,
CTA_TUPLE_MAX
,
cda
[
type
],
NULL
);
nla_parse_nested
(
tb
,
CTA_TUPLE_MAX
,
cda
[
type
],
tuple_nla_policy
);
if
(
!
tb
[
CTA_TUPLE_IP
])
return
-
EINVAL
;
...
...
@@ -745,12 +750,16 @@ ctnetlink_parse_tuple(const struct nlattr * const cda[],
return
0
;
}
static
const
struct
nla_policy
help_nla_policy
[
CTA_HELP_MAX
+
1
]
=
{
[
CTA_HELP_NAME
]
=
{
.
type
=
NLA_NUL_STRING
},
};
static
inline
int
ctnetlink_parse_help
(
const
struct
nlattr
*
attr
,
char
**
helper_name
)
{
struct
nlattr
*
tb
[
CTA_HELP_MAX
+
1
];
nla_parse_nested
(
tb
,
CTA_HELP_MAX
,
attr
,
NULL
);
nla_parse_nested
(
tb
,
CTA_HELP_MAX
,
attr
,
help_nla_policy
);
if
(
!
tb
[
CTA_HELP_NAME
])
return
-
EINVAL
;
...
...
@@ -761,11 +770,17 @@ ctnetlink_parse_help(const struct nlattr *attr, char **helper_name)
}
static
const
struct
nla_policy
ct_nla_policy
[
CTA_MAX
+
1
]
=
{
[
CTA_TUPLE_ORIG
]
=
{
.
type
=
NLA_NESTED
},
[
CTA_TUPLE_REPLY
]
=
{
.
type
=
NLA_NESTED
},
[
CTA_STATUS
]
=
{
.
type
=
NLA_U32
},
[
CTA_PROTOINFO
]
=
{
.
type
=
NLA_NESTED
},
[
CTA_HELP
]
=
{
.
type
=
NLA_NESTED
},
[
CTA_NAT_SRC
]
=
{
.
type
=
NLA_NESTED
},
[
CTA_TIMEOUT
]
=
{
.
type
=
NLA_U32
},
[
CTA_MARK
]
=
{
.
type
=
NLA_U32
},
[
CTA_USE
]
=
{
.
type
=
NLA_U32
},
[
CTA_ID
]
=
{
.
type
=
NLA_U32
},
[
CTA_NAT_DST
]
=
{
.
type
=
NLA_NESTED
},
[
CTA_TUPLE_MASTER
]
=
{
.
type
=
NLA_NESTED
},
};
static
int
...
...
@@ -1053,6 +1068,12 @@ ctnetlink_change_timeout(struct nf_conn *ct, const struct nlattr * const cda[])
return
0
;
}
static
const
struct
nla_policy
protoinfo_policy
[
CTA_PROTOINFO_MAX
+
1
]
=
{
[
CTA_PROTOINFO_TCP
]
=
{
.
type
=
NLA_NESTED
},
[
CTA_PROTOINFO_DCCP
]
=
{
.
type
=
NLA_NESTED
},
[
CTA_PROTOINFO_SCTP
]
=
{
.
type
=
NLA_NESTED
},
};
static
inline
int
ctnetlink_change_protoinfo
(
struct
nf_conn
*
ct
,
const
struct
nlattr
*
const
cda
[])
{
...
...
@@ -1061,7 +1082,7 @@ ctnetlink_change_protoinfo(struct nf_conn *ct, const struct nlattr * const cda[]
struct
nf_conntrack_l4proto
*
l4proto
;
int
err
=
0
;
nla_parse_nested
(
tb
,
CTA_PROTOINFO_MAX
,
attr
,
NULL
);
nla_parse_nested
(
tb
,
CTA_PROTOINFO_MAX
,
attr
,
protoinfo_policy
);
rcu_read_lock
();
l4proto
=
__nf_ct_l4proto_find
(
nf_ct_l3num
(
ct
),
nf_ct_protonum
(
ct
));
...
...
@@ -1073,12 +1094,18 @@ ctnetlink_change_protoinfo(struct nf_conn *ct, const struct nlattr * const cda[]
}
#ifdef CONFIG_NF_NAT_NEEDED
static
const
struct
nla_policy
nat_seq_policy
[
CTA_NAT_SEQ_MAX
+
1
]
=
{
[
CTA_NAT_SEQ_CORRECTION_POS
]
=
{
.
type
=
NLA_U32
},
[
CTA_NAT_SEQ_OFFSET_BEFORE
]
=
{
.
type
=
NLA_U32
},
[
CTA_NAT_SEQ_OFFSET_AFTER
]
=
{
.
type
=
NLA_U32
},
};
static
inline
int
change_nat_seq_adj
(
struct
nf_nat_seq
*
natseq
,
const
struct
nlattr
*
const
attr
)
{
struct
nlattr
*
cda
[
CTA_NAT_SEQ_MAX
+
1
];
nla_parse_nested
(
cda
,
CTA_NAT_SEQ_MAX
,
attr
,
NULL
);
nla_parse_nested
(
cda
,
CTA_NAT_SEQ_MAX
,
attr
,
nat_seq_policy
);
if
(
!
cda
[
CTA_NAT_SEQ_CORRECTION_POS
])
return
-
EINVAL
;
...
...
@@ -1648,8 +1675,12 @@ ctnetlink_exp_dump_table(struct sk_buff *skb, struct netlink_callback *cb)
}
static
const
struct
nla_policy
exp_nla_policy
[
CTA_EXPECT_MAX
+
1
]
=
{
[
CTA_EXPECT_MASTER
]
=
{
.
type
=
NLA_NESTED
},
[
CTA_EXPECT_TUPLE
]
=
{
.
type
=
NLA_NESTED
},
[
CTA_EXPECT_MASK
]
=
{
.
type
=
NLA_NESTED
},
[
CTA_EXPECT_TIMEOUT
]
=
{
.
type
=
NLA_U32
},
[
CTA_EXPECT_ID
]
=
{
.
type
=
NLA_U32
},
[
CTA_EXPECT_HELP_NAME
]
=
{
.
type
=
NLA_NUL_STRING
},
};
static
int
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录