Find the answer to your Linux question:
Results 1 to 3 of 3
I have a problem I can't solve it. I am developing a module on SUSE 9(kernel-2.6.5). In my module, I will find a socket which is established in another process, ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
  1. #1
    Just Joined!
    Join Date
    Jun 2007
    Posts
    2

    Problem about tcp_alloc_pskb()


    I have a problem I can't solve it.

    I am developing a module on SUSE 9(kernel-2.6.5). In my module, I will find a socket which is established in another process, by pid and fd. Then I will send data by this socket.

    In the mysend(), call kernel routine, from sock_sendmsg()->tcp_sendmsg()->tcp_alloc_pskb(). but tcp_alloc_pskb() always returns NULL, instead of a proper sk_buff. BTW, system call send() calls sock_sendmsg()->tcp_sendmsg()->tcp_alloc_pskb() in the same way, but it can does work well.

    So I ask for help or some other cluds or hints? Or how to debug it in a efficient way? Thanks a lot.

  2. #2
    Just Joined! s13884's Avatar
    Join Date
    Apr 2007
    Posts
    28
    I think its problem about port which is responsible for particular address.

    this is for establish connection in to another process.
    check out the port number, which you are using into your code, port number might be above the 1024, because up to 1024 its reserved for built-in kernel application. If you are not providing the port number in your code, kernel will provide its automatically.

    system calls are depend on the kernel modules header file, also check out the header file which you are use in your code and check for system calls .


    Cheers
    -s

  3. #3
    Just Joined!
    Join Date
    Jun 2007
    Posts
    2
    Quote Originally Posted by s13884 View Post
    I think its problem about port which is responsible for particular address.

    this is for establish connection in to another process.
    check out the port number, which you are using into your code, port number might be above the 1024, because up to 1024 its reserved for built-in kernel application. If you are not providing the port number in your code, kernel will provide its automatically.

    system calls are depend on the kernel modules header file, also check out the header file which you are use in your code and check for system calls .


    Cheers
    -s
    Sorry, I have used 2000 as test port in my experiment.
    I think get_fs() and set_fs() should be added before my sock_sendmsg(), but it haven't been examined yet.

    Thank you.

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •