return NULL;
if ((dst->obsolete || rtos != dest->dst_rtos) &&
dst->ops->check(dst, cookie) == NULL) {
- dest->dst_cache = 0;
+ dest->dst_cache = NULL;
+ dst_release(dst);
return NULL;
}
dst_hold(dst);
dst_release(old_dst);
}
-
#define IP_VS_XMIT(skb, rt) \
do { \
- (skb)->nfcache |= NFC_IPVS_PROPERTY; \
+ (skb)->ipvs_property = 1; \
+ (skb)->ip_summed = CHECKSUM_NONE; \
NF_HOOK(PF_INET, NF_IP_LOCAL_OUT, (skb), NULL, \
(rt)->u.dst.dev, dst_output); \
} while (0)
}
/* MTU checking */
- mtu = dst_pmtu(&rt->u.dst);
+ mtu = dst_mtu(&rt->u.dst);
if ((skb->len > mtu) && (iph->frag_off&__constant_htons(IP_DF))) {
ip_rt_put(rt);
icmp_send(skb, ICMP_DEST_UNREACH,ICMP_FRAG_NEEDED, htonl(mtu));
/* 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);
/* 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)
+ __be16 _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))))
goto tx_error_icmp;
/* MTU checking */
- mtu = dst_pmtu(&rt->u.dst);
+ mtu = dst_mtu(&rt->u.dst);
if ((skb->len > mtu) && (iph->frag_off&__constant_htons(IP_DF))) {
ip_rt_put(rt);
icmp_send(skb, ICMP_DEST_UNREACH,ICMP_FRAG_NEEDED, htonl(mtu));
/* 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);
struct net_device *tdev; /* Device to other host */
struct iphdr *old_iph = skb->nh.iph;
u8 tos = old_iph->tos;
- u16 df = old_iph->frag_off;
+ __be16 df = old_iph->frag_off;
struct iphdr *iph; /* Our new IP header */
int max_headroom; /* The extra header space needed */
int mtu;
tdev = rt->u.dst.dev;
- mtu = dst_pmtu(&rt->u.dst) - sizeof(struct iphdr);
+ mtu = dst_mtu(&rt->u.dst) - sizeof(struct iphdr);
if (mtu < 68) {
ip_rt_put(rt);
IP_VS_DBG_RL("ip_vs_tunnel_xmit(): mtu less than 68\n");
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);
goto tx_error_icmp;
/* MTU checking */
- mtu = dst_pmtu(&rt->u.dst);
+ mtu = dst_mtu(&rt->u.dst);
if ((iph->frag_off&__constant_htons(IP_DF)) && skb->len > mtu) {
icmp_send(skb, ICMP_DEST_UNREACH,ICMP_FRAG_NEEDED, htonl(mtu));
ip_rt_put(rt);
/* 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);
rc = NF_ACCEPT;
/* do not touch skb anymore */
atomic_inc(&cp->in_pkts);
- __ip_vs_conn_put(cp);
goto out;
}
goto tx_error_icmp;
/* MTU checking */
- mtu = dst_pmtu(&rt->u.dst);
+ mtu = dst_mtu(&rt->u.dst);
if ((skb->len > mtu) && (skb->nh.iph->frag_off&__constant_htons(IP_DF))) {
ip_rt_put(rt);
icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, htonl(mtu));
/* 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;