Re(4): errno 40 (EMSGSIZE, message too long)
Re(4): errno 40 (EMSGSIZE, message too long)
- Subject: Re(4): errno 40 (EMSGSIZE, message too long)
- From: "Peter Lovell" <email@hidden>
- Date: Sun, 26 Jan 2003 11:11:53 -0500
Hi Ryan,
>
> I notice you get a regular mbuf and not a packet header. Is this TCP or
>
> UDP (or ???) If this is supposed to be separate than I'd expect to use
>
> a
>
> packet header mbuf.
>
Just raw. Our socket is created with
>
err = socreate( AF_UNIX, &gNKEInfo.sCommSocket, SOCK_STREAM, 0 );
>
if ( err == KERN_SUCCESS )
>
{
>
gNKEInfo.sCommAddress.sun_family = AF_UNIX;
>
strcpy( gNKEInfo.sCommAddress.sun_path, kNPFSocketName );
>
gNKEInfo.sCommAddress.sun_len = sizeof( gNKEInfo.sCommAddress ) -
>
sizeof( gNKEInfo.sCommAddress.sun_path ) + strlen(
>
gNKEInfo.sCommAddress.sun_path );
>
err = soconnect( gNKEInfo.sCommSocket, (struct sockaddr
>
*)&gNKEInfo.sCommAddress );
>
AFAIK IPC sockets don't need to have the TCP/UDP packet headers
>
prepended to the mbuf.
>
True. But looking through the sosend code (uipc_socket.c), it's clear
that it starts out with a packet header, not a regular mbuf. The code to
give you a packet header mbuf initialized several fields which aren't
used in the regular one. And even after that, sosend sets several mbuf
fields. I suspect that you're getting a regular mbuf, some fields are
uninitialized and this is the cause of the error. Some of the time it
works, because the fields are within bounds. Other times they're outside
the range, and the packet is rejected. Have a close look at what sosend
does with data passed from user-space, and try to have your code follw
that example.
Cheers.....Peter
_______________________________________________
macnetworkprog mailing list | email@hidden
Help/Unsubscribe/Archives:
http://www.lists.apple.com/mailman/listinfo/macnetworkprog
Do not post admin requests to the list. They will be ignored.