函数原型:static inline __wsum lco_csum(struct sk_buff *skb) 返回类型:__wsum 参数: 类型参数名称 struct sk_buff * skb 4506 csum_start等于skb_checksum_start(skb) 4507 l4_hdr等于skb_transport_header(skb) 4511 partial等于csum_unfold( * (__force__sum16 * )(csum_start + csum_offset))的...
csum_start + sizeof(struct tcphdr); } else { vh.csum_offset = __builtin_offsetof(struct udphdr, check); vh.hdr_len = vh.csum_start + sizeof(struct udphdr); }eth_str_to_addr(cfg_mac_src, eth.h_source); eth_str_to_addr(cfg_mac_dst, eth.h_dest);...
- test skb_transport_header, which is set along with csum_start in skb_partial_csum_set in the normal header_ops datapath. Turns out skbs can arrive in this branch without the transport header set, e.g., through BPF redirection. Revise the check back to check csum_start directly, and ...
staticintrt_icmp_glue_reply_bits(constvoid*p,char*to,unsignedintoffset,unsignedintfraglen){structicmp_bxm*icmp_param= (structicmp_bxm*)p;structicmphdr*icmph;unsignedlongcsum;/*TODO:add support for fragmented ICMP packets */if(offset !=0)return-EMSGSIZE; csum = csum_partial_copy_nocheck((...
new_start_seq = htonl(ntohl(sack->start_seq) - natseq->offset_after);elsenew_start_seq = htonl(ntohl(sack->start_seq) - natseq->offset_before);if(after(ntohl(sack->end_seq) - natseq->offset_before, natseq->correction_pos)) ...
void skb_copy_and_csum_dev(const struct sk_buff *skb, u8 *to) 1825 { 1826 __wsum csum; 1827 long csstart; 1828 1829 if (skb->ip_summed == CHECKSUM_PARTIAL) 1830 ...
static struct running_checksum *xxhash_start_running_checksum(void) { struct xxhash_running_checksum *c = calloc(1, sizeof(struct xxhash_running_checksum)); XXH64_reset(&c->td64, 0); return priv_to_rc(c); }static void xxhash_add_to_running_checksum(struct running_checksum *_c,...