Re: msghdr problem in tcp_sendmsg

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Thu, 8 Sep 2005, Serge Goodenko wrote:

> Hello!
>
> I trace the kernel networking code (ver 2.4.25).
> I send simple message (say, "hello") using simple client and see how
> tcp_sendmsg function works.
> And what I see is that there's NO my message (e.g. "hello") in the msghdr
> structure that tcp_sendmsg receives,
> e.g. in (char*)msg->msg_iov->iov_base, although debugger shows that
> msg->msg_iov->iov_len = 6, e.g. equals to "hello" message length (+1).
> Can anyone explain where I am wrong or what I do not understand?
>
> I am using the UML kernel and standard gdb debugger.
>

Did you build the proper 'struct iovec' ?  It gets a pointer to
your "hello", not the string itself as member iov_base.
If you look at this with the debugger, you need to dereference
this pointer. The string can be anywhere.

When receiving, that struct member gets a pointer to your buffer,
not the buffer itself. This means that struct iovec is always
the sizeof(void *) + sizeof(size_t) in length.

>
> Serge Goodenko,
> MIPT, Russia
> -

Cheers,
Dick Johnson
Penguin : Linux version 2.6.13 on an i686 machine (5589.54 BogoMips).
Warning : 98.36% of all statistics are fiction.
.
I apologize for the following. I tried to kill it with the above dot :

****************************************************************
The information transmitted in this message is confidential and may be privileged.  Any review, retransmission, dissemination, or other use of this information by persons or entities other than the intended recipient is prohibited.  If you are not the intended recipient, please notify Analogic Corporation immediately - by replying to this message or by sending an email to [email protected] - and destroy all copies of this information, including any attachments, without reading or disclosing them.

Thank you.
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to [email protected]
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

[Index of Archives]     [Kernel Newbies]     [Netfilter]     [Bugtraq]     [Photo]     [Gimp]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Video 4 Linux]     [Linux for the blind]
  Powered by Linux