goto abort_transaction;
}
+ /* We can cope with transmit checksum offload packets
+ in which the TCP and IP headers are in separate
+ fragments. */
+ err = xenbus_printf(xbt, dev->nodename,
+ "feature-tx-csum-split-header", "%d", 1);
+ if (err) {
+ message = "writing feature-tx-csum-split-header";
+ goto abort_transaction;
+ }
+
/*
* We don't support rx-flip path (except old guests who don't
* grok this feature flag).
}
#if defined(CONFIG_XEN) || defined(CONFIG_PARAVIRT_XEN)
+static int skb_pull_up_to(struct sk_buff *skb, void *ptr)
+{
+ if (ptr < (void *)skb_tail_pointer(skb))
+ return 1;
+ if (__pskb_pull_tail(skb,
+ ptr - (void *)skb->data - skb_headlen(skb))) {
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
inline int skb_checksum_setup(struct sk_buff *skb)
{
struct iphdr *iph;
iph = ip_hdr(skb);
th = skb_network_header(skb) + 4 * iph->ihl;
- if (th >= skb_tail_pointer(skb))
+ if (!skb_pull_up_to(skb, iph + 1))
goto out;
skb->csum_start = th - skb->head;
goto out;
}
- if ((th + skb->csum_offset + 2) > skb_tail_pointer(skb))
+ if (!skb_pull_up_to(skb, th + skb->csum_offset + 2))
goto out;
#ifdef CONFIG_XEN