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 /net/ipv4/ipvs/ip_vs_xmit.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 'net/ipv4/ipvs/ip_vs_xmit.c')
-rw-r--r-- | net/ipv4/ipvs/ip_vs_xmit.c | 24 |
1 files changed, 12 insertions, 12 deletions
diff --git a/net/ipv4/ipvs/ip_vs_xmit.c b/net/ipv4/ipvs/ip_vs_xmit.c index d1403d0855ed..a7aee6822033 100644 --- a/net/ipv4/ipvs/ip_vs_xmit.c +++ b/net/ipv4/ipvs/ip_vs_xmit.c | |||
@@ -156,7 +156,7 @@ ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, | |||
156 | struct ip_vs_protocol *pp) | 156 | struct ip_vs_protocol *pp) |
157 | { | 157 | { |
158 | struct rtable *rt; /* Route to the other host */ | 158 | struct rtable *rt; /* Route to the other host */ |
159 | struct iphdr *iph = skb->nh.iph; | 159 | struct iphdr *iph = ip_hdr(skb); |
160 | u8 tos = iph->tos; | 160 | u8 tos = iph->tos; |
161 | int mtu; | 161 | int mtu; |
162 | struct flowi fl = { | 162 | struct flowi fl = { |
@@ -193,7 +193,7 @@ ip_vs_bypass_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, | |||
193 | ip_rt_put(rt); | 193 | ip_rt_put(rt); |
194 | return NF_STOLEN; | 194 | return NF_STOLEN; |
195 | } | 195 | } |
196 | ip_send_check(skb->nh.iph); | 196 | ip_send_check(ip_hdr(skb)); |
197 | 197 | ||
198 | /* drop old route */ | 198 | /* drop old route */ |
199 | dst_release(skb->dst); | 199 | dst_release(skb->dst); |
@@ -226,7 +226,7 @@ ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, | |||
226 | { | 226 | { |
227 | struct rtable *rt; /* Route to the other host */ | 227 | struct rtable *rt; /* Route to the other host */ |
228 | int mtu; | 228 | int mtu; |
229 | struct iphdr *iph = skb->nh.iph; | 229 | struct iphdr *iph = ip_hdr(skb); |
230 | 230 | ||
231 | EnterFunction(10); | 231 | EnterFunction(10); |
232 | 232 | ||
@@ -266,8 +266,8 @@ ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, | |||
266 | /* mangle the packet */ | 266 | /* mangle the packet */ |
267 | if (pp->dnat_handler && !pp->dnat_handler(&skb, pp, cp)) | 267 | if (pp->dnat_handler && !pp->dnat_handler(&skb, pp, cp)) |
268 | goto tx_error; | 268 | goto tx_error; |
269 | skb->nh.iph->daddr = cp->daddr; | 269 | ip_hdr(skb)->daddr = cp->daddr; |
270 | ip_send_check(skb->nh.iph); | 270 | ip_send_check(ip_hdr(skb)); |
271 | 271 | ||
272 | IP_VS_DBG_PKT(10, pp, skb, 0, "After DNAT"); | 272 | IP_VS_DBG_PKT(10, pp, skb, 0, "After DNAT"); |
273 | 273 | ||
@@ -320,7 +320,7 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, | |||
320 | { | 320 | { |
321 | struct rtable *rt; /* Route to the other host */ | 321 | struct rtable *rt; /* Route to the other host */ |
322 | struct net_device *tdev; /* Device to other host */ | 322 | struct net_device *tdev; /* Device to other host */ |
323 | struct iphdr *old_iph = skb->nh.iph; | 323 | struct iphdr *old_iph = ip_hdr(skb); |
324 | u8 tos = old_iph->tos; | 324 | u8 tos = old_iph->tos; |
325 | __be16 df = old_iph->frag_off; | 325 | __be16 df = old_iph->frag_off; |
326 | struct iphdr *iph; /* Our new IP header */ | 326 | struct iphdr *iph; /* Our new IP header */ |
@@ -377,7 +377,7 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, | |||
377 | } | 377 | } |
378 | kfree_skb(skb); | 378 | kfree_skb(skb); |
379 | skb = new_skb; | 379 | skb = new_skb; |
380 | old_iph = skb->nh.iph; | 380 | old_iph = ip_hdr(skb); |
381 | } | 381 | } |
382 | 382 | ||
383 | skb->h.raw = (void *) old_iph; | 383 | skb->h.raw = (void *) old_iph; |
@@ -396,7 +396,7 @@ ip_vs_tunnel_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, | |||
396 | /* | 396 | /* |
397 | * Push down and install the IPIP header. | 397 | * Push down and install the IPIP header. |
398 | */ | 398 | */ |
399 | iph = skb->nh.iph; | 399 | iph = ip_hdr(skb); |
400 | iph->version = 4; | 400 | iph->version = 4; |
401 | iph->ihl = sizeof(struct iphdr)>>2; | 401 | iph->ihl = sizeof(struct iphdr)>>2; |
402 | iph->frag_off = df; | 402 | iph->frag_off = df; |
@@ -436,7 +436,7 @@ ip_vs_dr_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, | |||
436 | struct ip_vs_protocol *pp) | 436 | struct ip_vs_protocol *pp) |
437 | { | 437 | { |
438 | struct rtable *rt; /* Route to the other host */ | 438 | struct rtable *rt; /* Route to the other host */ |
439 | struct iphdr *iph = skb->nh.iph; | 439 | struct iphdr *iph = ip_hdr(skb); |
440 | int mtu; | 440 | int mtu; |
441 | 441 | ||
442 | EnterFunction(10); | 442 | EnterFunction(10); |
@@ -461,7 +461,7 @@ ip_vs_dr_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, | |||
461 | ip_rt_put(rt); | 461 | ip_rt_put(rt); |
462 | return NF_STOLEN; | 462 | return NF_STOLEN; |
463 | } | 463 | } |
464 | ip_send_check(skb->nh.iph); | 464 | ip_send_check(ip_hdr(skb)); |
465 | 465 | ||
466 | /* drop old route */ | 466 | /* drop old route */ |
467 | dst_release(skb->dst); | 467 | dst_release(skb->dst); |
@@ -515,12 +515,12 @@ ip_vs_icmp_xmit(struct sk_buff *skb, struct ip_vs_conn *cp, | |||
515 | * mangle and send the packet here (only for VS/NAT) | 515 | * mangle and send the packet here (only for VS/NAT) |
516 | */ | 516 | */ |
517 | 517 | ||
518 | if (!(rt = __ip_vs_get_out_rt(cp, RT_TOS(skb->nh.iph->tos)))) | 518 | if (!(rt = __ip_vs_get_out_rt(cp, RT_TOS(ip_hdr(skb)->tos)))) |
519 | goto tx_error_icmp; | 519 | goto tx_error_icmp; |
520 | 520 | ||
521 | /* MTU checking */ | 521 | /* MTU checking */ |
522 | mtu = dst_mtu(&rt->u.dst); | 522 | mtu = dst_mtu(&rt->u.dst); |
523 | if ((skb->len > mtu) && (skb->nh.iph->frag_off & htons(IP_DF))) { | 523 | if ((skb->len > mtu) && (ip_hdr(skb)->frag_off & htons(IP_DF))) { |
524 | ip_rt_put(rt); | 524 | ip_rt_put(rt); |
525 | icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, htonl(mtu)); | 525 | icmp_send(skb, ICMP_DEST_UNREACH, ICMP_FRAG_NEEDED, htonl(mtu)); |
526 | IP_VS_DBG_RL("ip_vs_in_icmp(): frag needed\n"); | 526 | IP_VS_DBG_RL("ip_vs_in_icmp(): frag needed\n"); |