[PATCH] Re: IP_MULTICAST_IF et all / Winsock[2] value conflict

Corinna Vinschen corinna-cygwin@cygwin.com
Mon Oct 3 16:54:00 GMT 2005


On Sep 30 18:39, Brian Ford wrote:
> On Fri, 30 Sep 2005, Corinna Vinschen wrote:
> > On Sep 30 10:07, Brian Ford wrote:
> > > We can simply translate the current constant Winsock 1 values to Winsock 2
> > > ones when necessary in cygwin_[set|get]sockopt.  There are only 8 values
> > > that need changing, I think.
> >
> > Yeah, I think that we can basically do something like this.  But we
> > should not try to guess what the application really meant to do
> > based on the incoming value and the winsock version in use.
> 
> Why not?  There is no guessing involved if we do not change Cygwin's
> system headers.  If someone used a Windows header directly and called the
> Cygwin [set|get]sockopt, well then..., that's their fault.

That's not supported anyway.

> > Actually we have two states, applications built before we changed the
> > header file and applications built after we changed the header file.
> 
> Let's just not change it ;-).

No, let's change it.  Winsock2 is the way to go.  Winsock1 is just old
stuff.  Since Cygwin is using Winsock2 when running on a 98 system or
above, and since applications using the old/wrong Winsock1 values are
broken right now anyway, there's no gain to keep the old values and
force all new (and supposed to be working) applications to go through
a translation stage.  Let the old applications suffer, not the new ones.

> > This is visible by an internal version number maintained by Cygwin.
> 
> Ok, I'm not aware of how that works.

vi winsup/cygwin/include/cygwin/version.h
/CYGWIN_VERSION_CHECK

> Ok, here's an untested (as yet) patch:
> 
> 2005-09-30  Brian Ford  <Brian.Ford@FlightSafety.com>
> 
> 	* net.cc (ws2ip_optname): New function to convert IP_* socket
> 	options from Winsock 1.1 values to Winsock 2 ones.
> 	(cygwin_setsockopt): Use it.
> 	(cygwin_getsockopt): Likewise.

Er... didn't you say somthing along the lines of "concept first, code later"?

> > I want to drop Winsock1 support nevertheless.  It only complicates the
> > code and has no real gain.
> 
> I think I'll let you handle that one ;-).

Sigh.


Corinna

-- 
Corinna Vinschen                  Please, send mails regarding Cygwin to
Cygwin Project Co-Leader          cygwin AT cygwin DOT com
Red Hat, Inc.



More information about the Cygwin-patches mailing list