linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / net / ipv4 / netfilter / ipt_TCPMSS.c
index 369f84b..c122841 100644 (file)
@@ -58,7 +58,11 @@ ipt_tcpmss_target(struct sk_buff **pskb,
        unsigned int i;
        u_int8_t *opt;
 
-       if (!skb_ip_make_writable(pskb, (*pskb)->len))
+       if (!skb_make_writable(pskb, (*pskb)->len))
+               return NF_DROP;
+
+       if ((*pskb)->ip_summed == CHECKSUM_HW &&
+           skb_checksum_help(*pskb, out == NULL))
                return NF_DROP;
 
        iph = (*pskb)->nh.iph;
@@ -87,14 +91,14 @@ ipt_tcpmss_target(struct sk_buff **pskb,
                        return NF_DROP; /* or IPT_CONTINUE ?? */
                }
 
-               if(dst_pmtu((*pskb)->dst) <= (sizeof(struct iphdr) + sizeof(struct tcphdr))) {
+               if(dst_mtu((*pskb)->dst) <= (sizeof(struct iphdr) + sizeof(struct tcphdr))) {
                        if (net_ratelimit())
                                printk(KERN_ERR
-                                       "ipt_tcpmss_target: unknown or invalid path-MTU (%d)\n", dst_pmtu((*pskb)->dst));
+                                       "ipt_tcpmss_target: unknown or invalid path-MTU (%d)\n", dst_mtu((*pskb)->dst));
                        return NF_DROP; /* or IPT_CONTINUE ?? */
                }
 
-               newmss = dst_pmtu((*pskb)->dst) - sizeof(struct iphdr) - sizeof(struct tcphdr);
+               newmss = dst_mtu((*pskb)->dst) - sizeof(struct iphdr) - sizeof(struct tcphdr);
        } else
                newmss = tcpmssinfo->mss;
 
@@ -186,9 +190,6 @@ ipt_tcpmss_target(struct sk_buff **pskb,
               newmss);
 
  retmodified:
-       /* If we had a hardware checksum before, it's now invalid */
-       (*pskb)->ip_summed = CHECKSUM_NONE;
-       (*pskb)->nfcache |= NFC_UNKNOWN | NFC_ALTERED;
        return IPT_CONTINUE;
 }
 
@@ -209,12 +210,13 @@ static inline int find_syn_match(const struct ipt_entry_match *m)
 /* Must specify -p tcp --syn/--tcp-flags SYN */
 static int
 ipt_tcpmss_checkentry(const char *tablename,
-                     const struct ipt_entry *e,
+                     const void *e_void,
                      void *targinfo,
                      unsigned int targinfosize,
                      unsigned int hook_mask)
 {
        const struct ipt_tcpmss_info *tcpmssinfo = targinfo;
+       const struct ipt_entry *e = e_void;
 
        if (targinfosize != IPT_ALIGN(sizeof(struct ipt_tcpmss_info))) {
                DEBUGP("ipt_tcpmss_checkentry: targinfosize %u != %u\n",