mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: "J. Scott Kasten" <jscottkasten@yahoo.com>
To: rajat swarup <rajats@gmail.com>
Cc: linux-kernel@vger.kernel.org
Subject: Re: sending ICMP messages in kernel module
Date: Sat, 07 May 2005 18:17:34 -0400	[thread overview]
Message-ID: <427D3E7E.2020405@yahoo.com> (raw)
In-Reply-To: <7d04ec5605050622006f3ad56c@mail.gmail.com>


rajat swarup wrote:

>Hi,
>I have placed a netfilter hook in which I grab the packets in the
>pre-routing stage.
>I need to send ICMP messages in response to certain messages in this hook.
>I looked at alloc_skb(), skb_reserve() and skb_put() functions but it
>is still not clear to me as to how to construct the packets using
>these methods.
>Since I am getting the packets in the Pre-routing stage should I
>explicitly construct the MAC header, IP header & data & ICMP message?
>Also, I'll need to calculate the checksum to be transmitted in the
>ICMP packet...which method could I use to do that?
>  
>
Hello,

I had a similar problem once.  In the icmp.c file, look at how the ping 
echo reply works.  That is as close to a tutorial as you will find in 
the code.  I think you might find it strait forward from there.

-Scott-


  reply	other threads:[~2005-05-07 22:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2005-05-07  5:00 rajat swarup
2005-05-07 22:17 ` J. Scott Kasten [this message]
2005-05-07 23:39   ` rajat swarup

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=427D3E7E.2020405@yahoo.com \
    --to=jscottkasten@yahoo.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=rajats@gmail.com \
    /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

Powered by JetHome