Commit 53890234 authored by Taehee Yoo's avatar Taehee Yoo Committed by Pablo Neira Ayuso

netfilter: nat: remove rcu_read_lock in __nf_nat_decode_session.

__nf_nat_decode_session is called from nf_nat_decode_session as decodefn.
before calling decodefn, it already set rcu_read_lock. so rcu_read_lock in
__nf_nat_decode_session can be removed.
Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 4f139972
...@@ -71,11 +71,10 @@ static void __nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl) ...@@ -71,11 +71,10 @@ static void __nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl)
if (ct == NULL) if (ct == NULL)
return; return;
family = ct->tuplehash[IP_CT_DIR_ORIGINAL].tuple.src.l3num; family = nf_ct_l3num(ct);
rcu_read_lock();
l3proto = __nf_nat_l3proto_find(family); l3proto = __nf_nat_l3proto_find(family);
if (l3proto == NULL) if (l3proto == NULL)
goto out; return;
dir = CTINFO2DIR(ctinfo); dir = CTINFO2DIR(ctinfo);
if (dir == IP_CT_DIR_ORIGINAL) if (dir == IP_CT_DIR_ORIGINAL)
...@@ -84,8 +83,6 @@ static void __nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl) ...@@ -84,8 +83,6 @@ static void __nf_nat_decode_session(struct sk_buff *skb, struct flowi *fl)
statusbit = IPS_SRC_NAT; statusbit = IPS_SRC_NAT;
l3proto->decode_session(skb, ct, dir, statusbit, fl); l3proto->decode_session(skb, ct, dir, statusbit, fl);
out:
rcu_read_unlock();
} }
int nf_xfrm_me_harder(struct net *net, struct sk_buff *skb, unsigned int family) int nf_xfrm_me_harder(struct net *net, struct sk_buff *skb, unsigned int family)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment