Skip to content

Commit

Permalink
netfilter: nat: remove duplicate skb_is_nonlinear() in __nf_nat_mangl…
Browse files Browse the repository at this point in the history
…e_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>
  • Loading branch information
Taehee Yoo authored and Pablo Neira Ayuso committed Sep 20, 2018
1 parent 93185c8 commit f8b0a3a
Showing 1 changed file with 1 addition and 3 deletions.
4 changes: 1 addition & 3 deletions net/netfilter/nf_nat_helper.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit f8b0a3a

Please sign in to comment.