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...
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(s...
dst 代码在 Linux 内核中实现协议无关的目标缓存。为了继续学习发送 UDP 数据报的流程 ,我们需要了解 dst 条目是如何被设置的,首先来看 dst 条目和路由是如何生成的。目标缓存,路由和邻居子系统,任何一个都可以拿来单独详细的介绍。现在不深入细节,只是快速地看一下它们是如何组合到一起的。 上面看到的代码调用了 ...
(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...
newpn->pn_sk.sobject = pn_sockaddr_get_object(&dst); newpn->pn_sk.resource = pn->pn_sk.resource; skb_queue_head_init(&newpn->ctrlreq_queue); newpn->pipe_handle = pipe_handle; atomic_set(&newpn->tx_credits,0); newpn->peer_type = peer_type; ...
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(...
newpn->pn_sk.sobject = pn_sockaddr_get_object(&dst); newpn->pn_sk.resource = pn->pn_sk.resource; skb_queue_head_init(&newpn->ctrlreq_queue); newpn->pipe_handle = pipe_handle; atomic_set(&newpn->tx_credits,0); newpn->peer_type = peer_type; ...