From: Taehee Yoo Date: Wed, 12 Sep 2018 14:07:31 +0000 (+0900) Subject: netfilter: nat: remove duplicate skb_is_nonlinear() in __nf_nat_mangle_tcp_packet() X-Git-Tag: v5.4-rc1~2266^2~125^2~9 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=f8b0a3ab06a092c84ec0cab8232abb1b6f7c14f4;p=platform%2Fkernel%2Flinux-rpi.git 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: Taehee Yoo Signed-off-by: Pablo Neira Ayuso --- diff --git a/net/netfilter/nf_nat_helper.c b/net/netfilter/nf_nat_helper.c index 99606baedda4..38793b95d9bc 100644 --- a/net/netfilter/nf_nat_helper.c +++ b/net/netfilter/nf_nat_helper.c @@ -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;