Skip to content
This repository has been archived by the owner on Dec 14, 2022. It is now read-only.

Commit

Permalink
[NETFILTER]: x_tables: mark matches and targets __read_mostly
Browse files Browse the repository at this point in the history
Signed-off-by: Patrick McHardy <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
kaber authored and David S. Miller committed Jul 11, 2007
1 parent ba9dda3 commit 9f15c53
Show file tree
Hide file tree
Showing 73 changed files with 79 additions and 79 deletions.
4 changes: 2 additions & 2 deletions net/ipv4/netfilter/arp_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -1140,13 +1140,13 @@ void arpt_unregister_table(struct arpt_table *table)
}

/* The built-in targets: standard (NULL) and error. */
static struct arpt_target arpt_standard_target = {
static struct arpt_target arpt_standard_target __read_mostly = {
.name = ARPT_STANDARD_TARGET,
.targetsize = sizeof(int),
.family = NF_ARP,
};

static struct arpt_target arpt_error_target = {
static struct arpt_target arpt_error_target __read_mostly = {
.name = ARPT_ERROR_TARGET,
.target = arpt_error,
.targetsize = ARPT_FUNCTION_MAXNAMELEN,
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/netfilter/arpt_mangle.c
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@ checkentry(const char *tablename, const void *e, const struct xt_target *target,
return true;
}

static struct arpt_target arpt_mangle_reg = {
static struct arpt_target arpt_mangle_reg __read_mostly = {
.name = "mangle",
.target = target,
.targetsize = sizeof(struct arpt_mangle),
Expand Down
6 changes: 3 additions & 3 deletions net/ipv4/netfilter/ip_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -2264,7 +2264,7 @@ icmp_checkentry(const char *tablename,
}

/* The built-in targets: standard (NULL) and error. */
static struct xt_target ipt_standard_target = {
static struct xt_target ipt_standard_target __read_mostly = {
.name = IPT_STANDARD_TARGET,
.targetsize = sizeof(int),
.family = AF_INET,
Expand All @@ -2275,7 +2275,7 @@ static struct xt_target ipt_standard_target = {
#endif
};

static struct xt_target ipt_error_target = {
static struct xt_target ipt_error_target __read_mostly = {
.name = IPT_ERROR_TARGET,
.target = ipt_error,
.targetsize = IPT_FUNCTION_MAXNAMELEN,
Expand All @@ -2298,7 +2298,7 @@ static struct nf_sockopt_ops ipt_sockopts = {
#endif
};

static struct xt_match icmp_matchstruct = {
static struct xt_match icmp_matchstruct __read_mostly = {
.name = "icmp",
.match = icmp_match,
.matchsize = sizeof(struct ipt_icmp),
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/netfilter/ipt_CLUSTERIP.c
Original file line number Diff line number Diff line change
Expand Up @@ -466,7 +466,7 @@ static void destroy(const struct xt_target *target, void *targinfo)
nf_ct_l3proto_module_put(target->family);
}

static struct xt_target clusterip_tgt = {
static struct xt_target clusterip_tgt __read_mostly = {
.name = "CLUSTERIP",
.family = AF_INET,
.target = target,
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/netfilter/ipt_ECN.c
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@ checkentry(const char *tablename,
return true;
}

static struct xt_target ipt_ecn_reg = {
static struct xt_target ipt_ecn_reg __read_mostly = {
.name = "ECN",
.family = AF_INET,
.target = target,
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/netfilter/ipt_LOG.c
Original file line number Diff line number Diff line change
Expand Up @@ -463,7 +463,7 @@ static bool ipt_log_checkentry(const char *tablename,
return true;
}

static struct xt_target ipt_log_reg = {
static struct xt_target ipt_log_reg __read_mostly = {
.name = "LOG",
.family = AF_INET,
.target = ipt_log_target,
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/netfilter/ipt_MASQUERADE.c
Original file line number Diff line number Diff line change
Expand Up @@ -169,7 +169,7 @@ static struct notifier_block masq_inet_notifier = {
.notifier_call = masq_inet_event,
};

static struct xt_target masquerade = {
static struct xt_target masquerade __read_mostly = {
.name = "MASQUERADE",
.family = AF_INET,
.target = masquerade_target,
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/netfilter/ipt_NETMAP.c
Original file line number Diff line number Diff line change
Expand Up @@ -85,7 +85,7 @@ target(struct sk_buff **pskb,
return nf_nat_setup_info(ct, &newrange, hooknum);
}

static struct xt_target target_module = {
static struct xt_target target_module __read_mostly = {
.name = MODULENAME,
.family = AF_INET,
.target = target,
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/netfilter/ipt_REDIRECT.c
Original file line number Diff line number Diff line change
Expand Up @@ -101,7 +101,7 @@ redirect_target(struct sk_buff **pskb,
return nf_nat_setup_info(ct, &newrange, hooknum);
}

static struct xt_target redirect_reg = {
static struct xt_target redirect_reg __read_mostly = {
.name = "REDIRECT",
.family = AF_INET,
.target = redirect_target,
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/netfilter/ipt_REJECT.c
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,7 @@ static bool check(const char *tablename,
return true;
}

static struct xt_target ipt_reject_reg = {
static struct xt_target ipt_reject_reg __read_mostly = {
.name = "REJECT",
.family = AF_INET,
.target = reject,
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/netfilter/ipt_SAME.c
Original file line number Diff line number Diff line change
Expand Up @@ -161,7 +161,7 @@ same_target(struct sk_buff **pskb,
return nf_nat_setup_info(ct, &newrange, hooknum);
}

static struct xt_target same_reg = {
static struct xt_target same_reg __read_mostly = {
.name = "SAME",
.family = AF_INET,
.target = same_target,
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/netfilter/ipt_TOS.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ checkentry(const char *tablename,
return true;
}

static struct xt_target ipt_tos_reg = {
static struct xt_target ipt_tos_reg __read_mostly = {
.name = "TOS",
.family = AF_INET,
.target = target,
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/netfilter/ipt_TTL.c
Original file line number Diff line number Diff line change
Expand Up @@ -80,7 +80,7 @@ static bool ipt_ttl_checkentry(const char *tablename,
return true;
}

static struct xt_target ipt_TTL = {
static struct xt_target ipt_TTL __read_mostly = {
.name = "TTL",
.family = AF_INET,
.target = ipt_ttl_target,
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/netfilter/ipt_ULOG.c
Original file line number Diff line number Diff line change
Expand Up @@ -381,7 +381,7 @@ static int compat_to_user(void __user *dst, void *src)
}
#endif /* CONFIG_COMPAT */

static struct xt_target ipt_ulog_reg = {
static struct xt_target ipt_ulog_reg __read_mostly = {
.name = "ULOG",
.family = AF_INET,
.target = ipt_ulog_target,
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/netfilter/ipt_addrtype.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static bool match(const struct sk_buff *skb,
return ret;
}

static struct xt_match addrtype_match = {
static struct xt_match addrtype_match __read_mostly = {
.name = "addrtype",
.family = AF_INET,
.match = match,
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/netfilter/ipt_ah.c
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ checkentry(const char *tablename,
return true;
}

static struct xt_match ah_match = {
static struct xt_match ah_match __read_mostly = {
.name = "ah",
.family = AF_INET,
.match = match,
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/netfilter/ipt_ecn.c
Original file line number Diff line number Diff line change
Expand Up @@ -111,7 +111,7 @@ static bool checkentry(const char *tablename, const void *ip_void,
return true;
}

static struct xt_match ecn_match = {
static struct xt_match ecn_match __read_mostly = {
.name = "ecn",
.family = AF_INET,
.match = match,
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/netfilter/ipt_iprange.c
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ match(const struct sk_buff *skb,
return true;
}

static struct xt_match iprange_match = {
static struct xt_match iprange_match __read_mostly = {
.name = "iprange",
.family = AF_INET,
.match = match,
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/netfilter/ipt_owner.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ checkentry(const char *tablename,
return true;
}

static struct xt_match owner_match = {
static struct xt_match owner_match __read_mostly = {
.name = "owner",
.family = AF_INET,
.match = match,
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/netfilter/ipt_recent.c
Original file line number Diff line number Diff line change
Expand Up @@ -460,7 +460,7 @@ static const struct file_operations recent_fops = {
};
#endif /* CONFIG_PROC_FS */

static struct xt_match recent_match = {
static struct xt_match recent_match __read_mostly = {
.name = "recent",
.family = AF_INET,
.match = ipt_recent_match,
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/netfilter/ipt_tos.c
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ match(const struct sk_buff *skb,
return (ip_hdr(skb)->tos == info->tos) ^ info->invert;
}

static struct xt_match tos_match = {
static struct xt_match tos_match __read_mostly = {
.name = "tos",
.family = AF_INET,
.match = match,
Expand Down
2 changes: 1 addition & 1 deletion net/ipv4/netfilter/ipt_ttl.c
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ static bool match(const struct sk_buff *skb,
return false;
}

static struct xt_match ttl_match = {
static struct xt_match ttl_match __read_mostly = {
.name = "ttl",
.family = AF_INET,
.match = match,
Expand Down
4 changes: 2 additions & 2 deletions net/ipv4/netfilter/nf_nat_rule.c
Original file line number Diff line number Diff line change
Expand Up @@ -228,7 +228,7 @@ int nf_nat_rule_find(struct sk_buff **pskb,
return ret;
}

static struct xt_target ipt_snat_reg = {
static struct xt_target ipt_snat_reg __read_mostly = {
.name = "SNAT",
.target = ipt_snat_target,
.targetsize = sizeof(struct nf_nat_multi_range_compat),
Expand All @@ -238,7 +238,7 @@ static struct xt_target ipt_snat_reg = {
.family = AF_INET,
};

static struct xt_target ipt_dnat_reg = {
static struct xt_target ipt_dnat_reg __read_mostly = {
.name = "DNAT",
.target = ipt_dnat_target,
.targetsize = sizeof(struct nf_nat_multi_range_compat),
Expand Down
6 changes: 3 additions & 3 deletions net/ipv6/netfilter/ip6_tables.c
Original file line number Diff line number Diff line change
Expand Up @@ -1441,13 +1441,13 @@ icmp6_checkentry(const char *tablename,
}

/* The built-in targets: standard (NULL) and error. */
static struct xt_target ip6t_standard_target = {
static struct xt_target ip6t_standard_target __read_mostly = {
.name = IP6T_STANDARD_TARGET,
.targetsize = sizeof(int),
.family = AF_INET6,
};

static struct xt_target ip6t_error_target = {
static struct xt_target ip6t_error_target __read_mostly = {
.name = IP6T_ERROR_TARGET,
.target = ip6t_error,
.targetsize = IP6T_FUNCTION_MAXNAMELEN,
Expand All @@ -1464,7 +1464,7 @@ static struct nf_sockopt_ops ip6t_sockopts = {
.get = do_ip6t_get_ctl,
};

static struct xt_match icmp6_matchstruct = {
static struct xt_match icmp6_matchstruct __read_mostly = {
.name = "icmp6",
.match = &icmp6_match,
.matchsize = sizeof(struct ip6t_icmp),
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/netfilter/ip6t_HL.c
Original file line number Diff line number Diff line change
Expand Up @@ -79,7 +79,7 @@ static bool ip6t_hl_checkentry(const char *tablename,
return true;
}

static struct xt_target ip6t_HL = {
static struct xt_target ip6t_HL __read_mostly = {
.name = "HL",
.family = AF_INET6,
.target = ip6t_hl_target,
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/netfilter/ip6t_LOG.c
Original file line number Diff line number Diff line change
Expand Up @@ -477,7 +477,7 @@ static bool ip6t_log_checkentry(const char *tablename,
return true;
}

static struct xt_target ip6t_log_reg = {
static struct xt_target ip6t_log_reg __read_mostly = {
.name = "LOG",
.family = AF_INET6,
.target = ip6t_log_target,
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/netfilter/ip6t_REJECT.c
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,7 @@ static bool check(const char *tablename,
return true;
}

static struct xt_target ip6t_reject_reg = {
static struct xt_target ip6t_reject_reg __read_mostly = {
.name = "REJECT",
.family = AF_INET6,
.target = reject6_target,
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/netfilter/ip6t_ah.c
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ checkentry(const char *tablename,
return true;
}

static struct xt_match ah_match = {
static struct xt_match ah_match __read_mostly = {
.name = "ah",
.family = AF_INET6,
.match = match,
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/netfilter/ip6t_eui64.c
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ match(const struct sk_buff *skb,
return false;
}

static struct xt_match eui64_match = {
static struct xt_match eui64_match __read_mostly = {
.name = "eui64",
.family = AF_INET6,
.match = match,
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/netfilter/ip6t_frag.c
Original file line number Diff line number Diff line change
Expand Up @@ -137,7 +137,7 @@ checkentry(const char *tablename,
return true;
}

static struct xt_match frag_match = {
static struct xt_match frag_match __read_mostly = {
.name = "frag",
.family = AF_INET6,
.match = match,
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/netfilter/ip6t_hbh.c
Original file line number Diff line number Diff line change
Expand Up @@ -193,7 +193,7 @@ checkentry(const char *tablename,
return true;
}

static struct xt_match opts_match[] = {
static struct xt_match opts_match[] __read_mostly = {
{
.name = "hbh",
.family = AF_INET6,
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/netfilter/ip6t_hl.c
Original file line number Diff line number Diff line change
Expand Up @@ -49,7 +49,7 @@ static bool match(const struct sk_buff *skb,
return false;
}

static struct xt_match hl_match = {
static struct xt_match hl_match __read_mostly = {
.name = "hl",
.family = AF_INET6,
.match = match,
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/netfilter/ip6t_ipv6header.c
Original file line number Diff line number Diff line change
Expand Up @@ -141,7 +141,7 @@ ipv6header_checkentry(const char *tablename,
return true;
}

static struct xt_match ip6t_ipv6header_match = {
static struct xt_match ip6t_ipv6header_match __read_mostly = {
.name = "ipv6header",
.family = AF_INET6,
.match = &ipv6header_match,
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/netfilter/ip6t_mh.c
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ mh_checkentry(const char *tablename,
return !(mhinfo->invflags & ~IP6T_MH_INV_MASK);
}

static struct xt_match mh_match = {
static struct xt_match mh_match __read_mostly = {
.name = "mh",
.family = AF_INET6,
.checkentry = mh_checkentry,
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/netfilter/ip6t_owner.c
Original file line number Diff line number Diff line change
Expand Up @@ -68,7 +68,7 @@ checkentry(const char *tablename,
return true;
}

static struct xt_match owner_match = {
static struct xt_match owner_match __read_mostly = {
.name = "owner",
.family = AF_INET6,
.match = match,
Expand Down
2 changes: 1 addition & 1 deletion net/ipv6/netfilter/ip6t_rt.c
Original file line number Diff line number Diff line change
Expand Up @@ -224,7 +224,7 @@ checkentry(const char *tablename,
return true;
}

static struct xt_match rt_match = {
static struct xt_match rt_match __read_mostly = {
.name = "rt",
.family = AF_INET6,
.match = match,
Expand Down
2 changes: 1 addition & 1 deletion net/netfilter/xt_CLASSIFY.c
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ target(struct sk_buff **pskb,
return XT_CONTINUE;
}

static struct xt_target xt_classify_target[] = {
static struct xt_target xt_classify_target[] __read_mostly = {
{
.family = AF_INET,
.name = "CLASSIFY",
Expand Down
2 changes: 1 addition & 1 deletion net/netfilter/xt_CONNMARK.c
Original file line number Diff line number Diff line change
Expand Up @@ -142,7 +142,7 @@ static int compat_to_user(void __user *dst, void *src)
}
#endif /* CONFIG_COMPAT */

static struct xt_target xt_connmark_target[] = {
static struct xt_target xt_connmark_target[] __read_mostly = {
{
.name = "CONNMARK",
.family = AF_INET,
Expand Down
Loading

0 comments on commit 9f15c53

Please sign in to comment.