Skip to Content.
Sympa Menu

freetds - Re: [freetds] Issue connecting to SQL Server from Linux Hostwithnewerversions of FreeTDS...

freetds AT lists.ibiblio.org

Subject: FreeTDS Development Group

List archive

Chronological Thread  
  • From: "Glenn, Chris" <Glenn AT addsys.com>
  • To: "FreeTDS Development Group" <freetds AT lists.ibiblio.org>
  • Subject: Re: [freetds] Issue connecting to SQL Server from Linux Hostwithnewerversions of FreeTDS...
  • Date: Tue, 28 Nov 2006 09:20:19 -0500

If you can tell me specifically where in the net.c source this line
should be added, I can try it right away.

Thanks-
Chris Glenn

-----Original Message-----
From: freetds-bounces AT lists.ibiblio.org
[mailto:freetds-bounces AT lists.ibiblio.org] On Behalf Of Christos Zoulas
Sent: Tuesday, November 28, 2006 9:02 AM
To: FreeTDS Development Group
Subject: Re: [freetds] Issue connecting to SQL Server from Linux
Hostwithnewerversions of FreeTDS...

On Nov 28, 8:10am, Glenn AT addsys.com ("Glenn, Chris") wrote:
-- Subject: Re: [freetds] Issue connecting to SQL Server from Linux Host
with

| Just last night I was reviewing our networking code in conjunction
with
| reading Steven's book, and it so happens I was looking at that very
| function.
|
| EINVAL is not a nice error code; it says we're not supplying a good
| value for some element of the sockaddr_in structure. NetBSD's manpage
| doesn't even mention it at as valid errno value for connect(2).
|
| 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.

|
| I added yet more logging code, cf. patch below. With it, your log
file
| should now dump the sockaddr_in structure. You can verify that, say,
| sin_family really is AF_INET according to your system's header files.

|
| I'm not sure we should leave this code in; it won't compile under
Win32,
| for instance. But it will be in the next snapshot, and maybe it will
| help solve your problem.
|
| --jkl

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.

christos
_______________________________________________
FreeTDS mailing list
FreeTDS AT lists.ibiblio.org
http://lists.ibiblio.org/mailman/listinfo/freetds




Archive powered by MHonArc 2.6.24.

Top of Page