|
@@ -575,26 +575,6 @@ static struct nf_ct_ext_type nat_extend __read_mostly = {
|
|
|
#include <linux/netfilter/nfnetlink.h>
|
|
|
#include <linux/netfilter/nfnetlink_conntrack.h>
|
|
|
|
|
|
-static const struct nf_nat_protocol *
|
|
|
-nf_nat_proto_find_get(u_int8_t protonum)
|
|
|
-{
|
|
|
- const struct nf_nat_protocol *p;
|
|
|
-
|
|
|
- rcu_read_lock();
|
|
|
- p = __nf_nat_proto_find(protonum);
|
|
|
- if (!try_module_get(p->me))
|
|
|
- p = &nf_nat_unknown_protocol;
|
|
|
- rcu_read_unlock();
|
|
|
-
|
|
|
- return p;
|
|
|
-}
|
|
|
-
|
|
|
-static void
|
|
|
-nf_nat_proto_put(const struct nf_nat_protocol *p)
|
|
|
-{
|
|
|
- module_put(p->me);
|
|
|
-}
|
|
|
-
|
|
|
static const struct nla_policy protonat_nla_policy[CTA_PROTONAT_MAX+1] = {
|
|
|
[CTA_PROTONAT_PORT_MIN] = { .type = NLA_U16 },
|
|
|
[CTA_PROTONAT_PORT_MAX] = { .type = NLA_U16 },
|
|
@@ -612,10 +592,11 @@ static int nfnetlink_parse_nat_proto(struct nlattr *attr,
|
|
|
if (err < 0)
|
|
|
return err;
|
|
|
|
|
|
- npt = nf_nat_proto_find_get(nf_ct_protonum(ct));
|
|
|
+ rcu_read_lock();
|
|
|
+ npt = __nf_nat_proto_find(nf_ct_protonum(ct));
|
|
|
if (npt->nlattr_to_range)
|
|
|
err = npt->nlattr_to_range(tb, range);
|
|
|
- nf_nat_proto_put(npt);
|
|
|
+ rcu_read_unlock();
|
|
|
return err;
|
|
|
}
|
|
|
|