[freetds] Issue connecting to SQL ServerfromLinuxHostwithnewerversions of FreeTDS...
Glenn at addsys.com
Tue Nov 28 15:22:07 EST 2006
Interesting - I pulled the tds_open_socket routine from the
freetds-0.65.dev.20060224/src/tds/net.c file and now tsql connects
The issue must, somehow, be in the changes to this routine since that
From: freetds-bounces at lists.ibiblio.org
[mailto:freetds-bounces at lists.ibiblio.org] On Behalf Of Lowden, James K
Sent: Tuesday, November 28, 2006 1:41 PM
To: FreeTDS Development Group
Subject: Re: [freetds] Issue connecting to SQL
ServerfromLinuxHostwithnewerversions of FreeTDS...
> From: Glenn, Chris
> Sent: Tuesday, November 28, 2006 10:20 AM
> > From: Lowden, James K Sent: Tuesday, November 28, 2006 10:02 AM
> > > From: Christos Zoulas Sent: Tuesday, November 28, 2006 9:02 AM
> > >
> > > On Nov 28, 8:10am, Glenn at addsys.com ("Glenn, Chris") wrote:
> > > -- Subject: Re: [freetds] Issue connecting to SQL Server from
> > > Linux Host with
> > >
> > > | The code itself looks OK, and comparing it to revision 1.14
> > > | (Tue Feb 22 16:04:36 2005), most of the changes are to the
> > > | logging code and adding support for DOS32. That makes me
> > > | wonder if it's a matter of configure perhaps misdetecting
> > > | your system somehow. I think it was around that time that
> > > | we upgraded the toolset that generates the configure script.
> > >
> > > The code is broken (if I am looking at the right version). All
> > > the fields of sockaddr_in are required to be initialized to 0.
> > > Try adding a:
> > >
> > > (void)memset(&sin, 0, sizeof(sin));
> > >
> > > at the beginning of the function.
> > This is why it's good to have someone like Christos active on
> > the list.
> > Try the below patch, and cross your fingers.
> Unfortunately I still get the same error messages with this patch?
That's disappointing. This won't be easy.
I just re-wrote (re-arranged, mostly) src/tds/net.c::tds_open_socket()
so IMHO it's a little saner. It will be in tomorrow's snapshot.
I suggest you try it, but I don't expect anything different. If it
still doesn't work, we can try some triangulation. The question is: is
the problem actually with this function, with connect(2) and select(2),
or are you seeing a side effect of something else?
1. Try tomorrow's snapshot, just in case.
2. Get src/tds/net.c revision 1.14 from CVS (or use your February
snapshot). Copy its tds_open_socket() function entirely, and paste it
into the current snapshot's, overwriting the current implementation.
Rebuild. Does the problem go away?
If replacing tds_open_socket() with the 1.14 revision's works, we know
the function is broken for you. If not, trying to fix the function
would be barking up the wrong tree.
That at least will give us more information, even if it doesn't solve
[Re your last message: I think you have one too many memset() calls.
You're trying to connect to port 0, which will never work.]
The information contained in this transmission may be privileged and
confidential and is intended only for the use of the person(s) named
above. If you are not the intended recipient, or an employee or agent
for delivering this message to the intended recipient, any review,
distribution or duplication of this communication is strictly
prohibited. If you are
not the intended recipient, please contact the sender immediately by
and destroy all copies of the original message. Please note that we do
account orders and/or instructions by e-mail, and therefore will not be
for carrying out such orders and/or instructions. If you, as the
of this message, the purpose of which is to inform and update our
and consultants of developments relating to our services and products,
like to receive further e-mail correspondence from the sender, please
"reply" to the
sender indicating your wishes. In the U.S.: 1345 Avenue of the
Americas, New York,
FreeTDS mailing list
FreeTDS at lists.ibiblio.org
More information about the FreeTDS