Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f8b0a3ab authored by Taehee Yoo's avatar Taehee Yoo Committed by Pablo Neira Ayuso
Browse files

netfilter: nat: remove duplicate skb_is_nonlinear() in __nf_nat_mangle_tcp_packet()



__nf_nat_mangle_tcp_packet() and nf_nat_mangle_udp_packet() call
mangle_contents(). and __nf_nat_mangle_tcp_packet()
and mangle_contents() call skb_is_nonlinear(). so that
skb_is_nonlinear() in __nf_nat_mangle_tcp_packet() is unnecessary.

Signed-off-by: default avatarTaehee Yoo <ap420073@gmail.com>
Signed-off-by: default avatarPablo Neira Ayuso <pablo@netfilter.org>
parent 93185c80
Loading
Loading
Loading
Loading
+1 −3
Original line number Diff line number Diff line
@@ -37,7 +37,7 @@ static void mangle_contents(struct sk_buff *skb,
{
	unsigned char *data;

	BUG_ON(skb_is_nonlinear(skb));
	SKB_LINEAR_ASSERT(skb);
	data = skb_network_header(skb) + dataoff;

	/* move post-replacement */
@@ -110,8 +110,6 @@ bool __nf_nat_mangle_tcp_packet(struct sk_buff *skb,
	    !enlarge_skb(skb, rep_len - match_len))
		return false;

	SKB_LINEAR_ASSERT(skb);

	tcph = (void *)skb->data + protoff;

	oldlen = skb->len - protoff;