vserver 1.9.3
[linux-2.6.git] / net / ipv4 / ipvs / ip_vs_xmit.c
index 204767b..58db69d 100644 (file)
@@ -124,10 +124,11 @@ ip_vs_dst_reset(struct ip_vs_dest *dest)
        dst_release(old_dst);
 }
 
-
 #define IP_VS_XMIT(skb, rt)                            \
 do {                                                   \
+       nf_reset_debug(skb);                            \
        (skb)->nfcache |= NFC_IPVS_PROPERTY;            \
+       (skb)->ip_summed = CHECKSUM_NONE;               \
        NF_HOOK(PF_INET, NF_IP_LOCAL_OUT, (skb), NULL,  \
                (rt)->u.dst.dev, dst_output);           \
 } while (0)
@@ -201,9 +202,6 @@ ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
        /* Another hack: avoid icmp_send in ip_fragment */
        skb->local_df = 1;
 
-#ifdef CONFIG_NETFILTER_DEBUG
-       skb->nf_debug = 0;
-#endif /* CONFIG_NETFILTER_DEBUG */
        IP_VS_XMIT(skb, rt);
 
        LeaveFunction(10);
@@ -234,11 +232,12 @@ ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
 
        /* check if it is a connection of no-client-port */
        if (unlikely(cp->flags & IP_VS_CONN_F_NO_CPORT)) {
-               __u16 pt;
-               if (skb_copy_bits(skb, iph->ihl*4, &pt, sizeof(pt)) < 0)
+               __u16 _pt, *p;
+               p = skb_header_pointer(skb, iph->ihl*4, sizeof(_pt), &_pt);
+               if (p == NULL)
                        goto tx_error;
-               ip_vs_conn_fill_cport(cp, pt);
-               IP_VS_DBG(10, "filled cport=%d\n", ntohs(pt));
+               ip_vs_conn_fill_cport(cp, *p);
+               IP_VS_DBG(10, "filled cport=%d\n", ntohs(*p));
        }
 
        if (!(rt = __ip_vs_get_out_rt(cp, RT_TOS(iph->tos))))
@@ -279,9 +278,6 @@ ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
        /* Another hack: avoid icmp_send in ip_fragment */
        skb->local_df = 1;
 
-#ifdef CONFIG_NETFILTER_DEBUG
-       skb->nf_debug = 0;
-#endif /* CONFIG_NETFILTER_DEBUG */
        IP_VS_XMIT(skb, rt);
 
        LeaveFunction(10);
@@ -412,15 +408,9 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
        ip_select_ident(iph, &rt->u.dst, NULL);
        ip_send_check(iph);
 
-       skb->ip_summed = CHECKSUM_NONE;
-
        /* Another hack: avoid icmp_send in ip_fragment */
        skb->local_df = 1;
 
-#ifdef CONFIG_NETFILTER_DEBUG
-       skb->nf_debug = 0;
-#endif /* CONFIG_NETFILTER_DEBUG */
-
        IP_VS_XMIT(skb, rt);
 
        LeaveFunction(10);
@@ -479,9 +469,6 @@ ip_vs_dr_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
        /* Another hack: avoid icmp_send in ip_fragment */
        skb->local_df = 1;
 
-#ifdef CONFIG_NETFILTER_DEBUG
-       skb->nf_debug = 0;
-#endif /* CONFIG_NETFILTER_DEBUG */
        IP_VS_XMIT(skb, rt);
 
        LeaveFunction(10);
@@ -556,9 +543,6 @@ ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
        /* Another hack: avoid icmp_send in ip_fragment */
        skb->local_df = 1;
 
-#ifdef CONFIG_NETFILTER_DEBUG
-       skb->nf_debug = 0;
-#endif /* CONFIG_NETFILTER_DEBUG */
        IP_VS_XMIT(skb, rt);
 
        rc = NF_STOLEN;