From: htmldeveloper@gmail.com (Peter Teoh)
To: kernelnewbies@lists.kernelnewbies.org
Subject: Queries about Net-Filter Hooks !!!
Date: Sun, 11 Dec 2011 08:43:24 +0800 [thread overview]
Message-ID: <CAHnt0GVUiXQCNpWFRNJxfOUg3Y6enA5Wt+=KNj-KZOFUJJN4fQ@mail.gmail.com> (raw)
In-Reply-To: <CADWUQZ6EC4_7idcvtwg=Y-ymDstdp-SDuTJWh7k65Cazq_NACQ@mail.gmail.com>
On Mon, Nov 21, 2011 at 6:39 PM, Kesava Srinivas
<vunnavafuture@gmail.com> wrote:
>
> HI Friends,
> Trying to Play with Net-Filter Hooks and here are my Queries!
>
> 1] While adding a New UDP/IP Header over the received skbuffer from NetFilter Module;need to fill the UDP Check-sum. Please let me know ; if there is any Kernel Function which we can use to do this Job ??? OR Do I need to write our own Function to calculate the Check-sum ???
>
just u need, just write your own checksum. the kernel is highly
optimized. everytime there is a change in bytes anywere in IP
packet, the existing checksum will be used to calculate the new
checksum incrementally. so for your case, if u start with no
checksum, just calculate one by setting the checksum to zero first,
calculate checksum, then fill the checksum with the calculated
checksum.
IP ad TCP each has its own checksum BTW.
> 2] Once after adding New Headers to the received skbuffer ; am trying to return NF_ACCEPT. My Understanding was that ; the newly expanded skbuffer with added Headers will be again taken my Net-Filter Hooks Module and will deliver back to the net device. rt? OR Was there some thing more that I should do ; to send the new skbuffer to the device ??
>
don't understand???
> Looking forward for the reply !!
>
> -Thanks in Advance,
> VKS
>
>
>
> _______________________________________________
> Kernelnewbies mailing list
> Kernelnewbies at kernelnewbies.org
> http://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies
>
--
Regards,
Peter Teoh
prev parent reply other threads:[~2011-12-11 0:43 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-11-21 10:39 Queries about Net-Filter Hooks !!! Kesava Srinivas
2011-12-11 0:43 ` Peter Teoh [this message]
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='CAHnt0GVUiXQCNpWFRNJxfOUg3Y6enA5Wt+=KNj-KZOFUJJN4fQ@mail.gmail.com' \
--to=htmldeveloper@gmail.com \
--cc=kernelnewbies@lists.kernelnewbies.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;
as well as URLs for NNTP newsgroup(s).