[NETFILTER]: PPTP conntrack: fix PPTP_IN_CALL message types
[safe/jmp/linux-2.6] / net / ipv4 / netfilter / ipt_REJECT.c
index 9d3b357..b81821e 100644 (file)
@@ -12,7 +12,6 @@
  * published by the Free Software Foundation.
  */
 
-#include <linux/config.h>
 #include <linux/module.h>
 #include <linux/skbuff.h>
 #include <linux/ip.h>
@@ -91,6 +90,7 @@ static inline struct rtable *route_reverse(struct sk_buff *skb,
        fl.proto = IPPROTO_TCP;
        fl.fl_ip_sport = tcph->dest;
        fl.fl_ip_dport = tcph->source;
+       security_skb_classify_flow(skb, &fl);
 
        xfrm_lookup((struct dst_entry **)&rt, &fl, NULL, 0);
 
@@ -106,7 +106,6 @@ static void send_reset(struct sk_buff *oldskb, int hook)
        struct rtable *rt;
        u_int16_t tmp_port;
        u_int32_t tmp_addr;
-       unsigned int tcplen;
        int needs_ack;
        int hh_len;
 
@@ -124,13 +123,7 @@ static void send_reset(struct sk_buff *oldskb, int hook)
                return;
 
        /* Check checksum */
-       tcplen = oldskb->len - iph->ihl * 4;
-       if (((hook != NF_IP_LOCAL_IN && oldskb->ip_summed != CHECKSUM_HW) ||
-            (hook == NF_IP_LOCAL_IN &&
-             oldskb->ip_summed != CHECKSUM_UNNECESSARY)) &&
-           csum_tcpudp_magic(iph->saddr, iph->daddr, tcplen, IPPROTO_TCP,
-                             oldskb->ip_summed == CHECKSUM_HW ? oldskb->csum :
-                             skb_checksum(oldskb, iph->ihl * 4, tcplen, 0)))
+       if (nf_ip_checksum(oldskb, hook, iph->ihl * 4, IPPROTO_TCP))
                return;
 
        if ((rt = route_reverse(oldskb, oth, hook)) == NULL)
@@ -154,6 +147,7 @@ static void send_reset(struct sk_buff *oldskb, int hook)
        /* This packet will not be the same as the other: clear nf fields */
        nf_reset(nskb);
        nskb->nfmark = 0;
+       skb_init_secmark(nskb);
 
        tcph = (struct tcphdr *)((u_int32_t*)nskb->nh.iph + nskb->nh.iph->ihl);
 
@@ -191,6 +185,7 @@ static void send_reset(struct sk_buff *oldskb, int hook)
        tcph->urg_ptr = 0;
 
        /* Adjust TCP checksum */
+       nskb->ip_summed = CHECKSUM_NONE;
        tcph->check = 0;
        tcph->check = tcp_v4_check(tcph, sizeof(struct tcphdr),
                                   nskb->nh.iph->saddr,
@@ -233,8 +228,7 @@ static unsigned int reject(struct sk_buff **pskb,
                           const struct net_device *out,
                           unsigned int hooknum,
                           const struct xt_target *target,
-                          const void *targinfo,
-                          void *userinfo)
+                          const void *targinfo)
 {
        const struct ipt_reject_info *reject = targinfo;
 
@@ -282,7 +276,6 @@ static int check(const char *tablename,
                 const void *e_void,
                 const struct xt_target *target,
                 void *targinfo,
-                unsigned int targinfosize,
                 unsigned int hook_mask)
 {
        const struct ipt_reject_info *rejinfo = targinfo;
@@ -313,15 +306,15 @@ static struct ipt_target ipt_reject_reg = {
        .me             = THIS_MODULE,
 };
 
-static int __init init(void)
+static int __init ipt_reject_init(void)
 {
        return ipt_register_target(&ipt_reject_reg);
 }
 
-static void __exit fini(void)
+static void __exit ipt_reject_fini(void)
 {
        ipt_unregister_target(&ipt_reject_reg);
 }
 
-module_init(init);
-module_exit(fini);
+module_init(ipt_reject_init);
+module_exit(ipt_reject_fini);