summaryrefslogtreecommitdiffstats
path: root/net/netfilter
diff options
context:
space:
mode:
authorTaehee Yoo <ap420073@gmail.com>2018-09-12 23:07:31 +0900
committerPablo Neira Ayuso <pablo@netfilter.org>2018-09-20 18:26:56 +0200
commitf8b0a3ab06a092c84ec0cab8232abb1b6f7c14f4 (patch)
treed4a2b8480197fa52c9414cd5c573ba27fe7929e3 /net/netfilter
parent93185c80a5f748620f5652e492f2a1c8d89db593 (diff)
downloadlinux-stable-f8b0a3ab06a092c84ec0cab8232abb1b6f7c14f4.tar.gz
linux-stable-f8b0a3ab06a092c84ec0cab8232abb1b6f7c14f4.tar.bz2
linux-stable-f8b0a3ab06a092c84ec0cab8232abb1b6f7c14f4.zip
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 <ap420073@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter')
-rw-r--r--net/netfilter/nf_nat_helper.c4
1 files changed, 1 insertions, 3 deletions
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;