[comp.unix.wizards] 4.3 BSD networking bugs

stevens@hsi.UUCP (Richard Stevens) (11/28/88)

I've encountered two "problems" with the 4.3 BSD networking code
that I'm wondering if anyone has previously found and fixed.
I've checked the vanilla 4.3 sources against the updated UCB
networking code that was posted in April 88, and didn't see any
changes that might affect these problems.

(1) When using UNIX domain datagrams, only the first 14 bytes of
	the sender's socket address are passed with the datagram.
	It looks like sbappendaddr() in sys/uipc_socket2.c is doing
	this, as it assumes everything fits into a "struct sockaddr".
	The socket with the longer-than-14-byte path name is created
	just fine, but it's entire name isn't sent along with the datagram.

(2) When using XNS datagrams (IDP protocol) you have to explicitly
	call bind() to assign an address to yourself, if you want
	the other end to be able to respond to you, otherwise an all
	zero address gets sent along with the datagram.  This problem
	doesn't happen with UDP datagrams.  In looking at netns/ns_pcb.c
	it looks like a local address should be automatically assigned,
	but this isn't happening.

		Richard Stevens
		Health Systems International, New Haven, CT
		   stevens@hsi.uu.net
       		   ... { uunet | yale } ! hsi ! stevens

chris@mimsy.UUCP (Chris Torek) (11/30/88)

In article <204@hsi86.hsi.UUCP> stevens@hsi.UUCP (Richard Stevens) writes:
>(1) When using UNIX domain datagrams, only the first 14 bytes of
>	the sender's socket address are passed with the datagram.
>	It looks like sbappendaddr() ...

Yep.  Fixed in 4.4BSD?  (4.4 will have variable length socket addresses,
which are required by various ISO protocols.)

>(2) When using XNS datagrams (IDP protocol) you have to explicitly
>	call bind() to assign an address to yourself, if you want
>	the other end to be able to respond to you, otherwise an all
>	zero address gets sent along with the datagram.

spp_usrreq calls ns_pcbbind with a null `nam', telling it to choose
a local port.  ns_pcbbind defers choosing a local host address, however,
until send time, just like the TCP code.  Alas, ns_output does not
contain the `#ifndef notdef' (=~ `if true') code that appears in
ip_output....
-- 
In-Real-Life: Chris Torek, Univ of MD Comp Sci Dept (+1 301 454 7163)
Domain:	chris@mimsy.umd.edu	Path:	uunet!mimsy!chris

johnd@physiol.su.oz (John Dodson) (12/03/88)

In article <14759@mimsy.UUCP>, chris@mimsy.UUCP (Chris Torek) writes:
> 
> Yep.  Fixed in 4.4BSD?  (4.4 will have variable length socket addresses,
> which are required by various ISO protocols.)
> 

When 4.4BSD pray tell ?

johnd@physiol.su.oz.AU