For consistency with the IPv6 flowtable datapath and to make sure the
skbuff is writable right before the NAT header updates.
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
 
        iph = ip_hdr(skb);
        thoff = iph->ihl * 4;
-       if (skb_try_make_writable(skb, thoff + hdrsize))
-               return NF_DROP;
-
-       iph = ip_hdr(skb);
        if (nf_flow_state_check(flow, iph->protocol, skb, thoff))
                return NF_ACCEPT;
 
                return NF_ACCEPT;
        }
 
+       if (skb_try_make_writable(skb, thoff + hdrsize))
+               return NF_DROP;
+
+       iph = ip_hdr(skb);
        if (nf_flow_nat_ip(flow, skb, thoff, dir, iph) < 0)
                return NF_DROP;