aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/ipvs
diff options
context:
space:
mode:
authorArnaldo Carvalho de Melo <acme@redhat.com>2007-04-21 01:47:35 -0400
committerDavid S. Miller <davem@sunset.davemloft.net>2007-04-26 01:25:10 -0400
commiteddc9ec53be2ecdbf4efe0efd4a83052594f0ac0 (patch)
tree4a38ab4dbd9d61fdf5a5ea6ed61463e0b9e33ba7 /net/ipv4/ipvs
parente023dd643798c4f06c16466af90b4d250e4b8bd7 (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')
-rw-r--r--net/ipv4/ipvs/ip_vs_app.c4
-rw-r--r--net/ipv4/ipvs/ip_vs_core.c38
-rw-r--r--net/ipv4/ipvs/ip_vs_dh.c2
-rw-r--r--net/ipv4/ipvs/ip_vs_ftp.c4
-rw-r--r--net/ipv4/ipvs/ip_vs_lblc.c2
-rw-r--r--net/ipv4/ipvs/ip_vs_lblcr.c2
-rw-r--r--net/ipv4/ipvs/ip_vs_proto_tcp.c12
-rw-r--r--net/ipv4/ipvs/ip_vs_proto_udp.c14
-rw-r--r--net/ipv4/ipvs/ip_vs_sh.c2
-rw-r--r--net/ipv4/ipvs/ip_vs_xmit.c24
10 files changed, 51 insertions, 53 deletions
diff --git a/net/ipv4/ipvs/ip_vs_app.c b/net/ipv4/ipvs/ip_vs_app.c
index e5beab28cd0f..c8a822c0aa75 100644
--- a/net/ipv4/ipvs/ip_vs_app.c
+++ b/net/ipv4/ipvs/ip_vs_app.c
@@ -577,7 +577,6 @@ static const struct file_operations ip_vs_app_fops = {
577int ip_vs_skb_replace(struct sk_buff *skb, gfp_t pri, 577int ip_vs_skb_replace(struct sk_buff *skb, gfp_t pri,
578 char *o_buf, int o_len, char *n_buf, int n_len) 578 char *o_buf, int o_len, char *n_buf, int n_len)
579{ 579{
580 struct iphdr *iph;
581 int diff; 580 int diff;
582 int o_offset; 581 int o_offset;
583 int o_left; 582 int o_left;
@@ -607,8 +606,7 @@ int ip_vs_skb_replace(struct sk_buff *skb, gfp_t pri,
607 } 606 }
608 607
609 /* must update the iph total length here */ 608 /* must update the iph total length here */
610 iph = skb->nh.iph; 609 ip_hdr(skb)->tot_len = htons(skb->len);
611 iph->tot_len = htons(skb->len);
612 610
613 LeaveFunction(9); 611 LeaveFunction(9);
614 return 0; 612 return 0;
diff --git a/net/ipv4/ipvs/ip_vs_core.c b/net/ipv4/ipvs/ip_vs_core.c
index 7893c00a91fe..62cfbed317bf 100644
--- a/net/ipv4/ipvs/ip_vs_core.c
+++ b/net/ipv4/ipvs/ip_vs_core.c
@@ -212,7 +212,7 @@ ip_vs_sched_persist(struct ip_vs_service *svc,
212 __be16 ports[2]) 212 __be16 ports[2])
213{ 213{
214 struct ip_vs_conn *cp = NULL; 214 struct ip_vs_conn *cp = NULL;
215 struct iphdr *iph = skb->nh.iph; 215 struct iphdr *iph = ip_hdr(skb);
216 struct ip_vs_dest *dest; 216 struct ip_vs_dest *dest;
217 struct ip_vs_conn *ct; 217 struct ip_vs_conn *ct;
218 __be16 dport; /* destination port to forward */ 218 __be16 dport; /* destination port to forward */
@@ -381,7 +381,7 @@ struct ip_vs_conn *
381ip_vs_schedule(struct ip_vs_service *svc, const struct sk_buff *skb) 381ip_vs_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
382{ 382{
383 struct ip_vs_conn *cp = NULL; 383 struct ip_vs_conn *cp = NULL;
384 struct iphdr *iph = skb->nh.iph; 384 struct iphdr *iph = ip_hdr(skb);
385 struct ip_vs_dest *dest; 385 struct ip_vs_dest *dest;
386 __be16 _ports[2], *pptr; 386 __be16 _ports[2], *pptr;
387 387
@@ -447,7 +447,7 @@ int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb,
447 struct ip_vs_protocol *pp) 447 struct ip_vs_protocol *pp)
448{ 448{
449 __be16 _ports[2], *pptr; 449 __be16 _ports[2], *pptr;
450 struct iphdr *iph = skb->nh.iph; 450 struct iphdr *iph = ip_hdr(skb);
451 451
452 pptr = skb_header_pointer(skb, iph->ihl*4, 452 pptr = skb_header_pointer(skb, iph->ihl*4,
453 sizeof(_ports), _ports); 453 sizeof(_ports), _ports);
@@ -546,7 +546,7 @@ ip_vs_gather_frags(struct sk_buff *skb, u_int32_t user)
546{ 546{
547 skb = ip_defrag(skb, user); 547 skb = ip_defrag(skb, user);
548 if (skb) 548 if (skb)
549 ip_send_check(skb->nh.iph); 549 ip_send_check(ip_hdr(skb));
550 return skb; 550 return skb;
551} 551}
552 552
@@ -557,7 +557,7 @@ ip_vs_gather_frags(struct sk_buff *skb, u_int32_t user)
557void ip_vs_nat_icmp(struct sk_buff *skb, struct ip_vs_protocol *pp, 557void ip_vs_nat_icmp(struct sk_buff *skb, struct ip_vs_protocol *pp,
558 struct ip_vs_conn *cp, int inout) 558 struct ip_vs_conn *cp, int inout)
559{ 559{
560 struct iphdr *iph = skb->nh.iph; 560 struct iphdr *iph = ip_hdr(skb);
561 unsigned int icmp_offset = iph->ihl*4; 561 unsigned int icmp_offset = iph->ihl*4;
562 struct icmphdr *icmph = (struct icmphdr *)(skb_network_header(skb) + 562 struct icmphdr *icmph = (struct icmphdr *)(skb_network_header(skb) +
563 icmp_offset); 563 icmp_offset);
@@ -618,14 +618,14 @@ static int ip_vs_out_icmp(struct sk_buff **pskb, int *related)
618 *related = 1; 618 *related = 1;
619 619
620 /* reassemble IP fragments */ 620 /* reassemble IP fragments */
621 if (skb->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) { 621 if (ip_hdr(skb)->frag_off & htons(IP_MF | IP_OFFSET)) {
622 skb = ip_vs_gather_frags(skb, IP_DEFRAG_VS_OUT); 622 skb = ip_vs_gather_frags(skb, IP_DEFRAG_VS_OUT);
623 if (!skb) 623 if (!skb)
624 return NF_STOLEN; 624 return NF_STOLEN;
625 *pskb = skb; 625 *pskb = skb;
626 } 626 }
627 627
628 iph = skb->nh.iph; 628 iph = ip_hdr(skb);
629 offset = ihl = iph->ihl * 4; 629 offset = ihl = iph->ihl * 4;
630 ic = skb_header_pointer(skb, offset, sizeof(_icmph), &_icmph); 630 ic = skb_header_pointer(skb, offset, sizeof(_icmph), &_icmph);
631 if (ic == NULL) 631 if (ic == NULL)
@@ -740,14 +740,14 @@ ip_vs_out(unsigned int hooknum, struct sk_buff **pskb,
740 if (skb->ipvs_property) 740 if (skb->ipvs_property)
741 return NF_ACCEPT; 741 return NF_ACCEPT;
742 742
743 iph = skb->nh.iph; 743 iph = ip_hdr(skb);
744 if (unlikely(iph->protocol == IPPROTO_ICMP)) { 744 if (unlikely(iph->protocol == IPPROTO_ICMP)) {
745 int related, verdict = ip_vs_out_icmp(pskb, &related); 745 int related, verdict = ip_vs_out_icmp(pskb, &related);
746 746
747 if (related) 747 if (related)
748 return verdict; 748 return verdict;
749 skb = *pskb; 749 skb = *pskb;
750 iph = skb->nh.iph; 750 iph = ip_hdr(skb);
751 } 751 }
752 752
753 pp = ip_vs_proto_get(iph->protocol); 753 pp = ip_vs_proto_get(iph->protocol);
@@ -760,7 +760,7 @@ ip_vs_out(unsigned int hooknum, struct sk_buff **pskb,
760 skb = ip_vs_gather_frags(skb, IP_DEFRAG_VS_OUT); 760 skb = ip_vs_gather_frags(skb, IP_DEFRAG_VS_OUT);
761 if (!skb) 761 if (!skb)
762 return NF_STOLEN; 762 return NF_STOLEN;
763 iph = skb->nh.iph; 763 iph = ip_hdr(skb);
764 *pskb = skb; 764 *pskb = skb;
765 } 765 }
766 766
@@ -810,8 +810,8 @@ ip_vs_out(unsigned int hooknum, struct sk_buff **pskb,
810 if (pp->snat_handler && !pp->snat_handler(pskb, pp, cp)) 810 if (pp->snat_handler && !pp->snat_handler(pskb, pp, cp))
811 goto drop; 811 goto drop;
812 skb = *pskb; 812 skb = *pskb;
813 skb->nh.iph->saddr = cp->vaddr; 813 ip_hdr(skb)->saddr = cp->vaddr;
814 ip_send_check(skb->nh.iph); 814 ip_send_check(ip_hdr(skb));
815 815
816 /* For policy routing, packets originating from this 816 /* For policy routing, packets originating from this
817 * machine itself may be routed differently to packets 817 * machine itself may be routed differently to packets
@@ -861,7 +861,7 @@ ip_vs_in_icmp(struct sk_buff **pskb, int *related, unsigned int hooknum)
861 *related = 1; 861 *related = 1;
862 862
863 /* reassemble IP fragments */ 863 /* reassemble IP fragments */
864 if (skb->nh.iph->frag_off & htons(IP_MF|IP_OFFSET)) { 864 if (ip_hdr(skb)->frag_off & htons(IP_MF | IP_OFFSET)) {
865 skb = ip_vs_gather_frags(skb, 865 skb = ip_vs_gather_frags(skb,
866 hooknum == NF_IP_LOCAL_IN ? 866 hooknum == NF_IP_LOCAL_IN ?
867 IP_DEFRAG_VS_IN : IP_DEFRAG_VS_FWD); 867 IP_DEFRAG_VS_IN : IP_DEFRAG_VS_FWD);
@@ -870,7 +870,7 @@ ip_vs_in_icmp(struct sk_buff **pskb, int *related, unsigned int hooknum)
870 *pskb = skb; 870 *pskb = skb;
871 } 871 }
872 872
873 iph = skb->nh.iph; 873 iph = ip_hdr(skb);
874 offset = ihl = iph->ihl * 4; 874 offset = ihl = iph->ihl * 4;
875 ic = skb_header_pointer(skb, offset, sizeof(_icmph), &_icmph); 875 ic = skb_header_pointer(skb, offset, sizeof(_icmph), &_icmph);
876 if (ic == NULL) 876 if (ic == NULL)
@@ -966,19 +966,19 @@ ip_vs_in(unsigned int hooknum, struct sk_buff **pskb,
966 || skb->dev == &loopback_dev || skb->sk)) { 966 || skb->dev == &loopback_dev || skb->sk)) {
967 IP_VS_DBG(12, "packet type=%d proto=%d daddr=%d.%d.%d.%d ignored\n", 967 IP_VS_DBG(12, "packet type=%d proto=%d daddr=%d.%d.%d.%d ignored\n",
968 skb->pkt_type, 968 skb->pkt_type,
969 skb->nh.iph->protocol, 969 ip_hdr(skb)->protocol,
970 NIPQUAD(skb->nh.iph->daddr)); 970 NIPQUAD(ip_hdr(skb)->daddr));
971 return NF_ACCEPT; 971 return NF_ACCEPT;
972 } 972 }
973 973
974 iph = skb->nh.iph; 974 iph = ip_hdr(skb);
975 if (unlikely(iph->protocol == IPPROTO_ICMP)) { 975 if (unlikely(iph->protocol == IPPROTO_ICMP)) {
976 int related, verdict = ip_vs_in_icmp(pskb, &related, hooknum); 976 int related, verdict = ip_vs_in_icmp(pskb, &related, hooknum);
977 977
978 if (related) 978 if (related)
979 return verdict; 979 return verdict;
980 skb = *pskb; 980 skb = *pskb;
981 iph = skb->nh.iph; 981 iph = ip_hdr(skb);
982 } 982 }
983 983
984 /* Protocol supported? */ 984 /* Protocol supported? */
@@ -1064,7 +1064,7 @@ ip_vs_forward_icmp(unsigned int hooknum, struct sk_buff **pskb,
1064{ 1064{
1065 int r; 1065 int r;
1066 1066
1067 if ((*pskb)->nh.iph->protocol != IPPROTO_ICMP) 1067 if (ip_hdr(*pskb)->protocol != IPPROTO_ICMP)
1068 return NF_ACCEPT; 1068 return NF_ACCEPT;
1069 1069
1070 return ip_vs_in_icmp(pskb, &r, hooknum); 1070 return ip_vs_in_icmp(pskb, &r, hooknum);
diff --git a/net/ipv4/ipvs/ip_vs_dh.c b/net/ipv4/ipvs/ip_vs_dh.c
index 502111fba872..dcf5d46aaa5e 100644
--- a/net/ipv4/ipvs/ip_vs_dh.c
+++ b/net/ipv4/ipvs/ip_vs_dh.c
@@ -204,7 +204,7 @@ ip_vs_dh_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
204{ 204{
205 struct ip_vs_dest *dest; 205 struct ip_vs_dest *dest;
206 struct ip_vs_dh_bucket *tbl; 206 struct ip_vs_dh_bucket *tbl;
207 struct iphdr *iph = skb->nh.iph; 207 struct iphdr *iph = ip_hdr(skb);
208 208
209 IP_VS_DBG(6, "ip_vs_dh_schedule(): Scheduling...\n"); 209 IP_VS_DBG(6, "ip_vs_dh_schedule(): Scheduling...\n");
210 210
diff --git a/net/ipv4/ipvs/ip_vs_ftp.c b/net/ipv4/ipvs/ip_vs_ftp.c
index 847c47af040c..25bd68967305 100644
--- a/net/ipv4/ipvs/ip_vs_ftp.c
+++ b/net/ipv4/ipvs/ip_vs_ftp.c
@@ -159,7 +159,7 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp,
159 return 0; 159 return 0;
160 160
161 if (cp->app_data == &ip_vs_ftp_pasv) { 161 if (cp->app_data == &ip_vs_ftp_pasv) {
162 iph = (*pskb)->nh.iph; 162 iph = ip_hdr(*pskb);
163 th = (struct tcphdr *)&(((char *)iph)[iph->ihl*4]); 163 th = (struct tcphdr *)&(((char *)iph)[iph->ihl*4]);
164 data = (char *)th + (th->doff << 2); 164 data = (char *)th + (th->doff << 2);
165 data_limit = (*pskb)->tail; 165 data_limit = (*pskb)->tail;
@@ -262,7 +262,7 @@ static int ip_vs_ftp_in(struct ip_vs_app *app, struct ip_vs_conn *cp,
262 /* 262 /*
263 * Detecting whether it is passive 263 * Detecting whether it is passive
264 */ 264 */
265 iph = (*pskb)->nh.iph; 265 iph = ip_hdr(*pskb);
266 th = (struct tcphdr *)&(((char *)iph)[iph->ihl*4]); 266 th = (struct tcphdr *)&(((char *)iph)[iph->ihl*4]);
267 267
268 /* Since there may be OPTIONS in the TCP packet and the HLEN is 268 /* Since there may be OPTIONS in the TCP packet and the HLEN is
diff --git a/net/ipv4/ipvs/ip_vs_lblc.c b/net/ipv4/ipvs/ip_vs_lblc.c
index c801273cb881..052f4ed59174 100644
--- a/net/ipv4/ipvs/ip_vs_lblc.c
+++ b/net/ipv4/ipvs/ip_vs_lblc.c
@@ -521,7 +521,7 @@ ip_vs_lblc_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
521 struct ip_vs_dest *dest; 521 struct ip_vs_dest *dest;
522 struct ip_vs_lblc_table *tbl; 522 struct ip_vs_lblc_table *tbl;
523 struct ip_vs_lblc_entry *en; 523 struct ip_vs_lblc_entry *en;
524 struct iphdr *iph = skb->nh.iph; 524 struct iphdr *iph = ip_hdr(skb);
525 525
526 IP_VS_DBG(6, "ip_vs_lblc_schedule(): Scheduling...\n"); 526 IP_VS_DBG(6, "ip_vs_lblc_schedule(): Scheduling...\n");
527 527
diff --git a/net/ipv4/ipvs/ip_vs_lblcr.c b/net/ipv4/ipvs/ip_vs_lblcr.c
index 23f9b9e73c85..6225acac7a3b 100644
--- a/net/ipv4/ipvs/ip_vs_lblcr.c
+++ b/net/ipv4/ipvs/ip_vs_lblcr.c
@@ -775,7 +775,7 @@ ip_vs_lblcr_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
775 struct ip_vs_dest *dest; 775 struct ip_vs_dest *dest;
776 struct ip_vs_lblcr_table *tbl; 776 struct ip_vs_lblcr_table *tbl;
777 struct ip_vs_lblcr_entry *en; 777 struct ip_vs_lblcr_entry *en;
778 struct iphdr *iph = skb->nh.iph; 778 struct iphdr *iph = ip_hdr(skb);
779 779
780 IP_VS_DBG(6, "ip_vs_lblcr_schedule(): Scheduling...\n"); 780 IP_VS_DBG(6, "ip_vs_lblcr_schedule(): Scheduling...\n");
781 781
diff --git a/net/ipv4/ipvs/ip_vs_proto_tcp.c b/net/ipv4/ipvs/ip_vs_proto_tcp.c
index e65382da713e..e65577a77006 100644
--- a/net/ipv4/ipvs/ip_vs_proto_tcp.c
+++ b/net/ipv4/ipvs/ip_vs_proto_tcp.c
@@ -83,8 +83,8 @@ tcp_conn_schedule(struct sk_buff *skb,
83 } 83 }
84 84
85 if (th->syn && 85 if (th->syn &&
86 (svc = ip_vs_service_get(skb->mark, skb->nh.iph->protocol, 86 (svc = ip_vs_service_get(skb->mark, ip_hdr(skb)->protocol,
87 skb->nh.iph->daddr, th->dest))) { 87 ip_hdr(skb)->daddr, th->dest))) {
88 if (ip_vs_todrop()) { 88 if (ip_vs_todrop()) {
89 /* 89 /*
90 * It seems that we are very loaded. 90 * It seems that we are very loaded.
@@ -142,7 +142,7 @@ tcp_snat_handler(struct sk_buff **pskb,
142 return 0; 142 return 0;
143 } 143 }
144 144
145 tcph = (void *)(*pskb)->nh.iph + tcphoff; 145 tcph = (void *)ip_hdr(*pskb) + tcphoff;
146 tcph->source = cp->vport; 146 tcph->source = cp->vport;
147 147
148 /* Adjust TCP checksums */ 148 /* Adjust TCP checksums */
@@ -193,7 +193,7 @@ tcp_dnat_handler(struct sk_buff **pskb,
193 return 0; 193 return 0;
194 } 194 }
195 195
196 tcph = (void *)(*pskb)->nh.iph + tcphoff; 196 tcph = (void *)ip_hdr(*pskb) + tcphoff;
197 tcph->dest = cp->dport; 197 tcph->dest = cp->dport;
198 198
199 /* 199 /*
@@ -229,9 +229,9 @@ tcp_csum_check(struct sk_buff *skb, struct ip_vs_protocol *pp)
229 case CHECKSUM_NONE: 229 case CHECKSUM_NONE:
230 skb->csum = skb_checksum(skb, tcphoff, skb->len - tcphoff, 0); 230 skb->csum = skb_checksum(skb, tcphoff, skb->len - tcphoff, 0);
231 case CHECKSUM_COMPLETE: 231 case CHECKSUM_COMPLETE:
232 if (csum_tcpudp_magic(skb->nh.iph->saddr, skb->nh.iph->daddr, 232 if (csum_tcpudp_magic(ip_hdr(skb)->saddr, ip_hdr(skb)->daddr,
233 skb->len - tcphoff, 233 skb->len - tcphoff,
234 skb->nh.iph->protocol, skb->csum)) { 234 ip_hdr(skb)->protocol, skb->csum)) {
235 IP_VS_DBG_RL_PKT(0, pp, skb, 0, 235 IP_VS_DBG_RL_PKT(0, pp, skb, 0,
236 "Failed checksum for"); 236 "Failed checksum for");
237 return 0; 237 return 0;
diff --git a/net/ipv4/ipvs/ip_vs_proto_udp.c b/net/ipv4/ipvs/ip_vs_proto_udp.c
index 2cd950638923..8ee5fe6a101d 100644
--- a/net/ipv4/ipvs/ip_vs_proto_udp.c
+++ b/net/ipv4/ipvs/ip_vs_proto_udp.c
@@ -89,8 +89,8 @@ udp_conn_schedule(struct sk_buff *skb, struct ip_vs_protocol *pp,
89 return 0; 89 return 0;
90 } 90 }
91 91
92 if ((svc = ip_vs_service_get(skb->mark, skb->nh.iph->protocol, 92 if ((svc = ip_vs_service_get(skb->mark, ip_hdr(skb)->protocol,
93 skb->nh.iph->daddr, uh->dest))) { 93 ip_hdr(skb)->daddr, uh->dest))) {
94 if (ip_vs_todrop()) { 94 if (ip_vs_todrop()) {
95 /* 95 /*
96 * It seems that we are very loaded. 96 * It seems that we are very loaded.
@@ -151,7 +151,7 @@ udp_snat_handler(struct sk_buff **pskb,
151 return 0; 151 return 0;
152 } 152 }
153 153
154 udph = (void *)(*pskb)->nh.iph + udphoff; 154 udph = (void *)ip_hdr(*pskb) + udphoff;
155 udph->source = cp->vport; 155 udph->source = cp->vport;
156 156
157 /* 157 /*
@@ -206,7 +206,7 @@ udp_dnat_handler(struct sk_buff **pskb,
206 return 0; 206 return 0;
207 } 207 }
208 208
209 udph = (void *)(*pskb)->nh.iph + udphoff; 209 udph = (void *)ip_hdr(*pskb) + udphoff;
210 udph->dest = cp->dport; 210 udph->dest = cp->dport;
211 211
212 /* 212 /*
@@ -251,10 +251,10 @@ udp_csum_check(struct sk_buff *skb, struct ip_vs_protocol *pp)
251 skb->csum = skb_checksum(skb, udphoff, 251 skb->csum = skb_checksum(skb, udphoff,
252 skb->len - udphoff, 0); 252 skb->len - udphoff, 0);
253 case CHECKSUM_COMPLETE: 253 case CHECKSUM_COMPLETE:
254 if (csum_tcpudp_magic(skb->nh.iph->saddr, 254 if (csum_tcpudp_magic(ip_hdr(skb)->saddr,
255 skb->nh.iph->daddr, 255 ip_hdr(skb)->daddr,
256 skb->len - udphoff, 256 skb->len - udphoff,
257 skb->nh.iph->protocol, 257 ip_hdr(skb)->protocol,
258 skb->csum)) { 258 skb->csum)) {
259 IP_VS_DBG_RL_PKT(0, pp, skb, 0, 259 IP_VS_DBG_RL_PKT(0, pp, skb, 0,
260 "Failed checksum for"); 260 "Failed checksum for");
diff --git a/net/ipv4/ipvs/ip_vs_sh.c b/net/ipv4/ipvs/ip_vs_sh.c
index 338668f88fe2..1b25b00ef1e1 100644
--- a/net/ipv4/ipvs/ip_vs_sh.c
+++ b/net/ipv4/ipvs/ip_vs_sh.c
@@ -201,7 +201,7 @@ ip_vs_sh_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
201{ 201{
202 struct ip_vs_dest *dest; 202 struct ip_vs_dest *dest;
203 struct ip_vs_sh_bucket *tbl; 203 struct ip_vs_sh_bucket *tbl;
204 struct iphdr *iph = skb->nh.iph; 204 struct iphdr *iph = ip_hdr(skb);
205 205
206 IP_VS_DBG(6, "ip_vs_sh_schedule(): Scheduling...\n"); 206 IP_VS_DBG(6, "ip_vs_sh_schedule(): Scheduling...\n");
207 207
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");