The *mac_hdr (Mac Header) pointer should be incremented ETH_HLEN
bytes to get the *ip_hdr (IP Header) pointer. Similarly, the IP
Header pointer should be incremented by (iph->ihl << 2) bytes
to get the *tcpudp_hdr (Transport Header) pointer.
Fix this by adding a u8* cast to the two pointers while doing
the pointer arithmetic.
Orabug:
19824501
Signed-off-by: Ashish Samant <ashish.samant@oracle.com>
Acked-by: Rama Nichanamatlu <rama.nichanamatlu@oracle.com>
Signed-off-by: Guangyu Sun <guangyu.sun@oracle.com>
{
struct iphdr *iph;
*mac_hdr = page_address(frags->page.p) + frags->page_offset;
- *ip_hdr = iph = (struct iphdr *)(*mac_hdr + ETH_HLEN);
- *tcpudp_hdr = (struct tcphdr *)(iph + (iph->ihl << 2));
+ *ip_hdr = iph = (struct iphdr *)((u8*)(*mac_hdr) + ETH_HLEN);
+ *tcpudp_hdr = (struct tcphdr *)((u8*)(iph) + (iph->ihl << 2));
*hdr_flags = LRO_IPV4 | LRO_TCP;
return 0;