pr_debug("Needs csum!\n"); skb->ip_summed = CHECKSUM_PARTIAL; skb->csum_start = hdr->csum_start; skb->csum_offset = hdr->csum_offset;if(skb->csum_start > skb->len -2|| skb->csum_offset > skb->len -2) {if(net_ratelimit()) printk(KERN_WARNING"%s: csum=%u/%u len=%u\n...
free_old_xmit_skbs(vi);/* Encode metadata header at front. */hdr = skb_vnet_hdr(skb);if(skb->ip_summed == CHECKSUM_PARTIAL) { hdr->flags = VIRTIO_NET_HDR_F_NEEDS_CSUM; hdr->csum_start = skb->csum_start - skb_headroom(skb); hdr->csum_offset = skb->csum_offset; }else{ h...
RH_KABI_EXTEND(__u8 csum_complete_sw:1) RH_KABI_EXTEND(__u8 xmit_more:1) RH_KABI_EXTEND(__u8 inner_protocol_type:1) RH_KABI_EXTEND(__u8 remcsum_offload:1)/*0/2 bit hole (depending on ndisc_nodetype presence)*/kmemcheck_bitfield_end(flags2);#ifdefined CONFIG_NET_DMA_RH_KABI |...
offset, len] tuples for SKB data came about sothat file system file contents could be directly sent over a socket. But, as itturns out, it is sometimes beneficial to use this for nomal buffering ofprocess sendmsg() data.
csum= 0;1839if (csstart !=skb->len)1840csum=skb_copy_and_csum_bits(skb, csstart, to + csstart,1841skb->len- csstart, 0);18421843if (skb->ip_summed ==CHECKSUM_PARTIAL) {1844long csstuff = csstart +skb->csum_offset;18451846*((__sum16*)(to + csstuff)) =csum_fold(csum);...
__u32 csum_offset; /* 4 */ }; /* 164 4 */ __u32 priority; /* 168 4 */ __u8 local_df:1; /* 172 1 */ __u8 cloned:1; /* 172 1 */ __u8 ip_summed:2; /* 172 1 */ __u8 nohdr:1; /* 172 1 */ __u8 nfctinfo:3; /* 172 1 */ ...
csum; __u32 priority; __u8 local_df:1, cloned:1, ip_summed:2, nohdr:1, nfctinfo:3; __u8 pkt_type:3, fclone:2; __be16 protocol; void (*destructor)(struct sk_buff *skb); /* These elements must be at the end, see alloc_skb() for details. */ ...
138 __u16 csum_offset; 139 }; 140 }; 141 __u32 priority; /*优先级,主要用于QOS*/ 142 int skb_iif; /*接收设备的index*/ 143 __u32 hash; 144 __be16 vlan_proto; 145 __u16 vlan_tci; 146 #if defined(CONFIG_NET_RX_BUSY_POLL) || defined(CONFIG_XPS) ...
skb) return; if (lp->p_encap == ISDN_NET_ENCAP_ETHER) { - int pullsize = (ulong)skb->nh.raw - (ulong)skb->data - ETH_HLEN; + const int pullsize = skb_network_offset(skb) - ETH_HLEN; if (pullsize > 0) { printk(KERN_DEBUG "isdn_net: Pull junk %d\n", pullsize); ...
注:我的机子是32位x86机器,所以没有定义NET_SKBUFF_DATA_USES_OFFSET,因而, skb->tail,skb->mac_header,skb->network_header,skb->transport_header这几个成员都是指针 */ if (NULL == skb) goto out; skb_reserve (skb, LL_RESERVED_SPACE (dev));//add data and tail ...