Consider TCP/IPv4 packet with IP options: sizeof(*iph) + sizeof(struct
tcphdr) is not enough to include tcp checksum. It may hurt if this
packet is fragmented.
Therefore, we should use iph->ihl * 4 instead of sizeof(*iph).
Signed-off-by: Dmitry Popov <dp@highloadlab.com>
 
 HEAD
 ====
+Fixes:
+- xt_RAWNAT: ensure correct operation in the presence of IPv4 options
 
 
 v2.2 (2013-03-31)
 
 
 static unsigned int rawnat4_writable_part(const struct iphdr *iph)
 {
-       unsigned int wlen = sizeof(*iph);
+       unsigned int wlen = iph->ihl * 4;
 
        switch (iph->protocol) {
        case IPPROTO_TCP: