Re: sending ICMP messages in kernel module

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

 




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-

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Stuff]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]     [Linux Resources]
  Powered by Linux