public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Brad Campbell <brad@wasp.net.au>
To: Josan Kadett <corporate@superonline.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: Entirely ignoring TCP and UDP checksum in kernel level
Date: Sun, 22 Aug 2004 12:29:59 +0400	[thread overview]
Message-ID: <41285987.5030702@wasp.net.au> (raw)
In-Reply-To: <S266324AbUHVHMa/20040822071230Z+15@vger.kernel.org>

Josan Kadett wrote:
> Linux Kernel 2.4.18-14 [Redhat 8 standard installation] 
> 
> As I underlined, I have been able to disable IP header checksumming for the
> received packets, so the system will not drop the packets even after CRC
> becomes invalid when the source address changes.
> 
> I have been asking this question over ten different mailing list and forums
> and no one has come up with a "solid" solution. I would be exteremely glad
> if I get a working source code.
> 
> I know the application will be so very simple, just changing some bits with
> another and putting it back to userspace, but it requires some low-level
> libraries and the knowledge to use them... 

This *MAY* do what you want.. (Compiled and tested on 2.4.26)

--- /usr/src/linux-2.4.26/net/ipv4/ip_input.c   2002-08-03 04:39:46.000000000 +0400
+++ net/ipv4/ip_input.c 2004-08-22 12:22:41.000000000 +0400
@@ -417,6 +417,10 @@

         if (ip_fast_csum((u8 *)iph, iph->ihl) != 0)
                 goto inhdr_error;
+       printk("Ip saddr %08x  --  ",iph->saddr);
+       if (iph->saddr == 0x0101a8c0) // 192.168.1.1
+               iph->saddr = 0x014da8c0; // 192.168.77.1
+       printk("Ip saddr %08x\n",iph->saddr);

         {
                 __u32 len = ntohs(iph->tot_len);


When you verify what it's doing, just remove the printk's.

I did it here using one of my local addresses (uml == 192.168.2.84)
And had the above addresses convert 192.168.2.85 to 192.168.77.1

bklaptop:/home/brad# tcpdump -i tap0
tcpdump: verbose output suppressed, use -v or -vv for full protocol decode
listening on tap0, link-type EN10MB (Ethernet), capture size 96 bytes
12:24:16.723748 IP 192.168.2.85 > uml: icmp 64: echo request seq 0
12:24:16.725119 arp who-has gateway tell uml
12:24:17.289458 arp reply gateway is-at 00:ff:14:7a:fe:66
12:24:17.290282 IP uml > 192.168.77.1: icmp 64: echo reply seq 0
12:24:17.720057 IP 192.168.2.85 > uml: icmp 64: echo request seq 256
12:24:17.723690 IP uml > 192.168.77.1: icmp 64: echo reply seq 256
12:24:18.720632 IP 192.168.2.85 > uml: icmp 64: echo request seq 512
12:24:18.724369 IP uml > 192.168.77.1: icmp 64: echo reply seq 512

Good luck.

Regards,
Brad

  reply	other threads:[~2004-08-22  8:33 UTC|newest]

Thread overview: 43+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-08-22  6:17 Entirely ignoring TCP and UDP checksum in kernel level Brad Campbell
2004-08-22  7:18 ` Josan Kadett
2004-08-22  7:24 ` Josan Kadett
2004-08-22  7:04   ` Brad Campbell
2004-08-22  8:12     ` Josan Kadett
2004-08-22  8:29       ` Brad Campbell [this message]
     [not found] <41285DB3.6070605@wasp.net.au>
2004-08-22 10:14 ` Josan Kadett
2004-08-22 11:48   ` James Courtier-Dutton
2004-08-22 10:25 ` Josan Kadett
2004-08-22  9:36   ` Brad Campbell
2004-08-22 10:48     ` Josan Kadett
2004-08-22 13:10       ` Brad Campbell
2004-08-22 13:13       ` Brad Campbell
2004-08-22 19:27         ` Josan Kadett
2004-08-22 20:28         ` Josan Kadett
2004-08-23  3:38           ` David Meybohm
2004-08-23  5:26             ` Josan Kadett
2004-08-23  8:40             ` Josan Kadett
  -- strict thread matches above, loose matches on Subject: below --
2004-08-22  9:19 Brad Campbell
     [not found] <04Aug21.205911edt.41960@gpu.utcc.utoronto.ca>
2004-08-22  2:08 ` Josan Kadett
2004-08-22  6:01   ` Brad Campbell
2004-08-22  7:06     ` Josan Kadett
     [not found] <1093120934.854.155.camel@krustophenia.net>
2004-08-21 20:46 ` Lee Revell
2004-08-21 21:53   ` Josan Kadett
     [not found] <4126FDD8.1090101@gmc.lt>
2004-08-21  9:00 ` Josan Kadett
2004-08-21  8:11   ` Denis Vlasenko
2004-08-21  9:18     ` Josan Kadett
2004-08-21  8:26       ` Lee Revell
2004-08-21  9:35         ` Josan Kadett
2004-08-21  9:14   ` Vojtech Pavlik
     [not found] <1093078213.854.76.camel@krustophenia.net>
2004-08-21  8:58 ` Lee Revell
2004-08-21 21:41   ` Josan Kadett
2004-08-21  8:27 Denis Vlasenko
2004-08-21  8:41 ` Lee Revell
2004-08-21  9:50   ` Josan Kadett
2004-08-21  9:06     ` Kalin KOZHUHAROV
2004-08-21 21:46       ` Josan Kadett
2004-08-21  9:39 ` Josan Kadett
     [not found] <4126F16D.1000507@gmc.lt>
2004-08-21  8:02 ` Josan Kadett
2004-08-21  7:36   ` Kalin KOZHUHAROV
2004-08-21  8:54     ` Josan Kadett
2004-08-21  6:15 Josan Kadett
2004-08-21  7:10 ` Willy Tarreau

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=41285987.5030702@wasp.net.au \
    --to=brad@wasp.net.au \
    --cc=corporate@superonline.com \
    --cc=linux-kernel@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox