[NETFILTER]: nfnetlink: rename functions containing 'nfattr'
There is no struct nfattr anymore, rename functions to 'nlattr'. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
committed by
David S. Miller
parent
df6fb868d6
commit
fdf708322d
@@ -360,7 +360,7 @@ getorigdst(struct sock *sk, int optval, void __user *user, int *len)
|
||||
#include <linux/netfilter/nfnetlink.h>
|
||||
#include <linux/netfilter/nfnetlink_conntrack.h>
|
||||
|
||||
static int ipv4_tuple_to_nfattr(struct sk_buff *skb,
|
||||
static int ipv4_tuple_to_nlattr(struct sk_buff *skb,
|
||||
const struct nf_conntrack_tuple *tuple)
|
||||
{
|
||||
NLA_PUT(skb, CTA_IP_V4_SRC, sizeof(u_int32_t),
|
||||
@@ -378,13 +378,13 @@ static const size_t cta_min_ip[CTA_IP_MAX+1] = {
|
||||
[CTA_IP_V4_DST] = sizeof(u_int32_t),
|
||||
};
|
||||
|
||||
static int ipv4_nfattr_to_tuple(struct nlattr *tb[],
|
||||
static int ipv4_nlattr_to_tuple(struct nlattr *tb[],
|
||||
struct nf_conntrack_tuple *t)
|
||||
{
|
||||
if (!tb[CTA_IP_V4_SRC] || !tb[CTA_IP_V4_DST])
|
||||
return -EINVAL;
|
||||
|
||||
if (nfattr_bad_size(tb, CTA_IP_MAX, cta_min_ip))
|
||||
if (nlattr_bad_size(tb, CTA_IP_MAX, cta_min_ip))
|
||||
return -EINVAL;
|
||||
|
||||
t->src.u3.ip = *(__be32 *)nla_data(tb[CTA_IP_V4_SRC]);
|
||||
@@ -411,8 +411,8 @@ struct nf_conntrack_l3proto nf_conntrack_l3proto_ipv4 __read_mostly = {
|
||||
.print_conntrack = ipv4_print_conntrack,
|
||||
.get_l4proto = ipv4_get_l4proto,
|
||||
#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
|
||||
.tuple_to_nfattr = ipv4_tuple_to_nfattr,
|
||||
.nfattr_to_tuple = ipv4_nfattr_to_tuple,
|
||||
.tuple_to_nlattr = ipv4_tuple_to_nlattr,
|
||||
.nlattr_to_tuple = ipv4_nlattr_to_tuple,
|
||||
#endif
|
||||
#if defined(CONFIG_SYSCTL) && defined(CONFIG_NF_CONNTRACK_PROC_COMPAT)
|
||||
.ctl_table_path = nf_net_ipv4_netfilter_sysctl_path,
|
||||
|
@@ -232,7 +232,7 @@ icmp_error(struct sk_buff *skb, unsigned int dataoff,
|
||||
#include <linux/netfilter/nfnetlink.h>
|
||||
#include <linux/netfilter/nfnetlink_conntrack.h>
|
||||
|
||||
static int icmp_tuple_to_nfattr(struct sk_buff *skb,
|
||||
static int icmp_tuple_to_nlattr(struct sk_buff *skb,
|
||||
const struct nf_conntrack_tuple *t)
|
||||
{
|
||||
NLA_PUT(skb, CTA_PROTO_ICMP_ID, sizeof(u_int16_t),
|
||||
@@ -254,7 +254,7 @@ static const size_t cta_min_proto[CTA_PROTO_MAX+1] = {
|
||||
[CTA_PROTO_ICMP_ID] = sizeof(u_int16_t)
|
||||
};
|
||||
|
||||
static int icmp_nfattr_to_tuple(struct nlattr *tb[],
|
||||
static int icmp_nlattr_to_tuple(struct nlattr *tb[],
|
||||
struct nf_conntrack_tuple *tuple)
|
||||
{
|
||||
if (!tb[CTA_PROTO_ICMP_TYPE]
|
||||
@@ -262,7 +262,7 @@ static int icmp_nfattr_to_tuple(struct nlattr *tb[],
|
||||
|| !tb[CTA_PROTO_ICMP_ID])
|
||||
return -EINVAL;
|
||||
|
||||
if (nfattr_bad_size(tb, CTA_PROTO_MAX, cta_min_proto))
|
||||
if (nlattr_bad_size(tb, CTA_PROTO_MAX, cta_min_proto))
|
||||
return -EINVAL;
|
||||
|
||||
tuple->dst.u.icmp.type =
|
||||
@@ -327,8 +327,8 @@ struct nf_conntrack_l4proto nf_conntrack_l4proto_icmp __read_mostly =
|
||||
.destroy = NULL,
|
||||
.me = NULL,
|
||||
#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
|
||||
.tuple_to_nfattr = icmp_tuple_to_nfattr,
|
||||
.nfattr_to_tuple = icmp_nfattr_to_tuple,
|
||||
.tuple_to_nlattr = icmp_tuple_to_nlattr,
|
||||
.nlattr_to_tuple = icmp_nlattr_to_tuple,
|
||||
#endif
|
||||
#ifdef CONFIG_SYSCTL
|
||||
.ctl_table_header = &icmp_sysctl_header,
|
||||
|
@@ -544,7 +544,7 @@ EXPORT_SYMBOL(nf_nat_protocol_unregister);
|
||||
|
||||
#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
|
||||
int
|
||||
nf_nat_port_range_to_nfattr(struct sk_buff *skb,
|
||||
nf_nat_port_range_to_nlattr(struct sk_buff *skb,
|
||||
const struct nf_nat_range *range)
|
||||
{
|
||||
NLA_PUT(skb, CTA_PROTONAT_PORT_MIN, sizeof(__be16),
|
||||
@@ -557,10 +557,10 @@ nf_nat_port_range_to_nfattr(struct sk_buff *skb,
|
||||
nla_put_failure:
|
||||
return -1;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(nf_nat_port_nfattr_to_range);
|
||||
EXPORT_SYMBOL_GPL(nf_nat_port_nlattr_to_range);
|
||||
|
||||
int
|
||||
nf_nat_port_nfattr_to_range(struct nlattr *tb[], struct nf_nat_range *range)
|
||||
nf_nat_port_nlattr_to_range(struct nlattr *tb[], struct nf_nat_range *range)
|
||||
{
|
||||
int ret = 0;
|
||||
|
||||
@@ -583,7 +583,7 @@ nf_nat_port_nfattr_to_range(struct nlattr *tb[], struct nf_nat_range *range)
|
||||
|
||||
return ret;
|
||||
}
|
||||
EXPORT_SYMBOL_GPL(nf_nat_port_range_to_nfattr);
|
||||
EXPORT_SYMBOL_GPL(nf_nat_port_range_to_nlattr);
|
||||
#endif
|
||||
|
||||
/* Noone using conntrack by the time this called. */
|
||||
|
@@ -142,8 +142,8 @@ static struct nf_nat_protocol gre __read_mostly = {
|
||||
.in_range = gre_in_range,
|
||||
.unique_tuple = gre_unique_tuple,
|
||||
#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
|
||||
.range_to_nfattr = nf_nat_port_range_to_nfattr,
|
||||
.nfattr_to_range = nf_nat_port_nfattr_to_range,
|
||||
.range_to_nlattr = nf_nat_port_range_to_nlattr,
|
||||
.nlattr_to_range = nf_nat_port_nlattr_to_range,
|
||||
#endif
|
||||
};
|
||||
|
||||
|
@@ -79,7 +79,7 @@ struct nf_nat_protocol nf_nat_protocol_icmp = {
|
||||
.in_range = icmp_in_range,
|
||||
.unique_tuple = icmp_unique_tuple,
|
||||
#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
|
||||
.range_to_nfattr = nf_nat_port_range_to_nfattr,
|
||||
.nfattr_to_range = nf_nat_port_nfattr_to_range,
|
||||
.range_to_nlattr = nf_nat_port_range_to_nlattr,
|
||||
.nlattr_to_range = nf_nat_port_nlattr_to_range,
|
||||
#endif
|
||||
};
|
||||
|
@@ -145,7 +145,7 @@ struct nf_nat_protocol nf_nat_protocol_tcp = {
|
||||
.in_range = tcp_in_range,
|
||||
.unique_tuple = tcp_unique_tuple,
|
||||
#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
|
||||
.range_to_nfattr = nf_nat_port_range_to_nfattr,
|
||||
.nfattr_to_range = nf_nat_port_nfattr_to_range,
|
||||
.range_to_nlattr = nf_nat_port_range_to_nlattr,
|
||||
.nlattr_to_range = nf_nat_port_nlattr_to_range,
|
||||
#endif
|
||||
};
|
||||
|
@@ -135,7 +135,7 @@ struct nf_nat_protocol nf_nat_protocol_udp = {
|
||||
.in_range = udp_in_range,
|
||||
.unique_tuple = udp_unique_tuple,
|
||||
#if defined(CONFIG_NF_CT_NETLINK) || defined(CONFIG_NF_CT_NETLINK_MODULE)
|
||||
.range_to_nfattr = nf_nat_port_range_to_nfattr,
|
||||
.nfattr_to_range = nf_nat_port_nfattr_to_range,
|
||||
.range_to_nlattr = nf_nat_port_range_to_nlattr,
|
||||
.nlattr_to_range = nf_nat_port_nlattr_to_range,
|
||||
#endif
|
||||
};
|
||||
|
Reference in New Issue
Block a user