aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/net/ip_vs.h68
-rw-r--r--net/ipv4/ipvs/ip_vs_conn.c24
-rw-r--r--net/ipv4/ipvs/ip_vs_core.c14
-rw-r--r--net/ipv4/ipvs/ip_vs_ctl.c26
-rw-r--r--net/ipv4/ipvs/ip_vs_dh.c4
-rw-r--r--net/ipv4/ipvs/ip_vs_ftp.c12
-rw-r--r--net/ipv4/ipvs/ip_vs_lblc.c8
-rw-r--r--net/ipv4/ipvs/ip_vs_lblcr.c8
-rw-r--r--net/ipv4/ipvs/ip_vs_proto.c2
-rw-r--r--net/ipv4/ipvs/ip_vs_proto_tcp.c10
-rw-r--r--net/ipv4/ipvs/ip_vs_proto_udp.c14
-rw-r--r--net/ipv4/ipvs/ip_vs_sh.c4
-rw-r--r--net/ipv4/ipvs/ip_vs_sync.c16
-rw-r--r--net/ipv4/ipvs/ip_vs_xmit.c2
14 files changed, 106 insertions, 106 deletions
diff --git a/include/net/ip_vs.h b/include/net/ip_vs.h
index 3b57b159b653..49c717e3b040 100644
--- a/include/net/ip_vs.h
+++ b/include/net/ip_vs.h
@@ -100,22 +100,22 @@
100struct ip_vs_service_user { 100struct ip_vs_service_user {
101 /* virtual service addresses */ 101 /* virtual service addresses */
102 u_int16_t protocol; 102 u_int16_t protocol;
103 u_int32_t addr; /* virtual ip address */ 103 __be32 addr; /* virtual ip address */
104 u_int16_t port; 104 __be16 port;
105 u_int32_t fwmark; /* firwall mark of service */ 105 u_int32_t fwmark; /* firwall mark of service */
106 106
107 /* virtual service options */ 107 /* virtual service options */
108 char sched_name[IP_VS_SCHEDNAME_MAXLEN]; 108 char sched_name[IP_VS_SCHEDNAME_MAXLEN];
109 unsigned flags; /* virtual service flags */ 109 unsigned flags; /* virtual service flags */
110 unsigned timeout; /* persistent timeout in sec */ 110 unsigned timeout; /* persistent timeout in sec */
111 u_int32_t netmask; /* persistent netmask */ 111 __be32 netmask; /* persistent netmask */
112}; 112};
113 113
114 114
115struct ip_vs_dest_user { 115struct ip_vs_dest_user {
116 /* destination server address */ 116 /* destination server address */
117 u_int32_t addr; 117 __be32 addr;
118 u_int16_t port; 118 __be16 port;
119 119
120 /* real server options */ 120 /* real server options */
121 unsigned conn_flags; /* connection flags */ 121 unsigned conn_flags; /* connection flags */
@@ -163,15 +163,15 @@ struct ip_vs_getinfo {
163struct ip_vs_service_entry { 163struct ip_vs_service_entry {
164 /* which service: user fills in these */ 164 /* which service: user fills in these */
165 u_int16_t protocol; 165 u_int16_t protocol;
166 u_int32_t addr; /* virtual address */ 166 __be32 addr; /* virtual address */
167 u_int16_t port; 167 __be16 port;
168 u_int32_t fwmark; /* firwall mark of service */ 168 u_int32_t fwmark; /* firwall mark of service */
169 169
170 /* service options */ 170 /* service options */
171 char sched_name[IP_VS_SCHEDNAME_MAXLEN]; 171 char sched_name[IP_VS_SCHEDNAME_MAXLEN];
172 unsigned flags; /* virtual service flags */ 172 unsigned flags; /* virtual service flags */
173 unsigned timeout; /* persistent timeout */ 173 unsigned timeout; /* persistent timeout */
174 u_int32_t netmask; /* persistent netmask */ 174 __be32 netmask; /* persistent netmask */
175 175
176 /* number of real servers */ 176 /* number of real servers */
177 unsigned int num_dests; 177 unsigned int num_dests;
@@ -182,8 +182,8 @@ struct ip_vs_service_entry {
182 182
183 183
184struct ip_vs_dest_entry { 184struct ip_vs_dest_entry {
185 u_int32_t addr; /* destination address */ 185 __be32 addr; /* destination address */
186 u_int16_t port; 186 __be16 port;
187 unsigned conn_flags; /* connection flags */ 187 unsigned conn_flags; /* connection flags */
188 int weight; /* destination weight */ 188 int weight; /* destination weight */
189 189
@@ -203,8 +203,8 @@ struct ip_vs_dest_entry {
203struct ip_vs_get_dests { 203struct ip_vs_get_dests {
204 /* which service: user fills in these */ 204 /* which service: user fills in these */
205 u_int16_t protocol; 205 u_int16_t protocol;
206 u_int32_t addr; /* virtual address */ 206 __be32 addr; /* virtual address */
207 u_int16_t port; 207 __be16 port;
208 u_int32_t fwmark; /* firwall mark of service */ 208 u_int32_t fwmark; /* firwall mark of service */
209 209
210 /* number of real servers */ 210 /* number of real servers */
@@ -502,12 +502,12 @@ struct ip_vs_conn {
502 struct list_head c_list; /* hashed list heads */ 502 struct list_head c_list; /* hashed list heads */
503 503
504 /* Protocol, addresses and port numbers */ 504 /* Protocol, addresses and port numbers */
505 __u32 caddr; /* client address */ 505 __be32 caddr; /* client address */
506 __u32 vaddr; /* virtual address */ 506 __be32 vaddr; /* virtual address */
507 __u32 daddr; /* destination address */ 507 __be32 daddr; /* destination address */
508 __u16 cport; 508 __be16 cport;
509 __u16 vport; 509 __be16 vport;
510 __u16 dport; 510 __be16 dport;
511 __u16 protocol; /* Which protocol (TCP/UDP) */ 511 __u16 protocol; /* Which protocol (TCP/UDP) */
512 512
513 /* counter and timer */ 513 /* counter and timer */
@@ -554,12 +554,12 @@ struct ip_vs_service {
554 atomic_t usecnt; /* use counter */ 554 atomic_t usecnt; /* use counter */
555 555
556 __u16 protocol; /* which protocol (TCP/UDP) */ 556 __u16 protocol; /* which protocol (TCP/UDP) */
557 __u32 addr; /* IP address for virtual service */ 557 __be32 addr; /* IP address for virtual service */
558 __u16 port; /* port number for the service */ 558 __be16 port; /* port number for the service */
559 __u32 fwmark; /* firewall mark of the service */ 559 __u32 fwmark; /* firewall mark of the service */
560 unsigned flags; /* service status flags */ 560 unsigned flags; /* service status flags */
561 unsigned timeout; /* persistent timeout in ticks */ 561 unsigned timeout; /* persistent timeout in ticks */
562 __u32 netmask; /* grouping granularity */ 562 __be32 netmask; /* grouping granularity */
563 563
564 struct list_head destinations; /* real server d-linked list */ 564 struct list_head destinations; /* real server d-linked list */
565 __u32 num_dests; /* number of servers */ 565 __u32 num_dests; /* number of servers */
@@ -581,8 +581,8 @@ struct ip_vs_dest {
581 struct list_head n_list; /* for the dests in the service */ 581 struct list_head n_list; /* for the dests in the service */
582 struct list_head d_list; /* for table with all the dests */ 582 struct list_head d_list; /* for table with all the dests */
583 583
584 __u32 addr; /* IP address of the server */ 584 __be32 addr; /* IP address of the server */
585 __u16 port; /* port number of the server */ 585 __be16 port; /* port number of the server */
586 volatile unsigned flags; /* dest status flags */ 586 volatile unsigned flags; /* dest status flags */
587 atomic_t conn_flags; /* flags to copy to conn */ 587 atomic_t conn_flags; /* flags to copy to conn */
588 atomic_t weight; /* server weight */ 588 atomic_t weight; /* server weight */
@@ -605,8 +605,8 @@ struct ip_vs_dest {
605 /* for virtual service */ 605 /* for virtual service */
606 struct ip_vs_service *svc; /* service it belongs to */ 606 struct ip_vs_service *svc; /* service it belongs to */
607 __u16 protocol; /* which protocol (TCP/UDP) */ 607 __u16 protocol; /* which protocol (TCP/UDP) */
608 __u32 vaddr; /* virtual IP address */ 608 __be32 vaddr; /* virtual IP address */
609 __u16 vport; /* virtual port number */ 609 __be16 vport; /* virtual port number */
610 __u32 vfwmark; /* firewall mark of service */ 610 __u32 vfwmark; /* firewall mark of service */
611}; 611};
612 612
@@ -648,7 +648,7 @@ struct ip_vs_app
648 /* members for application incarnations */ 648 /* members for application incarnations */
649 struct list_head p_list; /* member in proto app list */ 649 struct list_head p_list; /* member in proto app list */
650 struct ip_vs_app *app; /* its real application */ 650 struct ip_vs_app *app; /* its real application */
651 __u16 port; /* port number in net order */ 651 __be16 port; /* port number in net order */
652 atomic_t usecnt; /* usage counter */ 652 atomic_t usecnt; /* usage counter */
653 653
654 /* output hook: return false if can't linearize. diff set for TCP. */ 654 /* output hook: return false if can't linearize. diff set for TCP. */
@@ -740,11 +740,11 @@ enum {
740}; 740};
741 741
742extern struct ip_vs_conn *ip_vs_conn_in_get 742extern struct ip_vs_conn *ip_vs_conn_in_get
743(int protocol, __u32 s_addr, __u16 s_port, __u32 d_addr, __u16 d_port); 743(int protocol, __be32 s_addr, __be16 s_port, __be32 d_addr, __be16 d_port);
744extern struct ip_vs_conn *ip_vs_ct_in_get 744extern struct ip_vs_conn *ip_vs_ct_in_get
745(int protocol, __u32 s_addr, __u16 s_port, __u32 d_addr, __u16 d_port); 745(int protocol, __be32 s_addr, __be16 s_port, __be32 d_addr, __be16 d_port);
746extern struct ip_vs_conn *ip_vs_conn_out_get 746extern struct ip_vs_conn *ip_vs_conn_out_get
747(int protocol, __u32 s_addr, __u16 s_port, __u32 d_addr, __u16 d_port); 747(int protocol, __be32 s_addr, __be16 s_port, __be32 d_addr, __be16 d_port);
748 748
749/* put back the conn without restarting its timer */ 749/* put back the conn without restarting its timer */
750static inline void __ip_vs_conn_put(struct ip_vs_conn *cp) 750static inline void __ip_vs_conn_put(struct ip_vs_conn *cp)
@@ -752,11 +752,11 @@ static inline void __ip_vs_conn_put(struct ip_vs_conn *cp)
752 atomic_dec(&cp->refcnt); 752 atomic_dec(&cp->refcnt);
753} 753}
754extern void ip_vs_conn_put(struct ip_vs_conn *cp); 754extern void ip_vs_conn_put(struct ip_vs_conn *cp);
755extern void ip_vs_conn_fill_cport(struct ip_vs_conn *cp, __u16 cport); 755extern void ip_vs_conn_fill_cport(struct ip_vs_conn *cp, __be16 cport);
756 756
757extern struct ip_vs_conn * 757extern struct ip_vs_conn *
758ip_vs_conn_new(int proto, __u32 caddr, __u16 cport, __u32 vaddr, __u16 vport, 758ip_vs_conn_new(int proto, __be32 caddr, __be16 cport, __be32 vaddr, __be16 vport,
759 __u32 daddr, __u16 dport, unsigned flags, 759 __be32 daddr, __be16 dport, unsigned flags,
760 struct ip_vs_dest *dest); 760 struct ip_vs_dest *dest);
761extern void ip_vs_conn_expire_now(struct ip_vs_conn *cp); 761extern void ip_vs_conn_expire_now(struct ip_vs_conn *cp);
762 762
@@ -887,7 +887,7 @@ extern int sysctl_ip_vs_nat_icmp_send;
887extern struct ip_vs_stats ip_vs_stats; 887extern struct ip_vs_stats ip_vs_stats;
888 888
889extern struct ip_vs_service * 889extern struct ip_vs_service *
890ip_vs_service_get(__u32 fwmark, __u16 protocol, __u32 vaddr, __u16 vport); 890ip_vs_service_get(__u32 fwmark, __u16 protocol, __be32 vaddr, __be16 vport);
891 891
892static inline void ip_vs_service_put(struct ip_vs_service *svc) 892static inline void ip_vs_service_put(struct ip_vs_service *svc)
893{ 893{
@@ -895,7 +895,7 @@ static inline void ip_vs_service_put(struct ip_vs_service *svc)
895} 895}
896 896
897extern struct ip_vs_dest * 897extern struct ip_vs_dest *
898ip_vs_lookup_real_service(__u16 protocol, __u32 daddr, __u16 dport); 898ip_vs_lookup_real_service(__u16 protocol, __be32 daddr, __be16 dport);
899extern int ip_vs_use_count_inc(void); 899extern int ip_vs_use_count_inc(void);
900extern void ip_vs_use_count_dec(void); 900extern void ip_vs_use_count_dec(void);
901extern int ip_vs_control_init(void); 901extern int ip_vs_control_init(void);
diff --git a/net/ipv4/ipvs/ip_vs_conn.c b/net/ipv4/ipvs/ip_vs_conn.c
index 87b83813cf2c..8832eb517d52 100644
--- a/net/ipv4/ipvs/ip_vs_conn.c
+++ b/net/ipv4/ipvs/ip_vs_conn.c
@@ -115,9 +115,9 @@ static inline void ct_write_unlock_bh(unsigned key)
115/* 115/*
116 * Returns hash value for IPVS connection entry 116 * Returns hash value for IPVS connection entry
117 */ 117 */
118static unsigned int ip_vs_conn_hashkey(unsigned proto, __u32 addr, __u16 port) 118static unsigned int ip_vs_conn_hashkey(unsigned proto, __be32 addr, __be16 port)
119{ 119{
120 return jhash_3words(addr, port, proto, ip_vs_conn_rnd) 120 return jhash_3words((__force u32)addr, (__force u32)port, proto, ip_vs_conn_rnd)
121 & IP_VS_CONN_TAB_MASK; 121 & IP_VS_CONN_TAB_MASK;
122} 122}
123 123
@@ -188,7 +188,7 @@ static inline int ip_vs_conn_unhash(struct ip_vs_conn *cp)
188 * d_addr, d_port: pkt dest address (load balancer) 188 * d_addr, d_port: pkt dest address (load balancer)
189 */ 189 */
190static inline struct ip_vs_conn *__ip_vs_conn_in_get 190static inline struct ip_vs_conn *__ip_vs_conn_in_get
191(int protocol, __u32 s_addr, __u16 s_port, __u32 d_addr, __u16 d_port) 191(int protocol, __be32 s_addr, __be16 s_port, __be32 d_addr, __be16 d_port)
192{ 192{
193 unsigned hash; 193 unsigned hash;
194 struct ip_vs_conn *cp; 194 struct ip_vs_conn *cp;
@@ -215,7 +215,7 @@ static inline struct ip_vs_conn *__ip_vs_conn_in_get
215} 215}
216 216
217struct ip_vs_conn *ip_vs_conn_in_get 217struct ip_vs_conn *ip_vs_conn_in_get
218(int protocol, __u32 s_addr, __u16 s_port, __u32 d_addr, __u16 d_port) 218(int protocol, __be32 s_addr, __be16 s_port, __be32 d_addr, __be16 d_port)
219{ 219{
220 struct ip_vs_conn *cp; 220 struct ip_vs_conn *cp;
221 221
@@ -234,7 +234,7 @@ struct ip_vs_conn *ip_vs_conn_in_get
234 234
235/* Get reference to connection template */ 235/* Get reference to connection template */
236struct ip_vs_conn *ip_vs_ct_in_get 236struct ip_vs_conn *ip_vs_ct_in_get
237(int protocol, __u32 s_addr, __u16 s_port, __u32 d_addr, __u16 d_port) 237(int protocol, __be32 s_addr, __be16 s_port, __be32 d_addr, __be16 d_port)
238{ 238{
239 unsigned hash; 239 unsigned hash;
240 struct ip_vs_conn *cp; 240 struct ip_vs_conn *cp;
@@ -274,7 +274,7 @@ struct ip_vs_conn *ip_vs_ct_in_get
274 * d_addr, d_port: pkt dest address (foreign host) 274 * d_addr, d_port: pkt dest address (foreign host)
275 */ 275 */
276struct ip_vs_conn *ip_vs_conn_out_get 276struct ip_vs_conn *ip_vs_conn_out_get
277(int protocol, __u32 s_addr, __u16 s_port, __u32 d_addr, __u16 d_port) 277(int protocol, __be32 s_addr, __be16 s_port, __be32 d_addr, __be16 d_port)
278{ 278{
279 unsigned hash; 279 unsigned hash;
280 struct ip_vs_conn *cp, *ret=NULL; 280 struct ip_vs_conn *cp, *ret=NULL;
@@ -324,7 +324,7 @@ void ip_vs_conn_put(struct ip_vs_conn *cp)
324/* 324/*
325 * Fill a no_client_port connection with a client port number 325 * Fill a no_client_port connection with a client port number
326 */ 326 */
327void ip_vs_conn_fill_cport(struct ip_vs_conn *cp, __u16 cport) 327void ip_vs_conn_fill_cport(struct ip_vs_conn *cp, __be16 cport)
328{ 328{
329 if (ip_vs_conn_unhash(cp)) { 329 if (ip_vs_conn_unhash(cp)) {
330 spin_lock(&cp->lock); 330 spin_lock(&cp->lock);
@@ -508,10 +508,10 @@ int ip_vs_check_template(struct ip_vs_conn *ct)
508 /* 508 /*
509 * Invalidate the connection template 509 * Invalidate the connection template
510 */ 510 */
511 if (ct->vport != 65535) { 511 if (ct->vport != htons(0xffff)) {
512 if (ip_vs_conn_unhash(ct)) { 512 if (ip_vs_conn_unhash(ct)) {
513 ct->dport = 65535; 513 ct->dport = htons(0xffff);
514 ct->vport = 65535; 514 ct->vport = htons(0xffff);
515 ct->cport = 0; 515 ct->cport = 0;
516 ip_vs_conn_hash(ct); 516 ip_vs_conn_hash(ct);
517 } 517 }
@@ -596,8 +596,8 @@ void ip_vs_conn_expire_now(struct ip_vs_conn *cp)
596 * Create a new connection entry and hash it into the ip_vs_conn_tab 596 * Create a new connection entry and hash it into the ip_vs_conn_tab
597 */ 597 */
598struct ip_vs_conn * 598struct ip_vs_conn *
599ip_vs_conn_new(int proto, __u32 caddr, __u16 cport, __u32 vaddr, __u16 vport, 599ip_vs_conn_new(int proto, __be32 caddr, __be16 cport, __be32 vaddr, __be16 vport,
600 __u32 daddr, __u16 dport, unsigned flags, 600 __be32 daddr, __be16 dport, unsigned flags,
601 struct ip_vs_dest *dest) 601 struct ip_vs_dest *dest)
602{ 602{
603 struct ip_vs_conn *cp; 603 struct ip_vs_conn *cp;
diff --git a/net/ipv4/ipvs/ip_vs_core.c b/net/ipv4/ipvs/ip_vs_core.c
index 3f47ad8e1cad..6dee03935f78 100644
--- a/net/ipv4/ipvs/ip_vs_core.c
+++ b/net/ipv4/ipvs/ip_vs_core.c
@@ -209,14 +209,14 @@ int ip_vs_make_skb_writable(struct sk_buff **pskb, int writable_len)
209static struct ip_vs_conn * 209static struct ip_vs_conn *
210ip_vs_sched_persist(struct ip_vs_service *svc, 210ip_vs_sched_persist(struct ip_vs_service *svc,
211 const struct sk_buff *skb, 211 const struct sk_buff *skb,
212 __u16 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 = skb->nh.iph;
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 __u16 dport; /* destination port to forward */ 218 __be16 dport; /* destination port to forward */
219 __u32 snet; /* source network of the client, after masking */ 219 __be32 snet; /* source network of the client, after masking */
220 220
221 /* Mask saddr with the netmask to adjust template granularity */ 221 /* Mask saddr with the netmask to adjust template granularity */
222 snet = iph->saddr & svc->netmask; 222 snet = iph->saddr & svc->netmask;
@@ -383,7 +383,7 @@ ip_vs_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
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 = skb->nh.iph;
385 struct ip_vs_dest *dest; 385 struct ip_vs_dest *dest;
386 __u16 _ports[2], *pptr; 386 __be16 _ports[2], *pptr;
387 387
388 pptr = skb_header_pointer(skb, iph->ihl*4, 388 pptr = skb_header_pointer(skb, iph->ihl*4,
389 sizeof(_ports), _ports); 389 sizeof(_ports), _ports);
@@ -446,7 +446,7 @@ ip_vs_schedule(struct ip_vs_service *svc, const struct sk_buff *skb)
446int ip_vs_leave(struct ip_vs_service *svc, struct sk_buff *skb, 446int 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 __u16 _ports[2], *pptr; 449 __be16 _ports[2], *pptr;
450 struct iphdr *iph = skb->nh.iph; 450 struct iphdr *iph = skb->nh.iph;
451 451
452 pptr = skb_header_pointer(skb, iph->ihl*4, 452 pptr = skb_header_pointer(skb, iph->ihl*4,
@@ -576,7 +576,7 @@ void ip_vs_nat_icmp(struct sk_buff *skb, struct ip_vs_protocol *pp,
576 576
577 /* the TCP/UDP port */ 577 /* the TCP/UDP port */
578 if (IPPROTO_TCP == ciph->protocol || IPPROTO_UDP == ciph->protocol) { 578 if (IPPROTO_TCP == ciph->protocol || IPPROTO_UDP == ciph->protocol) {
579 __u16 *ports = (void *)ciph + ciph->ihl*4; 579 __be16 *ports = (void *)ciph + ciph->ihl*4;
580 580
581 if (inout) 581 if (inout)
582 ports[1] = cp->vport; 582 ports[1] = cp->vport;
@@ -775,7 +775,7 @@ ip_vs_out(unsigned int hooknum, struct sk_buff **pskb,
775 if (sysctl_ip_vs_nat_icmp_send && 775 if (sysctl_ip_vs_nat_icmp_send &&
776 (pp->protocol == IPPROTO_TCP || 776 (pp->protocol == IPPROTO_TCP ||
777 pp->protocol == IPPROTO_UDP)) { 777 pp->protocol == IPPROTO_UDP)) {
778 __u16 _ports[2], *pptr; 778 __be16 _ports[2], *pptr;
779 779
780 pptr = skb_header_pointer(skb, ihl, 780 pptr = skb_header_pointer(skb, ihl,
781 sizeof(_ports), _ports); 781 sizeof(_ports), _ports);
diff --git a/net/ipv4/ipvs/ip_vs_ctl.c b/net/ipv4/ipvs/ip_vs_ctl.c
index 6a28fafe910c..f261616e4602 100644
--- a/net/ipv4/ipvs/ip_vs_ctl.c
+++ b/net/ipv4/ipvs/ip_vs_ctl.c
@@ -283,7 +283,7 @@ static atomic_t ip_vs_nullsvc_counter = ATOMIC_INIT(0);
283 * Returns hash value for virtual service 283 * Returns hash value for virtual service
284 */ 284 */
285static __inline__ unsigned 285static __inline__ unsigned
286ip_vs_svc_hashkey(unsigned proto, __u32 addr, __u16 port) 286ip_vs_svc_hashkey(unsigned proto, __be32 addr, __be16 port)
287{ 287{
288 register unsigned porth = ntohs(port); 288 register unsigned porth = ntohs(port);
289 289
@@ -365,7 +365,7 @@ static int ip_vs_svc_unhash(struct ip_vs_service *svc)
365 * Get service by {proto,addr,port} in the service table. 365 * Get service by {proto,addr,port} in the service table.
366 */ 366 */
367static __inline__ struct ip_vs_service * 367static __inline__ struct ip_vs_service *
368__ip_vs_service_get(__u16 protocol, __u32 vaddr, __u16 vport) 368__ip_vs_service_get(__u16 protocol, __be32 vaddr, __be16 vport)
369{ 369{
370 unsigned hash; 370 unsigned hash;
371 struct ip_vs_service *svc; 371 struct ip_vs_service *svc;
@@ -410,7 +410,7 @@ static __inline__ struct ip_vs_service *__ip_vs_svc_fwm_get(__u32 fwmark)
410} 410}
411 411
412struct ip_vs_service * 412struct ip_vs_service *
413ip_vs_service_get(__u32 fwmark, __u16 protocol, __u32 vaddr, __u16 vport) 413ip_vs_service_get(__u32 fwmark, __u16 protocol, __be32 vaddr, __be16 vport)
414{ 414{
415 struct ip_vs_service *svc; 415 struct ip_vs_service *svc;
416 416
@@ -480,7 +480,7 @@ __ip_vs_unbind_svc(struct ip_vs_dest *dest)
480/* 480/*
481 * Returns hash value for real service 481 * Returns hash value for real service
482 */ 482 */
483static __inline__ unsigned ip_vs_rs_hashkey(__u32 addr, __u16 port) 483static __inline__ unsigned ip_vs_rs_hashkey(__be32 addr, __be16 port)
484{ 484{
485 register unsigned porth = ntohs(port); 485 register unsigned porth = ntohs(port);
486 486
@@ -531,7 +531,7 @@ static int ip_vs_rs_unhash(struct ip_vs_dest *dest)
531 * Lookup real service by <proto,addr,port> in the real service table. 531 * Lookup real service by <proto,addr,port> in the real service table.
532 */ 532 */
533struct ip_vs_dest * 533struct ip_vs_dest *
534ip_vs_lookup_real_service(__u16 protocol, __u32 daddr, __u16 dport) 534ip_vs_lookup_real_service(__u16 protocol, __be32 daddr, __be16 dport)
535{ 535{
536 unsigned hash; 536 unsigned hash;
537 struct ip_vs_dest *dest; 537 struct ip_vs_dest *dest;
@@ -562,7 +562,7 @@ ip_vs_lookup_real_service(__u16 protocol, __u32 daddr, __u16 dport)
562 * Lookup destination by {addr,port} in the given service 562 * Lookup destination by {addr,port} in the given service
563 */ 563 */
564static struct ip_vs_dest * 564static struct ip_vs_dest *
565ip_vs_lookup_dest(struct ip_vs_service *svc, __u32 daddr, __u16 dport) 565ip_vs_lookup_dest(struct ip_vs_service *svc, __be32 daddr, __be16 dport)
566{ 566{
567 struct ip_vs_dest *dest; 567 struct ip_vs_dest *dest;
568 568
@@ -591,7 +591,7 @@ ip_vs_lookup_dest(struct ip_vs_service *svc, __u32 daddr, __u16 dport)
591 * scheduling. 591 * scheduling.
592 */ 592 */
593static struct ip_vs_dest * 593static struct ip_vs_dest *
594ip_vs_trash_get_dest(struct ip_vs_service *svc, __u32 daddr, __u16 dport) 594ip_vs_trash_get_dest(struct ip_vs_service *svc, __be32 daddr, __be16 dport)
595{ 595{
596 struct ip_vs_dest *dest, *nxt; 596 struct ip_vs_dest *dest, *nxt;
597 597
@@ -773,8 +773,8 @@ static int
773ip_vs_add_dest(struct ip_vs_service *svc, struct ip_vs_dest_user *udest) 773ip_vs_add_dest(struct ip_vs_service *svc, struct ip_vs_dest_user *udest)
774{ 774{
775 struct ip_vs_dest *dest; 775 struct ip_vs_dest *dest;
776 __u32 daddr = udest->addr; 776 __be32 daddr = udest->addr;
777 __u16 dport = udest->port; 777 __be16 dport = udest->port;
778 int ret; 778 int ret;
779 779
780 EnterFunction(2); 780 EnterFunction(2);
@@ -879,8 +879,8 @@ static int
879ip_vs_edit_dest(struct ip_vs_service *svc, struct ip_vs_dest_user *udest) 879ip_vs_edit_dest(struct ip_vs_service *svc, struct ip_vs_dest_user *udest)
880{ 880{
881 struct ip_vs_dest *dest; 881 struct ip_vs_dest *dest;
882 __u32 daddr = udest->addr; 882 __be32 daddr = udest->addr;
883 __u16 dport = udest->port; 883 __be16 dport = udest->port;
884 884
885 EnterFunction(2); 885 EnterFunction(2);
886 886
@@ -991,8 +991,8 @@ static int
991ip_vs_del_dest(struct ip_vs_service *svc,struct ip_vs_dest_user *udest) 991ip_vs_del_dest(struct ip_vs_service *svc,struct ip_vs_dest_user *udest)
992{ 992{
993 struct ip_vs_dest *dest; 993 struct ip_vs_dest *dest;
994 __u32 daddr = udest->addr; 994 __be32 daddr = udest->addr;
995 __u16 dport = udest->port; 995 __be16 dport = udest->port;
996 996
997 EnterFunction(2); 997 EnterFunction(2);
998 998
diff --git a/net/ipv4/ipvs/ip_vs_dh.c b/net/ipv4/ipvs/ip_vs_dh.c
index 9fee19c4c617..502111fba872 100644
--- a/net/ipv4/ipvs/ip_vs_dh.c
+++ b/net/ipv4/ipvs/ip_vs_dh.c
@@ -66,7 +66,7 @@ struct ip_vs_dh_bucket {
66/* 66/*
67 * Returns hash value for IPVS DH entry 67 * Returns hash value for IPVS DH entry
68 */ 68 */
69static inline unsigned ip_vs_dh_hashkey(__u32 addr) 69static inline unsigned ip_vs_dh_hashkey(__be32 addr)
70{ 70{
71 return (ntohl(addr)*2654435761UL) & IP_VS_DH_TAB_MASK; 71 return (ntohl(addr)*2654435761UL) & IP_VS_DH_TAB_MASK;
72} 72}
@@ -76,7 +76,7 @@ static inline unsigned ip_vs_dh_hashkey(__u32 addr)
76 * Get ip_vs_dest associated with supplied parameters. 76 * Get ip_vs_dest associated with supplied parameters.
77 */ 77 */
78static inline struct ip_vs_dest * 78static inline struct ip_vs_dest *
79ip_vs_dh_get(struct ip_vs_dh_bucket *tbl, __u32 addr) 79ip_vs_dh_get(struct ip_vs_dh_bucket *tbl, __be32 addr)
80{ 80{
81 return (tbl[ip_vs_dh_hashkey(addr)]).dest; 81 return (tbl[ip_vs_dh_hashkey(addr)]).dest;
82} 82}
diff --git a/net/ipv4/ipvs/ip_vs_ftp.c b/net/ipv4/ipvs/ip_vs_ftp.c
index 62505d8f9ff6..b3bbb4a07ae0 100644
--- a/net/ipv4/ipvs/ip_vs_ftp.c
+++ b/net/ipv4/ipvs/ip_vs_ftp.c
@@ -74,7 +74,7 @@ ip_vs_ftp_done_conn(struct ip_vs_app *app, struct ip_vs_conn *cp)
74 */ 74 */
75static int ip_vs_ftp_get_addrport(char *data, char *data_limit, 75static int ip_vs_ftp_get_addrport(char *data, char *data_limit,
76 const char *pattern, size_t plen, char term, 76 const char *pattern, size_t plen, char term,
77 __u32 *addr, __u16 *port, 77 __be32 *addr, __be16 *port,
78 char **start, char **end) 78 char **start, char **end)
79{ 79{
80 unsigned char p[6]; 80 unsigned char p[6];
@@ -140,8 +140,8 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp,
140 struct tcphdr *th; 140 struct tcphdr *th;
141 char *data, *data_limit; 141 char *data, *data_limit;
142 char *start, *end; 142 char *start, *end;
143 __u32 from; 143 __be32 from;
144 __u16 port; 144 __be16 port;
145 struct ip_vs_conn *n_cp; 145 struct ip_vs_conn *n_cp;
146 char buf[24]; /* xxx.xxx.xxx.xxx,ppp,ppp\000 */ 146 char buf[24]; /* xxx.xxx.xxx.xxx,ppp,ppp\000 */
147 unsigned buf_len; 147 unsigned buf_len;
@@ -199,7 +199,7 @@ static int ip_vs_ftp_out(struct ip_vs_app *app, struct ip_vs_conn *cp,
199 from = n_cp->vaddr; 199 from = n_cp->vaddr;
200 port = n_cp->vport; 200 port = n_cp->vport;
201 sprintf(buf,"%d,%d,%d,%d,%d,%d", NIPQUAD(from), 201 sprintf(buf,"%d,%d,%d,%d,%d,%d", NIPQUAD(from),
202 port&255, (port>>8)&255); 202 ntohs(port)&255, (ntohs(port)>>8)&255);
203 buf_len = strlen(buf); 203 buf_len = strlen(buf);
204 204
205 /* 205 /*
@@ -243,8 +243,8 @@ static int ip_vs_ftp_in(struct ip_vs_app *app, struct ip_vs_conn *cp,
243 struct tcphdr *th; 243 struct tcphdr *th;
244 char *data, *data_start, *data_limit; 244 char *data, *data_start, *data_limit;
245 char *start, *end; 245 char *start, *end;
246 __u32 to; 246 __be32 to;
247 __u16 port; 247 __be16 port;
248 struct ip_vs_conn *n_cp; 248 struct ip_vs_conn *n_cp;
249 249
250 /* no diff required for incoming packets */ 250 /* no diff required for incoming packets */
diff --git a/net/ipv4/ipvs/ip_vs_lblc.c b/net/ipv4/ipvs/ip_vs_lblc.c
index 6e5cb92a5c83..524751e031de 100644
--- a/net/ipv4/ipvs/ip_vs_lblc.c
+++ b/net/ipv4/ipvs/ip_vs_lblc.c
@@ -87,7 +87,7 @@ static int sysctl_ip_vs_lblc_expiration = 24*60*60*HZ;
87 */ 87 */
88struct ip_vs_lblc_entry { 88struct ip_vs_lblc_entry {
89 struct list_head list; 89 struct list_head list;
90 __u32 addr; /* destination IP address */ 90 __be32 addr; /* destination IP address */
91 struct ip_vs_dest *dest; /* real server (cache) */ 91 struct ip_vs_dest *dest; /* real server (cache) */
92 unsigned long lastuse; /* last used time */ 92 unsigned long lastuse; /* last used time */
93}; 93};
@@ -160,7 +160,7 @@ static struct ctl_table_header * sysctl_header;
160 * IP address to a server. 160 * IP address to a server.
161 */ 161 */
162static inline struct ip_vs_lblc_entry * 162static inline struct ip_vs_lblc_entry *
163ip_vs_lblc_new(__u32 daddr, struct ip_vs_dest *dest) 163ip_vs_lblc_new(__be32 daddr, struct ip_vs_dest *dest)
164{ 164{
165 struct ip_vs_lblc_entry *en; 165 struct ip_vs_lblc_entry *en;
166 166
@@ -195,7 +195,7 @@ static inline void ip_vs_lblc_free(struct ip_vs_lblc_entry *en)
195/* 195/*
196 * Returns hash value for IPVS LBLC entry 196 * Returns hash value for IPVS LBLC entry
197 */ 197 */
198static inline unsigned ip_vs_lblc_hashkey(__u32 addr) 198static inline unsigned ip_vs_lblc_hashkey(__be32 addr)
199{ 199{
200 return (ntohl(addr)*2654435761UL) & IP_VS_LBLC_TAB_MASK; 200 return (ntohl(addr)*2654435761UL) & IP_VS_LBLC_TAB_MASK;
201} 201}
@@ -234,7 +234,7 @@ ip_vs_lblc_hash(struct ip_vs_lblc_table *tbl, struct ip_vs_lblc_entry *en)
234 * Get ip_vs_lblc_entry associated with supplied parameters. 234 * Get ip_vs_lblc_entry associated with supplied parameters.
235 */ 235 */
236static inline struct ip_vs_lblc_entry * 236static inline struct ip_vs_lblc_entry *
237ip_vs_lblc_get(struct ip_vs_lblc_table *tbl, __u32 addr) 237ip_vs_lblc_get(struct ip_vs_lblc_table *tbl, __be32 addr)
238{ 238{
239 unsigned hash; 239 unsigned hash;
240 struct ip_vs_lblc_entry *en; 240 struct ip_vs_lblc_entry *en;
diff --git a/net/ipv4/ipvs/ip_vs_lblcr.c b/net/ipv4/ipvs/ip_vs_lblcr.c
index 32ba37ba72d8..08990192b6ec 100644
--- a/net/ipv4/ipvs/ip_vs_lblcr.c
+++ b/net/ipv4/ipvs/ip_vs_lblcr.c
@@ -276,7 +276,7 @@ static inline struct ip_vs_dest *ip_vs_dest_set_max(struct ip_vs_dest_set *set)
276 */ 276 */
277struct ip_vs_lblcr_entry { 277struct ip_vs_lblcr_entry {
278 struct list_head list; 278 struct list_head list;
279 __u32 addr; /* destination IP address */ 279 __be32 addr; /* destination IP address */
280 struct ip_vs_dest_set set; /* destination server set */ 280 struct ip_vs_dest_set set; /* destination server set */
281 unsigned long lastuse; /* last used time */ 281 unsigned long lastuse; /* last used time */
282}; 282};
@@ -348,7 +348,7 @@ static struct ctl_table_header * sysctl_header;
348 * new/free a ip_vs_lblcr_entry, which is a mapping of a destination 348 * new/free a ip_vs_lblcr_entry, which is a mapping of a destination
349 * IP address to a server. 349 * IP address to a server.
350 */ 350 */
351static inline struct ip_vs_lblcr_entry *ip_vs_lblcr_new(__u32 daddr) 351static inline struct ip_vs_lblcr_entry *ip_vs_lblcr_new(__be32 daddr)
352{ 352{
353 struct ip_vs_lblcr_entry *en; 353 struct ip_vs_lblcr_entry *en;
354 354
@@ -381,7 +381,7 @@ static inline void ip_vs_lblcr_free(struct ip_vs_lblcr_entry *en)
381/* 381/*
382 * Returns hash value for IPVS LBLCR entry 382 * Returns hash value for IPVS LBLCR entry
383 */ 383 */
384static inline unsigned ip_vs_lblcr_hashkey(__u32 addr) 384static inline unsigned ip_vs_lblcr_hashkey(__be32 addr)
385{ 385{
386 return (ntohl(addr)*2654435761UL) & IP_VS_LBLCR_TAB_MASK; 386 return (ntohl(addr)*2654435761UL) & IP_VS_LBLCR_TAB_MASK;
387} 387}
@@ -420,7 +420,7 @@ ip_vs_lblcr_hash(struct ip_vs_lblcr_table *tbl, struct ip_vs_lblcr_entry *en)
420 * Get ip_vs_lblcr_entry associated with supplied parameters. 420 * Get ip_vs_lblcr_entry associated with supplied parameters.
421 */ 421 */
422static inline struct ip_vs_lblcr_entry * 422static inline struct ip_vs_lblcr_entry *
423ip_vs_lblcr_get(struct ip_vs_lblcr_table *tbl, __u32 addr) 423ip_vs_lblcr_get(struct ip_vs_lblcr_table *tbl, __be32 addr)
424{ 424{
425 unsigned hash; 425 unsigned hash;
426 struct ip_vs_lblcr_entry *en; 426 struct ip_vs_lblcr_entry *en;
diff --git a/net/ipv4/ipvs/ip_vs_proto.c b/net/ipv4/ipvs/ip_vs_proto.c
index 867d4e9c6594..c4528b5c800d 100644
--- a/net/ipv4/ipvs/ip_vs_proto.c
+++ b/net/ipv4/ipvs/ip_vs_proto.c
@@ -176,7 +176,7 @@ ip_vs_tcpudp_debug_packet(struct ip_vs_protocol *pp,
176 pp->name, NIPQUAD(ih->saddr), 176 pp->name, NIPQUAD(ih->saddr),
177 NIPQUAD(ih->daddr)); 177 NIPQUAD(ih->daddr));
178 else { 178 else {
179 __u16 _ports[2], *pptr 179 __be16 _ports[2], *pptr
180; 180;
181 pptr = skb_header_pointer(skb, offset + ih->ihl*4, 181 pptr = skb_header_pointer(skb, offset + ih->ihl*4,
182 sizeof(_ports), _ports); 182 sizeof(_ports), _ports);
diff --git a/net/ipv4/ipvs/ip_vs_proto_tcp.c b/net/ipv4/ipvs/ip_vs_proto_tcp.c
index 820e8318d10d..bfe779e74590 100644
--- a/net/ipv4/ipvs/ip_vs_proto_tcp.c
+++ b/net/ipv4/ipvs/ip_vs_proto_tcp.c
@@ -29,7 +29,7 @@ static struct ip_vs_conn *
29tcp_conn_in_get(const struct sk_buff *skb, struct ip_vs_protocol *pp, 29tcp_conn_in_get(const struct sk_buff *skb, struct ip_vs_protocol *pp,
30 const struct iphdr *iph, unsigned int proto_off, int inverse) 30 const struct iphdr *iph, unsigned int proto_off, int inverse)
31{ 31{
32 __u16 _ports[2], *pptr; 32 __be16 _ports[2], *pptr;
33 33
34 pptr = skb_header_pointer(skb, proto_off, sizeof(_ports), _ports); 34 pptr = skb_header_pointer(skb, proto_off, sizeof(_ports), _ports);
35 if (pptr == NULL) 35 if (pptr == NULL)
@@ -50,7 +50,7 @@ static struct ip_vs_conn *
50tcp_conn_out_get(const struct sk_buff *skb, struct ip_vs_protocol *pp, 50tcp_conn_out_get(const struct sk_buff *skb, struct ip_vs_protocol *pp,
51 const struct iphdr *iph, unsigned int proto_off, int inverse) 51 const struct iphdr *iph, unsigned int proto_off, int inverse)
52{ 52{
53 __u16 _ports[2], *pptr; 53 __be16 _ports[2], *pptr;
54 54
55 pptr = skb_header_pointer(skb, proto_off, sizeof(_ports), _ports); 55 pptr = skb_header_pointer(skb, proto_off, sizeof(_ports), _ports);
56 if (pptr == NULL) 56 if (pptr == NULL)
@@ -112,12 +112,12 @@ tcp_conn_schedule(struct sk_buff *skb,
112 112
113 113
114static inline void 114static inline void
115tcp_fast_csum_update(struct tcphdr *tcph, u32 oldip, u32 newip, 115tcp_fast_csum_update(struct tcphdr *tcph, __be32 oldip, __be32 newip,
116 u16 oldport, u16 newport) 116 __be16 oldport, __be16 newport)
117{ 117{
118 tcph->check = 118 tcph->check =
119 ip_vs_check_diff(~oldip, newip, 119 ip_vs_check_diff(~oldip, newip,
120 ip_vs_check_diff(oldport ^ 0xFFFF, 120 ip_vs_check_diff(oldport ^ htonl(0xFFFF),
121 newport, tcph->check)); 121 newport, tcph->check));
122} 122}
123 123
diff --git a/net/ipv4/ipvs/ip_vs_proto_udp.c b/net/ipv4/ipvs/ip_vs_proto_udp.c
index 90c8166c0ec1..54aa7603591f 100644
--- a/net/ipv4/ipvs/ip_vs_proto_udp.c
+++ b/net/ipv4/ipvs/ip_vs_proto_udp.c
@@ -29,7 +29,7 @@ udp_conn_in_get(const struct sk_buff *skb, struct ip_vs_protocol *pp,
29 const struct iphdr *iph, unsigned int proto_off, int inverse) 29 const struct iphdr *iph, unsigned int proto_off, int inverse)
30{ 30{
31 struct ip_vs_conn *cp; 31 struct ip_vs_conn *cp;
32 __u16 _ports[2], *pptr; 32 __be16 _ports[2], *pptr;
33 33
34 pptr = skb_header_pointer(skb, proto_off, sizeof(_ports), _ports); 34 pptr = skb_header_pointer(skb, proto_off, sizeof(_ports), _ports);
35 if (pptr == NULL) 35 if (pptr == NULL)
@@ -54,7 +54,7 @@ udp_conn_out_get(const struct sk_buff *skb, struct ip_vs_protocol *pp,
54 const struct iphdr *iph, unsigned int proto_off, int inverse) 54 const struct iphdr *iph, unsigned int proto_off, int inverse)
55{ 55{
56 struct ip_vs_conn *cp; 56 struct ip_vs_conn *cp;
57 __u16 _ports[2], *pptr; 57 __be16 _ports[2], *pptr;
58 58
59 pptr = skb_header_pointer(skb, skb->nh.iph->ihl*4, 59 pptr = skb_header_pointer(skb, skb->nh.iph->ihl*4,
60 sizeof(_ports), _ports); 60 sizeof(_ports), _ports);
@@ -117,15 +117,15 @@ udp_conn_schedule(struct sk_buff *skb, struct ip_vs_protocol *pp,
117 117
118 118
119static inline void 119static inline void
120udp_fast_csum_update(struct udphdr *uhdr, u32 oldip, u32 newip, 120udp_fast_csum_update(struct udphdr *uhdr, __be32 oldip, __be32 newip,
121 u16 oldport, u16 newport) 121 __be16 oldport, __be16 newport)
122{ 122{
123 uhdr->check = 123 uhdr->check =
124 ip_vs_check_diff(~oldip, newip, 124 ip_vs_check_diff(~oldip, newip,
125 ip_vs_check_diff(oldport ^ 0xFFFF, 125 ip_vs_check_diff(oldport ^ htonl(0xFFFF),
126 newport, uhdr->check)); 126 newport, uhdr->check));
127 if (!uhdr->check) 127 if (!uhdr->check)
128 uhdr->check = 0xFFFF; 128 uhdr->check = htonl(0xFFFF);
129} 129}
130 130
131static int 131static int
@@ -173,7 +173,7 @@ udp_snat_handler(struct sk_buff **pskb,
173 cp->protocol, 173 cp->protocol,
174 (*pskb)->csum); 174 (*pskb)->csum);
175 if (udph->check == 0) 175 if (udph->check == 0)
176 udph->check = 0xFFFF; 176 udph->check = htonl(0xFFFF);
177 IP_VS_DBG(11, "O-pkt: %s O-csum=%d (+%zd)\n", 177 IP_VS_DBG(11, "O-pkt: %s O-csum=%d (+%zd)\n",
178 pp->name, udph->check, 178 pp->name, udph->check,
179 (char*)&(udph->check) - (char*)udph); 179 (char*)&(udph->check) - (char*)udph);
diff --git a/net/ipv4/ipvs/ip_vs_sh.c b/net/ipv4/ipvs/ip_vs_sh.c
index 7775e6cc68be..338668f88fe2 100644
--- a/net/ipv4/ipvs/ip_vs_sh.c
+++ b/net/ipv4/ipvs/ip_vs_sh.c
@@ -63,7 +63,7 @@ struct ip_vs_sh_bucket {
63/* 63/*
64 * Returns hash value for IPVS SH entry 64 * Returns hash value for IPVS SH entry
65 */ 65 */
66static inline unsigned ip_vs_sh_hashkey(__u32 addr) 66static inline unsigned ip_vs_sh_hashkey(__be32 addr)
67{ 67{
68 return (ntohl(addr)*2654435761UL) & IP_VS_SH_TAB_MASK; 68 return (ntohl(addr)*2654435761UL) & IP_VS_SH_TAB_MASK;
69} 69}
@@ -73,7 +73,7 @@ static inline unsigned ip_vs_sh_hashkey(__u32 addr)
73 * Get ip_vs_dest associated with supplied parameters. 73 * Get ip_vs_dest associated with supplied parameters.
74 */ 74 */
75static inline struct ip_vs_dest * 75static inline struct ip_vs_dest *
76ip_vs_sh_get(struct ip_vs_sh_bucket *tbl, __u32 addr) 76ip_vs_sh_get(struct ip_vs_sh_bucket *tbl, __be32 addr)
77{ 77{
78 return (tbl[ip_vs_sh_hashkey(addr)]).dest; 78 return (tbl[ip_vs_sh_hashkey(addr)]).dest;
79} 79}
diff --git a/net/ipv4/ipvs/ip_vs_sync.c b/net/ipv4/ipvs/ip_vs_sync.c
index 0c8d20da6139..6ab57d72b615 100644
--- a/net/ipv4/ipvs/ip_vs_sync.c
+++ b/net/ipv4/ipvs/ip_vs_sync.c
@@ -48,16 +48,16 @@ struct ip_vs_sync_conn {
48 48
49 /* Protocol, addresses and port numbers */ 49 /* Protocol, addresses and port numbers */
50 __u8 protocol; /* Which protocol (TCP/UDP) */ 50 __u8 protocol; /* Which protocol (TCP/UDP) */
51 __u16 cport; 51 __be16 cport;
52 __u16 vport; 52 __be16 vport;
53 __u16 dport; 53 __be16 dport;
54 __u32 caddr; /* client address */ 54 __be32 caddr; /* client address */
55 __u32 vaddr; /* virtual address */ 55 __be32 vaddr; /* virtual address */
56 __u32 daddr; /* destination address */ 56 __be32 daddr; /* destination address */
57 57
58 /* Flags and state transition */ 58 /* Flags and state transition */
59 __u16 flags; /* status flags */ 59 __be16 flags; /* status flags */
60 __u16 state; /* state info */ 60 __be16 state; /* state info */
61 61
62 /* The sequence options start here */ 62 /* The sequence options start here */
63}; 63};
diff --git a/net/ipv4/ipvs/ip_vs_xmit.c b/net/ipv4/ipvs/ip_vs_xmit.c
index 52c12e9edbbc..e1f77bd7c9a5 100644
--- a/net/ipv4/ipvs/ip_vs_xmit.c
+++ b/net/ipv4/ipvs/ip_vs_xmit.c
@@ -232,7 +232,7 @@ ip_vs_nat_xmit(struct sk_buff *skb, struct ip_vs_conn *cp,
232 232
233 /* check if it is a connection of no-client-port */ 233 /* check if it is a connection of no-client-port */
234 if (unlikely(cp->flags & IP_VS_CONN_F_NO_CPORT)) { 234 if (unlikely(cp->flags & IP_VS_CONN_F_NO_CPORT)) {
235 __u16 _pt, *p; 235 __be16 _pt, *p;
236 p = skb_header_pointer(skb, iph->ihl*4, sizeof(_pt), &_pt); 236 p = skb_header_pointer(skb, iph->ihl*4, sizeof(_pt), &_pt);
237 if (p == NULL) 237 if (p == NULL)
238 goto tx_error; 238 goto tx_error;