Re: changing ip addr of skbuff

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

 



On Tue, May 28, 2002 at 08:06:33PM +0900, Jonathan Khoo spoke out thus:
> Hi Sandip,
> 
> In one of my modifications that I had tried, I did change the dst. What
> I have done looks like this:
> 
> 	src | dst			src | dst
> 	 A  |  B			 A  |  B
> 	ip6_output_finish		ip6_rcv
> 	 C  |  D			 C  |  D
> 	    +------------->---------+
> 
> As you can see, I reverted the addresses back to the original before any
> checksum calculation is done on the opposite host. Hence, I didn't see
> the need to recalculate the header which, anyway, makes things way too
> messy.

Damn. IP6 scares me off. ;) So you have hooked into the
xxx_output_finish and xxx_rcv routines on the hosts? That must have
been painful. ;)
 However, now if your routine in the recipient host is
receiving the packet correctly before changing the IP addresses, how
can you trust the packet sniffer? Packet sniffers like tcpdump and
ethereal examine the packet lower down the network layers. They take
ethernet frames and dissect them to give you the IP packet. Ofcourse,
your routine wouldn't have had an opportunity to change the IP
addresses by then, and the checksum in the sniffer code should fail!


> I even toyed around with the udp and tcp, but it gets murkier as I
> trudged deeper into the codes.
> 
> Is the checksum calculation dependent on dst? Where exactly is the dst
> information (physically) in the skbuff?
> Does the skbuff contains any dst information after it is being sent out
> onto the wires?

No checksum is only calculated on certain parts of the IP header and
not the skbuff. 
-- 
Sandip Bhattacharya
Mindframe Software
Work: sandip @ mindsw.com, http://www.mindsw.com
Play: sandipb @ bigfoot.com, http://www.sandipb.net
-----------------------------------------------
--
Kernelnewbies: Help each other learn about the Linux kernel.
Archive:       http://mail.nl.linux.org/kernelnewbies/
FAQ:           http://kernelnewbies.org/faq/


[Index of Archives]     [Newbies FAQ]     [Linux Kernel Mentors]     [Linux Kernel Development]     [IETF Annouce]     [Git]     [Networking]     [Security]     [Bugtraq]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux SCSI]     [Linux ACPI]
  Powered by Linux