sunvnet: Initialize network_header and transport_header in vnet_rx_one()
Subsystems (2)
PATCH 1/1 sunvnet: Initialize network_header and transport_header in vnet_rx_one()
vnet_fullcsum() accesses ip_hdr() and transport header to compute the checksum for IPv4 packets, so these need to be initialized in skb created in vnet_rx_one().
--- drivers/net/ethernet/sun/sunvnet.c | 16 +++++++++++++--- 1 files changed, 13 insertions(+), 3 deletions(-)
drivers/net/ethernet/sun/sunvnet.c +13 -3
@@ -389,17 +389,27 @@ static int vnet_rx_one(struct vnet_port *port, struct vio_net_desc *desc)if (vio_version_after_eq (&port->vio,1 ,8 )) {struct vio_net_dext *dext =vio_net_ext (desc); +skb_reset_network_header (skb); +if (dext->flags &VNET_PKT_HCK_IPV4_HDRCKSUM ) {if (skb->protocol ==ETH_P_IP ) { -struct iphdr *iph = (struct iphdr *)skb->data; +struct iphdr *iph =ip_hdr (skb); iph->check =0 ;ip_send_check (iph); } }if ((dext->flags &VNET_PKT_HCK_FULLCKSUM ) && - skb->ip_summed ==CHECKSUM_NONE ) -vnet_fullcsum (skb); + skb->ip_summed ==CHECKSUM_NONE ) { +if (skb->protocol ==htons (ETH_P_IP )) { +struct iphdr *iph =ip_hdr (skb); +int ihl = iph->ihl *4 ; + +skb_reset_transport_header (skb); +skb_set_transport_header (skb, ihl); +vnet_fullcsum (skb); + } + }if (dext->flags &VNET_PKT_HCK_IPV4_HDRCKSUM_OK ) { skb->ip_summed =CHECKSUM_PARTIAL ; skb->csum_level =0 ;
Signature · 1 line
1.7.1
David Miller
maintainerFrom: Sowmini Varadhan <[email protected]>
Date: Mon, 18 Jan 2016 16:12:09 -0500
Quoted 5 lines
vnet_fullcsum()accessesip_hdr()and transport header to compute the checksum for IPv4 packets, so these need to be initialized in skb created invnet_rx_one().Signed-off-by Sowmini Varadhan <[email protected]>
If this is a bug fix, why are you targetting net-next?
From: Sowmini Varadhan <[email protected]>
Date: Mon, 18 Jan 2016 16:12:09 -0500
Quoted 5 lines
vnet_fullcsum()accessesip_hdr()and transport header to compute the checksum for IPv4 packets, so these need to be initialized in skb created invnet_rx_one().Signed-off-by Sowmini Varadhan <[email protected]>
Applied to 'net', thanks.
Quoted 3 lines · David Miller
Quoted 1 line
Signed-off-by Sowmini Varadhan <[email protected]>If this is a bug fix, why are you targetting net-next?
It is a bug fix, but I was not sure if it should go into net or net-next, so I erred on the side of caution.
--Sowmini