lkml.org 
[lkml]   [2000]   [Aug]   [28]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
Subjectnewbie question: tcp/ip in kernel
Hi

I was looking for information about this in the lkml archives and lots
of books and howtos but I did not find the definitive answer to my
questions.
Please excuse if I missed something.

I want to do TCP/IP in the Kernel.
I already have an implementation running in the 2.2.14 Kernel and it
looks
quite good. But I wanted to make sure that I did not miss something
important because the application I am working on must be very stable
and
reliable.

I assume that the normal way would be something like this (2.2 kernel):

{
mm_segment_t old_fs;

lock_kernel();
old_fs = get_fs();
set_fs(KERNEL_DS); /* Needed for the copy_from_user
that tcp_do_sendmsg is going to do */

err = sock_sendmsg(sock, msg, size);

set_fs(old_fs);
unlock_kernel();
}

Is this correct ?

More questions:

-) What is the best way to get rid of the copy_from_user memcpy that
tcp_do_sendmsg does in that call?

-) How do I have to adapt this code to work in the 2.4 Kernel
(especially because the lock_kernel should hopefully no longer be needed
in 2.4)
What is the proper way to make that thing SMP-Safe in 2.4?

Thanks for your answers

Reto
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2005-03-22 12:38    [W:0.055 / U:3.332 seconds]
©2003-2018 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site