diff options
Diffstat (limited to 'drivers/net/ethernet/sun/sunvnet.c')
-rw-r--r-- | drivers/net/ethernet/sun/sunvnet.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/drivers/net/ethernet/sun/sunvnet.c b/drivers/net/ethernet/sun/sunvnet.c index cc106d892e29..23fa29877f5b 100644 --- a/drivers/net/ethernet/sun/sunvnet.c +++ b/drivers/net/ethernet/sun/sunvnet.c | |||
@@ -389,17 +389,27 @@ static int vnet_rx_one(struct vnet_port *port, struct vio_net_desc *desc) | |||
389 | if (vio_version_after_eq(&port->vio, 1, 8)) { | 389 | if (vio_version_after_eq(&port->vio, 1, 8)) { |
390 | struct vio_net_dext *dext = vio_net_ext(desc); | 390 | struct vio_net_dext *dext = vio_net_ext(desc); |
391 | 391 | ||
392 | skb_reset_network_header(skb); | ||
393 | |||
392 | if (dext->flags & VNET_PKT_HCK_IPV4_HDRCKSUM) { | 394 | if (dext->flags & VNET_PKT_HCK_IPV4_HDRCKSUM) { |
393 | if (skb->protocol == ETH_P_IP) { | 395 | if (skb->protocol == ETH_P_IP) { |
394 | struct iphdr *iph = (struct iphdr *)skb->data; | 396 | struct iphdr *iph = ip_hdr(skb); |
395 | 397 | ||
396 | iph->check = 0; | 398 | iph->check = 0; |
397 | ip_send_check(iph); | 399 | ip_send_check(iph); |
398 | } | 400 | } |
399 | } | 401 | } |
400 | if ((dext->flags & VNET_PKT_HCK_FULLCKSUM) && | 402 | if ((dext->flags & VNET_PKT_HCK_FULLCKSUM) && |
401 | skb->ip_summed == CHECKSUM_NONE) | 403 | skb->ip_summed == CHECKSUM_NONE) { |
402 | vnet_fullcsum(skb); | 404 | if (skb->protocol == htons(ETH_P_IP)) { |
405 | struct iphdr *iph = ip_hdr(skb); | ||
406 | int ihl = iph->ihl * 4; | ||
407 | |||
408 | skb_reset_transport_header(skb); | ||
409 | skb_set_transport_header(skb, ihl); | ||
410 | vnet_fullcsum(skb); | ||
411 | } | ||
412 | } | ||
403 | if (dext->flags & VNET_PKT_HCK_IPV4_HDRCKSUM_OK) { | 413 | if (dext->flags & VNET_PKT_HCK_IPV4_HDRCKSUM_OK) { |
404 | skb->ip_summed = CHECKSUM_PARTIAL; | 414 | skb->ip_summed = CHECKSUM_PARTIAL; |
405 | skb->csum_level = 0; | 415 | skb->csum_level = 0; |