From 3d3da6c6e36b773d09c1c1e9d98e06bb0c7f95e0 Mon Sep 17 00:00:00 2001 From: Ronnie Sahlberg Date: Sun, 5 Dec 2010 13:53:41 +1100 Subject: [PATCH] include config.h from lib/socket.c and use this to conditionaly compile code to set sin_len on platforms that require this field in the sockaddr structures. --- Makefile.in | 2 +- lib/socket.c | 4 ++++ 2 files changed, 5 insertions(+), 1 deletion(-) diff --git a/Makefile.in b/Makefile.in index 02bdc13..a72c388 100644 --- a/Makefile.in +++ b/Makefile.in @@ -4,7 +4,7 @@ libdir = @libdir@ bindir = @bindir@ LIBS="-lpopt" CC=gcc -CFLAGS=-g -O0 -fPIC -Wall -W -I./include "-D_U_=__attribute__((unused))" +CFLAGS=-g -O0 -fPIC -Wall -W -I. -I./include "-D_U_=__attribute__((unused))" LIBISCSI_OBJ = lib/connect.o lib/crc32c.o lib/discovery.o lib/init.o lib/login.o lib/nop.o lib/pdu.o lib/scsi-command.o lib/scsi-lowlevel.o lib/socket.o lib/sync.o INSTALLCMD = /usr/bin/install -c diff --git a/lib/socket.c b/lib/socket.c index 3a3779a..1d72015 100644 --- a/lib/socket.c +++ b/lib/socket.c @@ -14,6 +14,7 @@ You should have received a copy of the GNU Lesser General Public License along with this program; if not, see . */ +#include "config.h" #include #include @@ -98,6 +99,9 @@ iscsi_connect_async(struct iscsi_context *iscsi, const char *portal, return -1; } +#ifdef HAVE_SOCK_SIN_LEN + s.ss_len = socksize; +#endif if (iscsi->fd == -1) { iscsi_set_error(iscsi, "Failed to open iscsi socket. "