Messages in this thread | | | Date | Mon, 28 Aug 2000 13:48:35 -0700 | From | Reto Baettig <> | Subject | newbie 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/
| |