Subject: Sun weirdness

From: Jeremy Porter <[email-masked]>
Date: Thu, 29 Oct 1998 12:21:46 -0600

I'm porting a multicast application to SunOS (Solaris 2.6), and
there is something different about the handling of socket options
for port reuse, in that the sun does not recoginize the SO_REUSEPORT
option.  I believe I need this option to transmit and receive on the
same port.
This fails to complie:
  setsockopt(sock_chat,SOL_SOCKET,SO_REUSEPORT,(void *)0,0);
This is the operating system:
bash-2.02$ uname -a
SunOS austin 5.6 Generic_105181-08 sun4m sparc SUNW,SPARCstation-20

Is there a workaround or something for this or a patch from sun?

---
Jeremy Porter, Freeside Communications, Inc.      [email-masked]
PO BOX 80315 Austin, Tx 78708  |  512-458-9810
http://www.fc.net

---

From: Jan-Peter Richter <[email-masked]>
Date: Fri, 30 Oct 1998 10:10:32 +0100 (MET)

> Is there a workaround or something for this or a patch from sun?

I'm not sure if this is what you want, but my home-brewed multicast
application contains the following lines:

  dummy=1;
  if(setsockopt(fd, SOL_SOCKET,SO_REUSEADDR, (char*) &dummy,
		sizeof(dummy))== -1) {
	perror("setsockopt("fd, SOL_SOCKET,SO_REUSEADDR,...)");
	exit(1);
  }

The manual page setsockopt(3XN) says:
     SO_REUSEADDR   Specifies that the rules used  in  validating
		    addresses  supplied to bind(3XN) should allow
		    reuse of local addresses,  if  this  is  sup-
		    ported by the protocol.  This option takes an
		    int value.

It appears that the int value has to be '1' (or something else !=0)
to activate the option.

Jan-Peter Richter

----------------------------------------------------------------------
Jan-Peter Richter				Vogt-Koelln-Str.30
Universitaet Hamburg				D-22527 Hamburg
Fachbereich Informatik		       		Tel: +49 40 5494-2350
Arbeitsgruppe Telekommunikation        		Fax: +49 40 5494-2328 
und Rechnernetze

e-mail:	[email-masked]
www: http://www.informatik.uni-hamburg.de/TKRN/world/staff/jpr/jpr.htm
----------------------------------------------------------------------