git://git.onelab.eu
/
linux-2.6.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
fedora core 6 1.2949 + vserver 2.2.0
[linux-2.6.git]
/
net
/
ipv4
/
ipvs
/
ip_vs_proto_tcp.c
diff --git
a/net/ipv4/ipvs/ip_vs_proto_tcp.c
b/net/ipv4/ipvs/ip_vs_proto_tcp.c
index
bc28b11
..
16a9ebe
100644
(file)
--- 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 *
tcp_conn_in_get(const struct sk_buff *skb, struct ip_vs_protocol *pp,
const struct iphdr *iph, unsigned int proto_off, int inverse)
{
tcp_conn_in_get(const struct sk_buff *skb, struct ip_vs_protocol *pp,
const struct iphdr *iph, unsigned int proto_off, int inverse)
{
- __
u
16 _ports[2], *pptr;
+ __
be
16 _ports[2], *pptr;
pptr = skb_header_pointer(skb, proto_off, sizeof(_ports), _ports);
if (pptr == NULL)
pptr = skb_header_pointer(skb, proto_off, sizeof(_ports), _ports);
if (pptr == NULL)
@@
-50,7
+50,7
@@
static struct ip_vs_conn *
tcp_conn_out_get(const struct sk_buff *skb, struct ip_vs_protocol *pp,
const struct iphdr *iph, unsigned int proto_off, int inverse)
{
tcp_conn_out_get(const struct sk_buff *skb, struct ip_vs_protocol *pp,
const struct iphdr *iph, unsigned int proto_off, int inverse)
{
- __
u
16 _ports[2], *pptr;
+ __
be
16 _ports[2], *pptr;
pptr = skb_header_pointer(skb, proto_off, sizeof(_ports), _ports);
if (pptr == NULL)
pptr = skb_header_pointer(skb, proto_off, sizeof(_ports), _ports);
if (pptr == NULL)
@@
-84,7
+84,7
@@
tcp_conn_schedule(struct sk_buff *skb,
}
if (th->syn &&
}
if (th->syn &&
- (svc = ip_vs_service_get(skb->
nf
mark, skb->nh.iph->protocol,
+ (svc = ip_vs_service_get(skb->mark, skb->nh.iph->protocol,
skb->nh.iph->daddr, th->dest))) {
if (ip_vs_todrop()) {
/*
skb->nh.iph->daddr, th->dest))) {
if (ip_vs_todrop()) {
/*
@@
-112,13
+112,13
@@
tcp_conn_schedule(struct sk_buff *skb,
static inline void
static inline void
-tcp_fast_csum_update(struct tcphdr *tcph,
u32 oldip, u
32 newip,
-
u16 oldport, u
16 newport)
+tcp_fast_csum_update(struct tcphdr *tcph,
__be32 oldip, __be
32 newip,
+
__be16 oldport, __be
16 newport)
{
tcph->check =
{
tcph->check =
-
ip_vs_check_diff(~
oldip, newip,
- ip_vs_check_diff
(oldport ^ 0xFFFF
,
-
newport, tcph->check
));
+
csum_fold(ip_vs_check_diff4(
oldip, newip,
+ ip_vs_check_diff
2(oldport, newport
,
+
~csum_unfold(tcph->check))
));
}
}
@@
-151,7
+151,7
@@
tcp_snat_handler(struct sk_buff **pskb,
/* Only port and addr are changed, do fast csum update */
tcp_fast_csum_update(tcph, cp->daddr, cp->vaddr,
cp->dport, cp->vport);
/* Only port and addr are changed, do fast csum update */
tcp_fast_csum_update(tcph, cp->daddr, cp->vaddr,
cp->dport, cp->vport);
- if ((*pskb)->ip_summed == CHECKSUM_
HW
)
+ if ((*pskb)->ip_summed == CHECKSUM_
COMPLETE
)
(*pskb)->ip_summed = CHECKSUM_NONE;
} else {
/* full checksum calculation */
(*pskb)->ip_summed = CHECKSUM_NONE;
} else {
/* full checksum calculation */
@@
-204,7
+204,7
@@
tcp_dnat_handler(struct sk_buff **pskb,
/* Only port and addr are changed, do fast csum update */
tcp_fast_csum_update(tcph, cp->vaddr, cp->daddr,
cp->vport, cp->dport);
/* Only port and addr are changed, do fast csum update */
tcp_fast_csum_update(tcph, cp->vaddr, cp->daddr,
cp->vport, cp->dport);
- if ((*pskb)->ip_summed == CHECKSUM_
HW
)
+ if ((*pskb)->ip_summed == CHECKSUM_
COMPLETE
)
(*pskb)->ip_summed = CHECKSUM_NONE;
} else {
/* full checksum calculation */
(*pskb)->ip_summed = CHECKSUM_NONE;
} else {
/* full checksum calculation */
@@
-229,7
+229,7
@@
tcp_csum_check(struct sk_buff *skb, struct ip_vs_protocol *pp)
switch (skb->ip_summed) {
case CHECKSUM_NONE:
skb->csum = skb_checksum(skb, tcphoff, skb->len - tcphoff, 0);
switch (skb->ip_summed) {
case CHECKSUM_NONE:
skb->csum = skb_checksum(skb, tcphoff, skb->len - tcphoff, 0);
- case CHECKSUM_
HW
:
+ case CHECKSUM_
COMPLETE
:
if (csum_tcpudp_magic(skb->nh.iph->saddr, skb->nh.iph->daddr,
skb->len - tcphoff,
skb->nh.iph->protocol, skb->csum)) {
if (csum_tcpudp_magic(skb->nh.iph->saddr, skb->nh.iph->daddr,
skb->len - tcphoff,
skb->nh.iph->protocol, skb->csum)) {
@@
-239,7
+239,7
@@
tcp_csum_check(struct sk_buff *skb, struct ip_vs_protocol *pp)
}
break;
default:
}
break;
default:
- /*
CHECKSUM_UNNECESSARY
*/
+ /*
No need to checksum.
*/
break;
}
break;
}
@@
-490,16
+490,18
@@
tcp_state_transition(struct ip_vs_conn *cp, int direction,
static struct list_head tcp_apps[TCP_APP_TAB_SIZE];
static DEFINE_SPINLOCK(tcp_app_lock);
static struct list_head tcp_apps[TCP_APP_TAB_SIZE];
static DEFINE_SPINLOCK(tcp_app_lock);
-static inline __u16 tcp_app_hashkey(__
u
16 port)
+static inline __u16 tcp_app_hashkey(__
be
16 port)
{
{
- return ((port >> TCP_APP_TAB_BITS) ^ port) & TCP_APP_TAB_MASK;
+ return (((__force u16)port >> TCP_APP_TAB_BITS) ^ (__force u16)port)
+ & TCP_APP_TAB_MASK;
}
static int tcp_register_app(struct ip_vs_app *inc)
{
struct ip_vs_app *i;
}
static int tcp_register_app(struct ip_vs_app *inc)
{
struct ip_vs_app *i;
- __u16 hash, port = inc->port;
+ __u16 hash;
+ __be16 port = inc->port;
int ret = 0;
hash = tcp_app_hashkey(port);
int ret = 0;
hash = tcp_app_hashkey(port);