Re: Routing Socket and New Addresses

2002-01-28 Thread Andrew



On Sun, 27 Jan 2002, Justin C.Walker wrote:

 It is and it is :-}.  At least, Stevens discusses it in Unix Network
 Programming, v1, 2e (sec. 20.3).  Different systems, alas, treat this
 case differently.

My section 20.3 is on UDP Datagram Trunctation...did you mean 17.3
(Routing Sockets: Reading and Writing). I can't find any mention of this
behaviour in either place mind you.

Thanks,

Andrew


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: Routing Socket and New Addresses

2002-01-28 Thread Justin C . Walker


On Monday, January 28, 2002, at 05:03 PM, Andrew wrote:



 On Sun, 27 Jan 2002, Justin C.Walker wrote:

 It is and it is :-}.  At least, Stevens discusses it in Unix Network
 Programming, v1, 2e (sec. 20.3).  Different systems, alas, treat this
 case differently.

 My section 20.3 is on UDP Datagram Trunctation...did you mean 17.3
 (Routing Sockets: Reading and Writing). I can't find any mention of this
 behaviour in either place mind you.

Maybe I misunderstood the original message; I thought this thread dealt 
with the observed truncation of packets when read from a socket.  20.3 
was what I intended, as it covers the observed behavior (at least, 
that's my story, and I'm sticking with it :-]).

Regards,

Justin

--
Justin C. Walker, Curmudgeon-At-Large  *
Institute for General Semantics|   If you're not confused,
|   You're not paying attention
*--*---*


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: Routing Socket and New Addresses

2002-01-27 Thread Andrew



On Wed, 23 Jan 2002, Andrew wrote:

 configured I get a RTM_NEWADDR message. The bit I'm confused with is the
 struct sockaddr associated with RTA_IFA (that I assumed would hold the IP
 of the interface) has an sa_family value of AF_IMPLINK. If I cast it to a
 struct sockaddr_in then s_addr is 0.

Well it turns out that this was a combination of a bug in my code (*red
face*) and something else. The something else I haven't quite worked out
but it seems that if I don't read the packet with one read call then the
packet is lost. Is this correct behaviour? I guess if the buffer is small
and a number of packets (such as wehn an interface goes up or down) then
it might happen but there shouldnt be that much time between read calls.

I'll play with it a bit more tonight.

Thanks,

Andrew


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: Routing Socket and New Addresses

2002-01-27 Thread Andrew



On Sun, 27 Jan 2002, Andrew wrote:

 but it seems that if I don't read the packet with one read call then the
 packet is lost. Is this correct behaviour? I guess if the buffer is small

Well it seems that if you dont get the entire packet in one read it is
lost forever. It also seems that no matter how many bytes you try and read
you only ever get one packet (though I haven't confirmed that for sure).

If this is how it really works then perhaps it should be documented
somewhere.

Thanks,

Andrew


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message



Re: Routing Socket and New Addresses

2002-01-27 Thread Justin C . Walker


On Sunday, January 27, 2002, at 08:03 AM, Andrew wrote:



 On Sun, 27 Jan 2002, Andrew wrote:

 but it seems that if I don't read the packet with one read call then 
 the
 packet is lost. Is this correct behaviour? I guess if the buffer is 
 small

 Well it seems that if you dont get the entire packet in one read it is
 lost forever. It also seems that no matter how many bytes you try and 
 read
 you only ever get one packet (though I haven't confirmed that for sure).

 If this is how it really works then perhaps it should be documented
 somewhere.

It is and it is :-}.  At least, Stevens discusses it in Unix Network 
Programming, v1, 2e (sec. 20.3).  Different systems, alas, treat this 
case differently.

Regards,

Justin

--
Justin C. Walker, Curmudgeon-At-Large  *
Institute for General Semantics|Men are from Earth.
|Women are from Earth.
|   Deal with it.
*--*---*


To Unsubscribe: send mail to [EMAIL PROTECTED]
with unsubscribe freebsd-hackers in the body of the message