Commit ca77d319 authored by Alexey Kuznetsov's avatar Alexey Kuznetsov Committed by Hideaki Yoshifuji

[IPV4]: Kill ip_send, use dst_output instead.

parent 29cdd1db
...@@ -162,14 +162,6 @@ extern int sysctl_local_port_range[2]; ...@@ -162,14 +162,6 @@ extern int sysctl_local_port_range[2];
extern int sysctl_ip_default_ttl; extern int sysctl_ip_default_ttl;
#ifdef CONFIG_INET #ifdef CONFIG_INET
static inline int ip_send(struct sk_buff *skb)
{
if (skb->len > skb->dst->pmtu)
return ip_fragment(skb, ip_finish_output);
else
return ip_finish_output(skb);
}
/* The function in 2.2 was invalid, producing wrong result for /* The function in 2.2 was invalid, producing wrong result for
* check=0xFEFF. It was noticed by Arthur Skawina _year_ ago. --ANK(000625) */ * check=0xFEFF. It was noticed by Arthur Skawina _year_ ago. --ANK(000625) */
static inline static inline
......
...@@ -34,7 +34,7 @@ struct ip_tunnel ...@@ -34,7 +34,7 @@ struct ip_tunnel
ip_select_ident(iph, &rt->u.dst, NULL); \ ip_select_ident(iph, &rt->u.dst, NULL); \
ip_send_check(iph); \ ip_send_check(iph); \
\ \
err = NF_HOOK(PF_INET, NF_IP_LOCAL_OUT, skb, NULL, rt->u.dst.dev, do_ip_send); \ err = NF_HOOK(PF_INET, NF_IP_LOCAL_OUT, skb, NULL, rt->u.dst.dev, dst_output);\
if (err == NET_XMIT_SUCCESS || err == NET_XMIT_CN) { \ if (err == NET_XMIT_SUCCESS || err == NET_XMIT_CN) { \
stats->tx_bytes += pkt_len; \ stats->tx_bytes += pkt_len; \
stats->tx_packets++; \ stats->tx_packets++; \
......
...@@ -47,27 +47,10 @@ static inline int ip_forward_finish(struct sk_buff *skb) ...@@ -47,27 +47,10 @@ static inline int ip_forward_finish(struct sk_buff *skb)
IP_INC_STATS_BH(IpForwDatagrams); IP_INC_STATS_BH(IpForwDatagrams);
if (opt->optlen == 0) { if (unlikely(opt->optlen))
#ifdef CONFIG_NET_FASTROUTE ip_forward_options(skb);
struct rtable *rt = (struct rtable*)skb->dst;
if (rt->rt_flags&RTCF_FAST && !netdev_fastroute_obstacles) { return dst_output(skb);
struct dst_entry *old_dst;
unsigned h = ((*(u8*)&rt->fl.fl4_dst)^(*(u8*)&rt->fl.fl4_src))&NETDEV_FASTROUTE_HMASK;
write_lock_irq(&skb->dev->fastpath_lock);
old_dst = skb->dev->fastpath[h];
skb->dev->fastpath[h] = dst_clone(&rt->u.dst);
write_unlock_irq(&skb->dev->fastpath_lock);
dst_release(old_dst);
}
#endif
return (ip_send(skb));
}
ip_forward_options(skb);
return (ip_send(skb));
} }
int ip_forward(struct sk_buff *skb) int ip_forward(struct sk_buff *skb)
......
...@@ -675,12 +675,6 @@ int ipgre_rcv(struct sk_buff *skb) ...@@ -675,12 +675,6 @@ int ipgre_rcv(struct sk_buff *skb)
return(0); return(0);
} }
/* Need this wrapper because NF_HOOK takes the function address */
static inline int do_ip_send(struct sk_buff *skb)
{
return ip_send(skb);
}
static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev) static int ipgre_tunnel_xmit(struct sk_buff *skb, struct net_device *dev)
{ {
struct ip_tunnel *tunnel = (struct ip_tunnel*)dev->priv; struct ip_tunnel *tunnel = (struct ip_tunnel*)dev->priv;
......
...@@ -521,12 +521,6 @@ int ipip_rcv(struct sk_buff *skb) ...@@ -521,12 +521,6 @@ int ipip_rcv(struct sk_buff *skb)
return 0; return 0;
} }
/* Need this wrapper because NF_HOOK takes the function address */
static inline int do_ip_send(struct sk_buff *skb)
{
return ip_send(skb);
}
/* /*
* This function assumes it is being called from dev_queue_xmit() * This function assumes it is being called from dev_queue_xmit()
* and that skb is filled properly by that function. * and that skb is filled properly by that function.
......
...@@ -423,13 +423,6 @@ static int ipip6_rcv(struct sk_buff *skb) ...@@ -423,13 +423,6 @@ static int ipip6_rcv(struct sk_buff *skb)
return 0; return 0;
} }
/* Need this wrapper because NF_HOOK takes the function address */
static inline int do_ip_send(struct sk_buff *skb)
{
return ip_send(skb);
}
/* Returns the embedded IPv4 address if the IPv6 address /* Returns the embedded IPv4 address if the IPv6 address
comes from 6to4 (draft-ietf-ngtrans-6to4-04) addr space */ comes from 6to4 (draft-ietf-ngtrans-6to4-04) addr space */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment