aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipvs
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-04-10 23:50:43 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:24:59 -0400
commitd56f90a7c96da5187f0cdf07ee7434fe6aa78bbc (patch)
tree3b9073cecfbb3b6a1e25ab2b5dd2a22a43aef238 /net/ipv4/ipvs
parentbbe735e4247dba32568a305553b010081c8dea99 (diff)
[SK_BUFF]: Introduce skb_network_header()
For the places where we need a pointer to the network header, it is still legal to touch skb->nh.raw directly if just adding to, subtracting from or setting it to another layer header. 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')
-rw-r--r--net/ipv4/ipvs/ip_vs_app.c4
-rw-r--r--net/ipv4/ipvs/ip_vs_core.c3
2 files changed, 4 insertions, 3 deletions
diff --git a/net/ipv4/ipvs/ip_vs_app.c b/net/ipv4/ipvs/ip_vs_app.c
index 22e104c6a493..f29d3a27eec6 100644
--- a/net/ipv4/ipvs/ip_vs_app.c
+++ b/net/ipv4/ipvs/ip_vs_app.c
@@ -338,7 +338,7 @@ static inline int app_tcp_pkt_out(struct ip_vs_conn *cp, struct sk_buff **pskb,
338 if (!ip_vs_make_skb_writable(pskb, tcp_offset + sizeof(*th))) 338 if (!ip_vs_make_skb_writable(pskb, tcp_offset + sizeof(*th)))
339 return 0; 339 return 0;
340 340
341 th = (struct tcphdr *)((*pskb)->nh.raw + tcp_offset); 341 th = (struct tcphdr *)(skb_network_header(*pskb) + tcp_offset);
342 342
343 /* 343 /*
344 * Remember seq number in case this pkt gets resized 344 * Remember seq number in case this pkt gets resized
@@ -413,7 +413,7 @@ static inline int app_tcp_pkt_in(struct ip_vs_conn *cp, struct sk_buff **pskb,
413 if (!ip_vs_make_skb_writable(pskb, tcp_offset + sizeof(*th))) 413 if (!ip_vs_make_skb_writable(pskb, tcp_offset + sizeof(*th)))
414 return 0; 414 return 0;
415 415
416 th = (struct tcphdr *)((*pskb)->nh.raw + tcp_offset); 416 th = (struct tcphdr *)(skb_network_header(*pskb) + tcp_offset);
417 417
418 /* 418 /*
419 * Remember seq number in case this pkt gets resized 419 * Remember seq number in case this pkt gets resized
diff --git a/net/ipv4/ipvs/ip_vs_core.c b/net/ipv4/ipvs/ip_vs_core.c
index 858686d616a2..5d54dd2ce12f 100644
--- a/net/ipv4/ipvs/ip_vs_core.c
+++ b/net/ipv4/ipvs/ip_vs_core.c
@@ -559,7 +559,8 @@ void ip_vs_nat_icmp(struct sk_buff *skb, struct ip_vs_protocol *pp,
559{ 559{
560 struct iphdr *iph = skb->nh.iph; 560 struct iphdr *iph = skb->nh.iph;
561 unsigned int icmp_offset = iph->ihl*4; 561 unsigned int icmp_offset = iph->ihl*4;
562 struct icmphdr *icmph = (struct icmphdr *)(skb->nh.raw + icmp_offset); 562 struct icmphdr *icmph = (struct icmphdr *)(skb_network_header(skb) +
563 icmp_offset);
563 struct iphdr *ciph = (struct iphdr *)(icmph + 1); 564 struct iphdr *ciph = (struct iphdr *)(icmph + 1);
564 565
565 if (inout) { 566 if (inout) {