diff options
Diffstat (limited to 'drivers/net/loopback.c')
-rw-r--r-- | drivers/net/loopback.c | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/drivers/net/loopback.c b/drivers/net/loopback.c index 9265c27b13b2..20b5cb101368 100644 --- a/drivers/net/loopback.c +++ b/drivers/net/loopback.c | |||
@@ -75,7 +75,7 @@ static DEFINE_PER_CPU(struct pcpu_lstats, pcpu_lstats); | |||
75 | #ifdef LOOPBACK_TSO | 75 | #ifdef LOOPBACK_TSO |
76 | static void emulate_large_send_offload(struct sk_buff *skb) | 76 | static void emulate_large_send_offload(struct sk_buff *skb) |
77 | { | 77 | { |
78 | struct iphdr *iph = skb->nh.iph; | 78 | struct iphdr *iph = ip_hdr(skb); |
79 | struct tcphdr *th = (struct tcphdr *)(skb_network_header(skb) + | 79 | struct tcphdr *th = (struct tcphdr *)(skb_network_header(skb) + |
80 | (iph->ihl * 4)); | 80 | (iph->ihl * 4)); |
81 | unsigned int doffset = (iph->ihl + th->doff) * 4; | 81 | unsigned int doffset = (iph->ihl + th->doff) * 4; |
@@ -93,7 +93,7 @@ static void emulate_large_send_offload(struct sk_buff *skb) | |||
93 | skb_reserve(nskb, 32); | 93 | skb_reserve(nskb, 32); |
94 | skb_set_mac_header(nskb, -ETH_HLEN); | 94 | skb_set_mac_header(nskb, -ETH_HLEN); |
95 | skb_reset_network_header(nskb); | 95 | skb_reset_network_header(nskb); |
96 | iph = nskb->nh.iph; | 96 | iph = ip_hdr(nskb); |
97 | memcpy(nskb->data, skb_network_header(skb), doffset); | 97 | memcpy(nskb->data, skb_network_header(skb), doffset); |
98 | if (skb_copy_bits(skb, | 98 | if (skb_copy_bits(skb, |
99 | doffset + offset, | 99 | doffset + offset, |
@@ -145,7 +145,7 @@ static int loopback_xmit(struct sk_buff *skb, struct net_device *dev) | |||
145 | #ifdef LOOPBACK_TSO | 145 | #ifdef LOOPBACK_TSO |
146 | if (skb_is_gso(skb)) { | 146 | if (skb_is_gso(skb)) { |
147 | BUG_ON(skb->protocol != htons(ETH_P_IP)); | 147 | BUG_ON(skb->protocol != htons(ETH_P_IP)); |
148 | BUG_ON(skb->nh.iph->protocol != IPPROTO_TCP); | 148 | BUG_ON(ip_hdr(skb)->protocol != IPPROTO_TCP); |
149 | 149 | ||
150 | emulate_large_send_offload(skb); | 150 | emulate_large_send_offload(skb); |
151 | return 0; | 151 | return 0; |