问skb_tail_pointer(skb)不能正常工作。并错误地指向udp头尾。EN解决方法如下 修改/etc/udev/rules....
skb_set_tail_pointer(skb, len);//下面把实现函数代码注释进来,方便理解//static inline void skb_set_tail_pointer(struct sk_buff *skb, const int offset)//{///这是把tail指针移到数据区的最后面//skb->tail = skb->data + offset;//}}//这是拆分分片结构数据区数据,同理,其他参数不变,参数:p...
}staticinlinevoidskb_set_tail_pointer(structsk_buff *skb,constintoffset) { skb_reset_tail_pointer(skb); skb->tail +=offset; }#else/* NET_SKBUFF_DATA_USES_OFFSET */staticinline unsignedchar*skb_tail_pointer(conststructsk_buff *skb) {returnskb->tail; }staticinlinevoidskb_reset_tail_pointer...
skb->tail += delta; // 非线性数据减去delta skb->data_len -= delta; if(!skb->data_len) skb_zcopy_clear(skb,false); returnskb_tail_pointer(skb); } 基本的步骤如下: 1.计算需要的扩展的字节,并扩展(skb->tail + delta) - skb->end+1282.先移动frags,再移动frag_list3.更新skb中的元数...
staticinlinevoidskb_reset_tail_pointer(structsk_buff*skb){skb->tail=skb->data-skb->head;}staticinlinevoidskb_set_tail_pointer(structsk_buff*skb,constintoffset){skb_reset_tail_pointer(skb);skb->tail+=offset;}#else/* NET_SKBUFF_DATA_USES_OFFSET */staticinlineunsignedchar*skb_tail_pointer(...
skb->tail += len ; } /** * skb_put - add data to a buffer * @skb : buffer to use * @len : amount of data to add * * This function extends the used data area of the buffer. If this would * exceed the total buffer size the kernel will panic. A pointer to the ...
skb_trim(): 将网络报文的长度缩减到len,丢弃了网络报文尾部的填充值,即skb->tail指针向前移动(skb->tail - skb->data - len)个字节。 pskb_may_pull():函数用来保证skb的线性数据长度至少有len的大小。 skb_header_pointer():从skb字段中获取指定长度到内容到缓存中。
* the tail pointer in struct */ memset(skb, 0, offsetof(struct sk_buff, tail)); skb->truesize = size + sizeof(struct sk_buff); atomic_set(&skb->users, 1); skb->head = data; skb->data = data; skb_reset_tail_pointer(skb); ...
skb->csum = csum_and_copy_from_user(user_pointer, data, user_data_len, 0, &err); if (err) goto user_fault; This is what a new SKB looks like right after the user data is added. skb_put() advances 'skb->tail' by the specified number of bytes, it also increments 'skb->len'...
As you can see, the head, data, and tailpointers all point to the beginning of the data buffer. And the end pointerpoints to the end of it. Note that all of the data area is considered tailroom. The length of this SKB is zero, it isn'tvery interesting since it doesn't contain an...