diff options
author | Arnaldo Carvalho de Melo <acme@redhat.com> | 2007-04-21 01:47:35 -0400 |
---|---|---|
committer | David S. Miller <davem@sunset.davemloft.net> | 2007-04-26 01:25:10 -0400 |
commit | eddc9ec53be2ecdbf4efe0efd4a83052594f0ac0 (patch) | |
tree | 4a38ab4dbd9d61fdf5a5ea6ed61463e0b9e33ba7 /drivers/net/loopback.c | |
parent | e023dd643798c4f06c16466af90b4d250e4b8bd7 (diff) |
[SK_BUFF]: Introduce ip_hdr(), remove skb->nh.iph
Signed-off-by: Arnaldo Carvalho de Melo <acme@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
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; |