netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Sending ipv6 packets from a kernel module
@ 2007-05-21  4:34 Anton
  2007-05-21 13:50 ` Neil Horman
  0 siblings, 1 reply; 3+ messages in thread
From: Anton @ 2007-05-21  4:34 UTC (permalink / raw)
  To: netdev

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



----------

IMPORTANT: This email remains the property of the Australian Defence 
Organisation and is subject to the jurisdiction of section 70 of the 
CRIMES ACT 1914.  If you have received this email in error, you are 
requested to contact the sender and delete the email.



^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Sending ipv6 packets from a kernel module
  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
  0 siblings, 1 reply; 3+ messages in thread
From: Neil Horman @ 2007-05-21 13:50 UTC (permalink / raw)
  To: Anton; +Cc: netdev

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


^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: Sending ipv6 packets from a kernel module
  2007-05-21 13:50 ` Neil Horman
@ 2007-05-21 16:58   ` Vlad Yasevich
  0 siblings, 0 replies; 3+ messages in thread
From: Vlad Yasevich @ 2007-05-21 16:58 UTC (permalink / raw)
  To: Neil Horman; +Cc: Anton, netdev

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2007-05-21 16:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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 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).