Find the answer to your Linux question:
Results 1 to 3 of 3
I am writing a Kernel Module (will become GPL when ended) to backup VANETS using Cellular Data Network (UMTS) I'm using Netfilter hooks: The idea seems simple you put an ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Dec 2007
    Location
    Madrid
    Posts
    4

    Where is filled udph->check field?


    I am writing a Kernel Module (will become GPL when ended) to backup VANETS using Cellular Data Network (UMTS)

    I'm using Netfilter hooks: The idea seems simple you put an OUTPUT hook and if the dest address is in a list of adrresses to be backuped, you change the dest address
    Of course you have to recalculate
    IP checksum: ip_send_ceck()
    Route: ip_route_me_harder()
    TCP/UDP checksums these are build using a fake header with ip addresses and ports. After changing an address you haye to call
    ip_nat_cheat_check()

    The problem is when my hook is called UDP checksum isnīt in place yet, I donīt know where it is calculated (I know that because I always get the same check value but my datagrams have an increasing order field)

    Could any one help me

  2. #2
    Just Joined!
    Join Date
    Dec 2007
    Location
    Madrid
    Posts
    4

    Post Further data

    I, of course, have continued studing the problem am I think I've got further data.

    I think the problem is related with TCP offload, that is discharge the CPU of calculating cksum and do it in network cards.

    But I think there are ways to disable this feature (for instance when using NAT that is much the same that my problem)

    Do anyone know How to disable that inside the kernel ?

    Thank you very much

  3. #3
    Just Joined!
    Join Date
    Dec 2007
    Location
    Madrid
    Posts
    4
    I think I have resolved the problem.

    It was related with TOE (Tcp offload engine) and you don´t really need to disable it. The only thing you have to do if you're going to mangle a packet is:
    if(skb->ip_summed == CHECKSUM_HW)
    skb_checksum_help(skb, 0);
    Being skb a pointer to the "socket buffer" of the packet. This call will complete the checksum calculation.
    Of course after mangling you have to call ip_send_check() , ip_route_me_harder() and ip_nat_cheat_check()

    Cheers

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •