Google
  Web www.spinics.net

Re: [PATCH 1/2] ipvs: load balance IPv4 connections from a local process

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]


Hi

> 	TCP checksum is not optional, why this change appeared?

The new packets that we handle are on the loopback device and no checksums
appear to be generated there. I initially changed the condition to check
for loopback device (which we could do), but checking udp code found that
it already handled it by checking zero checksum, hence the same
implementation in tcp code.

>> Index: lvs-2.6/net/ipv4/ipvs/ip_vs_proto_tcp.c
>> ===================================================================
>> --- lvs-2.6.orig/net/ipv4/ipvs/ip_vs_proto_tcp.c	2008-09-03
>> 10:56:05.000000000 +1000
>> +++ lvs-2.6/net/ipv4/ipvs/ip_vs_proto_tcp.c	2008-09-03
>> 11:24:26.000000000 +1000
>> @@ -166,7 +166,7 @@ tcp_snat_handler(struct sk_buff *skb,
>>  	tcph->source = cp->vport;
>>
>>  	/* Adjust TCP checksums */
>> -	if (!cp->app) {
>> +	if (!cp->app && (tcph->check != 0)) {
>>  		/* Only port and addr are changed, do fast csum update */
>>  		tcp_fast_csum_update(cp->af, tcph, &cp->daddr, &cp->vaddr,
>>  				     cp->dport, cp->vport);
>> @@ -235,7 +235,7 @@ tcp_dnat_handler(struct sk_buff *skb,
>>  	/*
>>  	 *	Adjust TCP checksums
>>  	 */
>> -	if (!cp->app) {
>> +	if (!cp->app && (tcph->check != 0)) {
>>  		/* Only port and addr are changed, do fast csum update */
>>  		tcp_fast_csum_update(cp->af, tcph, &cp->vaddr, &cp->daddr,
>>  				     cp->vport, cp->dport);
>> --

-- 
Siiralt Teie,
Elektromehaaniline Põder

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Kernel List]     [Site Home]     [Ethernet Bridging]     [Git]     [IETF Annouce]     [Linux Assembly]     [VLAN]     [Networking]     [Security]     [Bugtraq]     [Rubini]     [Photo]     [Singles Social Netowrking]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Virtualization]     [Linux Security]     [Linux IDE]     [Linux RAID]     [Linux SCSI]     [Linux Wireless]     [DDR & Rambus]     [Free Dating]     [Linux Resources]     [Wireless Reading Device]

Add to Google Powered by Linux