mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 11:11:45 -04:00
netfilter: xtables: mark initial tables constant
The inputted table is never modified, so should be considered const. Signed-off-by: Jan Engelhardt <[email protected]> Signed-off-by: Patrick McHardy <[email protected]>
This commit is contained in:
parent
dc05a564ab
commit
35aad0ffdf
22 changed files with 42 additions and 37 deletions
|
|
@ -1778,7 +1778,8 @@ static int do_arpt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len
|
|||
return ret;
|
||||
}
|
||||
|
||||
struct xt_table *arpt_register_table(struct net *net, struct xt_table *table,
|
||||
struct xt_table *arpt_register_table(struct net *net,
|
||||
const struct xt_table *table,
|
||||
const struct arpt_replace *repl)
|
||||
{
|
||||
int ret;
|
||||
|
|
|
|||
|
|
@ -15,7 +15,7 @@ MODULE_DESCRIPTION("arptables filter table");
|
|||
#define FILTER_VALID_HOOKS ((1 << NF_ARP_IN) | (1 << NF_ARP_OUT) | \
|
||||
(1 << NF_ARP_FORWARD))
|
||||
|
||||
static struct
|
||||
static const struct
|
||||
{
|
||||
struct arpt_replace repl;
|
||||
struct arpt_standard entries[3];
|
||||
|
|
@ -45,7 +45,7 @@ static struct
|
|||
.term = ARPT_ERROR_INIT,
|
||||
};
|
||||
|
||||
static struct xt_table packet_filter = {
|
||||
static const struct xt_table packet_filter = {
|
||||
.name = "filter",
|
||||
.valid_hooks = FILTER_VALID_HOOKS,
|
||||
.me = THIS_MODULE,
|
||||
|
|
|
|||
|
|
@ -2065,7 +2065,8 @@ do_ipt_get_ctl(struct sock *sk, int cmd, void __user *user, int *len)
|
|||
return ret;
|
||||
}
|
||||
|
||||
struct xt_table *ipt_register_table(struct net *net, struct xt_table *table,
|
||||
struct xt_table *ipt_register_table(struct net *net,
|
||||
const struct xt_table *table,
|
||||
const struct ipt_replace *repl)
|
||||
{
|
||||
int ret;
|
||||
|
|
|
|||
|
|
@ -53,7 +53,7 @@ static struct
|
|||
.term = IPT_ERROR_INIT, /* ERROR */
|
||||
};
|
||||
|
||||
static struct xt_table packet_filter = {
|
||||
static const struct xt_table packet_filter = {
|
||||
.name = "filter",
|
||||
.valid_hooks = FILTER_VALID_HOOKS,
|
||||
.me = THIS_MODULE,
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@ MODULE_DESCRIPTION("iptables mangle table");
|
|||
(1 << NF_INET_POST_ROUTING))
|
||||
|
||||
/* Ouch - five different hooks? Maybe this should be a config option..... -- BC */
|
||||
static struct
|
||||
static const struct
|
||||
{
|
||||
struct ipt_replace repl;
|
||||
struct ipt_standard entries[5];
|
||||
|
|
@ -64,7 +64,7 @@ static struct
|
|||
.term = IPT_ERROR_INIT, /* ERROR */
|
||||
};
|
||||
|
||||
static struct xt_table packet_mangler = {
|
||||
static const struct xt_table packet_mangler = {
|
||||
.name = "mangle",
|
||||
.valid_hooks = MANGLE_VALID_HOOKS,
|
||||
.me = THIS_MODULE,
|
||||
|
|
|
|||
|
|
@ -9,7 +9,7 @@
|
|||
|
||||
#define RAW_VALID_HOOKS ((1 << NF_INET_PRE_ROUTING) | (1 << NF_INET_LOCAL_OUT))
|
||||
|
||||
static struct
|
||||
static const struct
|
||||
{
|
||||
struct ipt_replace repl;
|
||||
struct ipt_standard entries[2];
|
||||
|
|
@ -36,7 +36,7 @@ static struct
|
|||
.term = IPT_ERROR_INIT, /* ERROR */
|
||||
};
|
||||
|
||||
static struct xt_table packet_raw = {
|
||||
static const struct xt_table packet_raw = {
|
||||
.name = "raw",
|
||||
.valid_hooks = RAW_VALID_HOOKS,
|
||||
.me = THIS_MODULE,
|
||||
|
|
|
|||
|
|
@ -27,7 +27,7 @@ MODULE_DESCRIPTION("iptables security table, for MAC rules");
|
|||
(1 << NF_INET_FORWARD) | \
|
||||
(1 << NF_INET_LOCAL_OUT)
|
||||
|
||||
static struct
|
||||
static const struct
|
||||
{
|
||||
struct ipt_replace repl;
|
||||
struct ipt_standard entries[3];
|
||||
|
|
@ -57,7 +57,7 @@ static struct
|
|||
.term = IPT_ERROR_INIT, /* ERROR */
|
||||
};
|
||||
|
||||
static struct xt_table security_table = {
|
||||
static const struct xt_table security_table = {
|
||||
.name = "security",
|
||||
.valid_hooks = SECURITY_VALID_HOOKS,
|
||||
.me = THIS_MODULE,
|
||||
|
|
|
|||
|
|
@ -28,7 +28,7 @@
|
|||
(1 << NF_INET_POST_ROUTING) | \
|
||||
(1 << NF_INET_LOCAL_OUT))
|
||||
|
||||
static struct
|
||||
static const struct
|
||||
{
|
||||
struct ipt_replace repl;
|
||||
struct ipt_standard entries[3];
|
||||
|
|
@ -58,7 +58,7 @@ static struct
|
|||
.term = IPT_ERROR_INIT, /* ERROR */
|
||||
};
|
||||
|
||||
static struct xt_table nat_table = {
|
||||
static const struct xt_table nat_table = {
|
||||
.name = "nat",
|
||||
.valid_hooks = NAT_VALID_HOOKS,
|
||||
.me = THIS_MODULE,
|
||||
|
|
|
|||
Loading…
Reference in a new issue