static inline int ip_forward_finish(struct sk_buff *skb) { struct ip_options * opt = &(IPCB(skb)->opt); IP_INC_STATS_BH(IpForwDatagrams); if (opt->optlen == 0) { #ifdef CONFIG_NET_FASTROUTE struct rtable *rt = (struct rtable*)skb->dst; if (rt->rt_flags&RTCF_FAST && !netdev_fastroute_obstacles) { struct dst_entry *old_dst; unsigned h = ((*(u8*)&rt->key.dst)^(*(u8*)&rt->key.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)); }
static inline int ip_forward_finish(struct sk_buff *skb) { struct ip_options * opt = &(IPCB(skb)->opt); IP_INC_STATS_BH(IPSTATS_MIB_OUTFORWDATAGRAMS); if (unlikely(opt->optlen)) ip_forward_options(skb); return dst_output(skb); }
static int ip_forward_finish(struct sk_buff *skb) { struct ip_options *opt = &(IPCB(skb)->opt); IP_INC_STATS_BH(dev_net(skb_dst(skb)->dev), IPSTATS_MIB_OUTFORWDATAGRAMS); IP_ADD_STATS_BH(dev_net(skb_dst(skb)->dev), IPSTATS_MIB_OUTOCTETS, skb->len); if (unlikely(opt->optlen)) ip_forward_options(skb); return dst_output(skb); }
static int ip_forward_finish(struct net *net, struct sock *sk, struct sk_buff *skb) { struct ip_options *opt = &(IPCB(skb)->opt); __IP_INC_STATS(net, IPSTATS_MIB_OUTFORWDATAGRAMS); __IP_ADD_STATS(net, IPSTATS_MIB_OUTOCTETS, skb->len); if (unlikely(opt->optlen)) ip_forward_options(skb); return dst_output(net, sk, skb); }
s32 mpls_forward(struct sk_buff*skb) { struct ip_options * opt = &(IPCB(skb)->opt); MPLS_DEBUG_FORWARD("Entry mpls_forward.\n "); MPLS_DEBUG_COUNTER_INC(mpls_forward); if (FF_ENABLE) { /*Mpls not support fast route now, so, set linux forward flag.*/ skb->ff_flag = ff_set_flag(skb, DRV_FF_FLAG_LINUX_FORWARD); } IP_INC_STATS_BH(if_dev_vrf(skb->dst->dev), IPSTATS_MIB_OUTFORWDATAGRAMS); if (unlikely(opt->optlen)) ip_forward_options(skb); return dst_output(skb); }
static int ip_forward_finish(struct sk_buff *skb) { struct ip_options * opt = &(IPCB(skb)->opt); IP_INC_STATS_BH(dev_net(skb_dst(skb)->dev), IPSTATS_MIB_OUTFORWDATAGRAMS); if (unlikely(opt->optlen)) ip_forward_options(skb); #ifdef CONFIG_NET_GIANFAR_FP else { struct rtable *rt = skb_rtable(skb); #ifdef FASTPATH_DEBUG if (printk_ratelimit()) printk(KERN_INFO" %s: rt = %p, rt->rt_flags = %x " "(fast=%x), netdev_fastroute_ob=%d\n", __func___, rt, rt ? rt->rt_flags : 0, RTCF_FAST, netdev_fastroute_obstacles); #endif if ((rt->rt_flags & RTCF_FAST) && !netdev_fastroute_obstacles) { struct dst_entry *old_dst; unsigned h = gfar_fastroute_hash(*(u8 *)&rt->rt_dst, *(u8 *)&rt->rt_src); #ifdef FASTPATH_DEBUG if (printk_ratelimit()) printk(KERN_INFO " h = %d (%d, %d)\n", h, rt->rt_dst, rt->rt_src); #endif 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 dst_output(skb); }