X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;ds=sidebyside;f=net%2Fipv4%2Fipvs%2Fip_vs_xmit.c;h=58db69d128168c6551665a1cfa53db07af061514;hb=c7b5ebbddf7bcd3651947760f423e3783bbe6573;hp=204767be411e374effc205af29bb92013953987c;hpb=a2c21200f1c81b08cb55e417b68150bba439b646;p=linux-2.6.git diff --git a/net/ipv4/ipvs/ip_vs_xmit.c b/net/ipv4/ipvs/ip_vs_xmit.c index 204767be4..58db69d12 100644 --- a/net/ipv4/ipvs/ip_vs_xmit.c +++ b/net/ipv4/ipvs/ip_vs_xmit.c @@ -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;