全部博文(168)
分类: 虚拟化
2012-12-08 10:14:55
ctx->l4_hdr_size =
compat_skb_tcp_header(skb)->doff * 4; else if (iph->protocol == IPPROTO_UDP) - /* - * Use TCP header size so that bytes to - * copied are more than the minimum - * required by the backend. - */ ctx->l4_hdr_size = - sizeof(struct tcphdr); + sizeof(struct udphdr); else ctx->l4_hdr_size = 0; } else { /* for simplicity, don't copy L4 headers */ ctx->l4_hdr_size = 0; } |
- ctx->copy_size = ctx->eth_ip_hdr_size +
- ctx->l4_hdr_size; + /* make sure that copy size is not exceeding pkt len */ + ctx->copy_size = min((ctx->eth_ip_hdr_size + + ctx->l4_hdr_size), skb->len); |