netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Vlad Yasevich <vladislav.yasevich@hp.com>
To: Neil Horman <nhorman@tuxdriver.com>
Cc: Anton <Anton.Uzunov@dsto.defence.gov.au>, netdev@vger.kernel.org
Subject: Re: Sending ipv6 packets from a kernel module
Date: Mon, 21 May 2007 12:58:32 -0400	[thread overview]
Message-ID: <4651CFB8.5090401@hp.com> (raw)
In-Reply-To: <20070521135016.GA452@hmsreliant.homelinux.net>

Neil Horman wrote:
> On Mon, May 21, 2007 at 02:04:33PM +0930, Anton wrote:
>> Hi all,
>>
>> Please excuse me if the following question has already been asked on the 
>> mailing list, I am a little new to this.
>>
>> I am trying to send IPv6 packets from a kernel module. As far as I 
>> understand, I would have to use the ip6_output() function, and this 
>> function is certainly present in the net/ipv6/ip6_output.c file (on my
>> 2.6.18 kernel). Unfortunately, the function is not exported from the
>> IPv6 module and so my kernel module is unable to use it. Has anyone 
>> encountered such a problem before, and if not, does anyone know what is 
>> required for me to push a sk_buff into the IP stack for transmission 
>> (from a kernel module)?
>> Any ideas would be appreciated!
>>
>> Regards,
>> Anton
>>
> No, you'll probably want to use something like kernel_sendmsg to send what you
> want, passing in a socket created with something like sock_create_kern.
> 
> Regards
> Neil
> 

You can also use ip6_xmit assuming the module has performed the necessary route lookups.

-vlad

      reply	other threads:[~2007-05-21 16:58 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2007-05-21  4:34 Sending ipv6 packets from a kernel module Anton
2007-05-21 13:50 ` Neil Horman
2007-05-21 16:58   ` Vlad Yasevich [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=4651CFB8.5090401@hp.com \
    --to=vladislav.yasevich@hp.com \
    --cc=Anton.Uzunov@dsto.defence.gov.au \
    --cc=netdev@vger.kernel.org \
    --cc=nhorman@tuxdriver.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;
as well as URLs for NNTP newsgroup(s).