skb_dst_is_noref 检查skb的dst未被引用 skb_rtable skb_rtable - Returns the skb &rtable*@skb: buffer __skb_dst_copy skb_dst_force 确保DST是引用计数 dst_link_failure dst_output Output packet to network from transport. dst_input Input packet from network to transport. skb_dst_update...
上面看到的代码调用了 dst_output(skb) 。此函数只是查找关联到这个 skb 的 dst 条目 ,然后调用 output 方法。代码如下: /* Output packet to network from transport. */ staticinlineintdst_output(structsk_buff*skb) { returnskb_dst(skb)->output(skb); } 看起来很简单,但是 output 方法之前是如何关联...
staticintdn_long_output(struct sk_buff *skb){structdst_entry*dst=skb->dst;structneighbour*neigh=dst->neighbour;structnet_device*dev=neigh->dev;intheadroom = dev->hard_header_len +sizeof(struct dn_long_packet) +3;unsignedchar*data;structdn_long_packet*lp;structdn_skb_cb*cb=DN_SKB_CB(s...
head->dev = dev_get_by_index_rcu(net, qp->iif);if(!head->dev)gotoout_rcu_unlock;/* skb has no dst, perform route lookup again */iph = ip_hdr(head); err = ip_route_input_noref(head, iph->daddr, iph->saddr, iph->tos, head->dev);if(err)gotoout_rcu_unlock;/* Only an ...
(struct rt6_info *)dst, &ipv6_hdr(skb)->daddr); neigh = __ipv6_neigh_lookup_noref(dst->dev, nexthop); if (unlikely(!neigh)) neigh = __neigh_create(&nd_tbl, nexthop, dst->dev, false); if (!IS_ERR(neigh)) { ret = dst_neigh_output(dst, neigh, skb); rcu_read_unlock...
staticintip6_output2(struct sk_buff *skb){structdst_entry*dst=skb->dst;structnet_device*dev=dst->dev;skb->protocol = htons(ETH_P_IPV6); skb->dev = dev;if(ipv6_addr_is_multicast(&skb->nh.ipv6h->daddr)) {structipv6_pinfo*np=skb->sk?inet6_sk(skb->sk) :NULL;if(!(dev-...
tuple->dst.u3.ip != htonl(dcc_ip)) {if(net_ratelimit()) printk(KERN_WARNING"Forged DCC command from %pI4: %pI4:%u\n", &tuple->src.u3.ip, &dcc_ip, dcc_port);continue; }exp= nf_conntrack_expect_alloc(ct);if(exp==NULL) { ...
head->dev = dev_get_by_index_rcu(net, qp->iif);if(!head->dev)gotoout_rcu_unlock;/* skb has no dst, perform route lookup again */iph = ip_hdr(head); err = ip_route_input_noref(head, iph->daddr, iph->saddr, iph->tos, head->dev);if(err)gotoout_rcu_unlock;/* Only an...
staticintdn_long_output(struct sk_buff *skb){structdst_entry*dst=skb->dst;structneighbour*neigh=dst->neighbour;structnet_device*dev=neigh->dev;intheadroom = dev->hard_header_len +sizeof(struct dn_long_packet) +3;unsignedchar*data;structdn_long_packet*lp;structdn_skb_cb*cb=DN_SKB_CB(...
staticintip6_output2(struct sk_buff *skb){structdst_entry*dst=skb->dst;structnet_device*dev=dst->dev;skb->protocol = htons(ETH_P_IPV6); skb->dev = dev;if(ipv6_addr_is_multicast(&skb->nh.ipv6h->daddr)) {structipv6_pinfo*np=skb->sk?inet6_sk(skb->sk) :NULL;if(!(dev-...