Re: AF_UNIX MSG_PEEK bug?

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Tom Spink <tspink@...>
Cc: Rick Jones <rick.jones2@...>, <netdev@...>, David Miller <davem@...>, <linux-kernel@...>
Date: Tuesday, January 8, 2008 - 7:18 pm

On Tue, 8 Jan 2008, Tom Spink wrote:


In do_producer(), there are the following lines in the main loop:

	/* Send random lengths of data */
	messages[i].length = (rand() % MAXLEN) + sizeof(size_t);
	iov[i].iov_len = messages[i].length;

The entire "struct sockmsg" is sent across the socket, so the first
size_t in each message contains the length of the entire message
(including the size_t).  This size gets picked up at the
recv(...,MSG_PEEK) line in do_consumer().

Thanks,
Brent

-- 
Brent Casavant                          All music is folk music.  I ain't
bcasavan@sgi.com                        never heard a horse sing a song.
Silicon Graphics, Inc.                    -- Louis Armstrong
--
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
AF_UNIX MSG_PEEK bug?, Brent Casavant, (Tue Jan 8, 6:27 pm)
Re: AF_UNIX MSG_PEEK bug?, Tetsuo Handa, (Wed Jan 9, 7:04 am)
Re: AF_UNIX MSG_PEEK bug?, Brent Casavant, (Wed Jan 9, 2:01 pm)
Re: AF_UNIX MSG_PEEK bug?, Herbert Xu, (Wed Jan 9, 8:01 pm)
Re: AF_UNIX MSG_PEEK bug?, Brent Casavant, (Wed Jan 9, 10:50 pm)
Re: AF_UNIX MSG_PEEK bug?, Brent Casavant, (Thu Jan 10, 6:35 pm)
Re: AF_UNIX MSG_PEEK bug?, Alan Cox, (Thu Jan 10, 6:36 pm)
Re: AF_UNIX MSG_PEEK bug?, Brent Casavant, (Wed Jan 9, 9:19 pm)
Re: AF_UNIX MSG_PEEK bug?, Rick Jones, (Tue Jan 8, 6:40 pm)
Re: AF_UNIX MSG_PEEK bug?, Brent Casavant, (Tue Jan 8, 7:20 pm)
Re: AF_UNIX MSG_PEEK bug?, Tom Spink, (Tue Jan 8, 6:53 pm)
Re: AF_UNIX MSG_PEEK bug?, Brent Casavant, (Tue Jan 8, 7:18 pm)
Re: AF_UNIX MSG_PEEK bug?, Tom Spink, (Tue Jan 8, 7:39 pm)
Re: AF_UNIX MSG_PEEK bug?, Tom Spink, (Tue Jan 8, 7:46 pm)
Re: AF_UNIX MSG_PEEK bug?, Brent Casavant, (Tue Jan 8, 8:08 pm)