mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-29 19:21:31 -04:00
netfilter: nat: fold in_range indirection into caller
No need for indirections here, we only support ipv4 and ipv6 and the called functions are very small. Signed-off-by: Florian Westphal <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
This commit is contained in:
parent
203f2e7820
commit
40e786bd29
4 changed files with 16 additions and 26 deletions
|
|
@ -62,13 +62,6 @@ static void nf_nat_ipv4_decode_session(struct sk_buff *skb,
|
|||
}
|
||||
#endif /* CONFIG_XFRM */
|
||||
|
||||
static bool nf_nat_ipv4_in_range(const struct nf_conntrack_tuple *t,
|
||||
const struct nf_nat_range2 *range)
|
||||
{
|
||||
return ntohl(t->src.u3.ip) >= ntohl(range->min_addr.ip) &&
|
||||
ntohl(t->src.u3.ip) <= ntohl(range->max_addr.ip);
|
||||
}
|
||||
|
||||
static bool nf_nat_ipv4_manip_pkt(struct sk_buff *skb,
|
||||
unsigned int iphdroff,
|
||||
const struct nf_nat_l4proto *l4proto,
|
||||
|
|
@ -155,7 +148,6 @@ static int nf_nat_ipv4_nlattr_to_range(struct nlattr *tb[],
|
|||
|
||||
static const struct nf_nat_l3proto nf_nat_l3proto_ipv4 = {
|
||||
.l3proto = NFPROTO_IPV4,
|
||||
.in_range = nf_nat_ipv4_in_range,
|
||||
.manip_pkt = nf_nat_ipv4_manip_pkt,
|
||||
.csum_update = nf_nat_ipv4_csum_update,
|
||||
.csum_recalc = nf_nat_ipv4_csum_recalc,
|
||||
|
|
|
|||
Loading…
Reference in a new issue