View | Details | Raw Unified | Return to bug 196397 | Differences between
and this patch

Collapse All | Expand All

(-)files/patch-invalidcast (-84 lines)
Lines 1-84 Link Here
1
--- src/istgt_iscsi.c.orig	2012-10-28 00:26:36.000000000 +0200
2
+++ src/istgt_iscsi.c	2013-06-26 00:44:07.000000000 +0200
3
@@ -670,16 +670,16 @@
4
 	if (rc < 0) {
5
 		now = time(NULL);
6
 		if (errno == ECONNRESET) {
7
-			ISTGT_WARNLOG("Connection reset by peer (%s,time=%d)\n",
8
-			    conn->initiator_name, (int)difftime(now, start));
9
+			ISTGT_WARNLOG("Connection reset by peer (%s,time=%.0f)\n",
10
+			    conn->initiator_name, difftime(now, start));
11
 			conn->state = CONN_STATE_EXITING;
12
 		} else if (errno == ETIMEDOUT) {
13
-			ISTGT_WARNLOG("Operation timed out (%s,time=%d)\n",
14
-			    conn->initiator_name, (int)difftime(now, start));
15
+			ISTGT_WARNLOG("Operation timed out (%s,time=%.0f)\n",
16
+			    conn->initiator_name, difftime(now, start));
17
 			conn->state = CONN_STATE_EXITING;
18
 		} else {
19
-			ISTGT_ERRLOG("iscsi_read() failed (errno=%d,%s,time=%d)\n",
20
-			    errno, conn->initiator_name, (int)difftime(now, start));
21
+			ISTGT_ERRLOG("iscsi_read() failed (errno=%d,%s,time=%.0f)\n",
22
+			    errno, conn->initiator_name, difftime(now, start));
23
 		}
24
 		return -1;
25
 	}
26
@@ -762,8 +762,8 @@
27
 		rc = readv(conn->sock, &iovec[0], 4);
28
 		if (rc < 0) {
29
 			now = time(NULL);
30
-			ISTGT_ERRLOG("readv() failed (%d,errno=%d,%s,time=%d)\n",
31
-			    rc, errno, conn->initiator_name, (int)difftime(now, start));
32
+			ISTGT_ERRLOG("readv() failed (%d,errno=%d,%s,time=%.0f)\n",
33
+			    rc, errno, conn->initiator_name, difftime(now, start));
34
 			return -1;
35
 		}
36
 		if (rc == 0) {
37
@@ -1257,8 +1257,8 @@
38
 		rc = writev(conn->sock, &iovec[0], 5);
39
 		if (rc < 0) {
40
 			now = time(NULL);
41
-			ISTGT_ERRLOG("writev() failed (errno=%d,%s,time=%d)\n",
42
-			    errno, conn->initiator_name, (int)difftime(now, start));
43
+			ISTGT_ERRLOG("writev() failed (errno=%d,%s,time=%.0f)\n",
44
+			    errno, conn->initiator_name, difftime(now, start));
45
 			return -1;
46
 		}
47
 		nbytes -= rc;
48
@@ -3590,9 +3590,9 @@
49
 				if (rc < 0) {
50
 					now = time(NULL);
51
 					ISTGT_ERRLOG("MCS: CmdSN(%u) error ExpCmdSN=%u "
52
-					    "(time=%d)\n",
53
+					    "(time=%.0f)\n",
54
 					    CmdSN, conn->sess->ExpCmdSN,
55
-					    (int)difftime(now, start));
56
+					    difftime(now, start));
57
 					SESS_MTX_UNLOCK(conn);
58
 					return -1;
59
 				}
60
--- src/istgt_lu_disk.c.orig	2012-10-28 00:26:36.000000000 +0200
61
+++ src/istgt_lu_disk.c	2013-06-26 00:44:05.000000000 +0200
62
@@ -5288,9 +5288,9 @@
63
 						MTX_UNLOCK(&lu_task->trans_mutex);
64
 						now = time(NULL);
65
 						ISTGT_ERRLOG("timeout trans_cond CmdSN=%u "
66
-						    "(time=%d)\n",
67
+						    "(time=%.0f)\n",
68
 						    lu_task->lu_cmd.CmdSN,
69
-						    (int)difftime(now, start));
70
+						    difftime(now, start));
71
 						/* timeout */
72
 						return -1;
73
 					}
74
@@ -5326,8 +5326,8 @@
75
 				if (rc == ETIMEDOUT) {
76
 					lu_task->error = 1;
77
 					now = time(NULL);
78
-					ISTGT_ERRLOG("timeout trans_cond CmdSN=%u (time=%d)\n",
79
-					    lu_task->lu_cmd.CmdSN, (int)difftime(now, start));
80
+					ISTGT_ERRLOG("timeout trans_cond CmdSN=%u (time=%.0f)\n",
81
+					    lu_task->lu_cmd.CmdSN, difftime(now, start));
82
 					return -1;
83
 				}
84
 				lu_task->error = 1;
(-)files/patch-replacecrypto (-149 lines)
Lines 1-149 Link Here
1
--- src/config.h.in.orig	2012-08-19 06:51:15.000000000 +0200
2
+++ src/config.h.in	2013-06-26 01:30:15.000000000 +0200
3
@@ -54,8 +54,8 @@
4
 /* Define to 1 if you have the `cam' library (-lcam). */
5
 #undef HAVE_LIBCAM
6
 
7
-/* Define to 1 if you have the `crypto' library (-lcrypto). */
8
-#undef HAVE_LIBCRYPTO
9
+/* Define to 1 if you have the `md' library (-lmd). */
10
+#undef HAVE_LIBMD
11
 
12
 /* Define to 1 if you have the `pthread' library (-lpthread). */
13
 #undef HAVE_LIBPTHREAD
14
--- src/istgt_md5.c.orig	2010-01-02 18:57:26.000000000 +0100
15
+++ src/istgt_md5.c	2013-06-26 01:35:24.000000000 +0200
16
@@ -33,7 +33,8 @@
17
 #include <stdint.h>
18
 
19
 #include <stddef.h>
20
-#include <openssl/md5.h>
21
+#include <sys/types.h>
22
+#include <md5.h>
23
 
24
 #include "istgt.h"
25
 #include "istgt_md5.h"
26
@@ -41,34 +42,28 @@
27
 int
28
 istgt_md5init(ISTGT_MD5CTX *md5ctx)
29
 {
30
-	int rc;
31
-
32
 	if (md5ctx == NULL)
33
 		return -1;
34
-	rc = MD5_Init(&md5ctx->md5ctx);
35
-	return rc;
36
+	MD5Init(&md5ctx->md5ctx);
37
+	return 1;
38
 }
39
 
40
 int
41
 istgt_md5final(void *md5, ISTGT_MD5CTX *md5ctx)
42
 {
43
-	int rc;
44
-
45
 	if (md5ctx == NULL || md5 == NULL)
46
 		return -1;
47
-	rc = MD5_Final(md5, &md5ctx->md5ctx);
48
-	return rc;
49
+	MD5Final(md5, &md5ctx->md5ctx);
50
+	return 1;
51
 }
52
 
53
 int
54
 istgt_md5update(ISTGT_MD5CTX *md5ctx, const void *data, size_t len)
55
 {
56
-	int rc;
57
-
58
 	if (md5ctx == NULL)
59
 		return -1;
60
 	if (data == NULL || len <= 0)
61
 		return 0;
62
-	rc = MD5_Update(&md5ctx->md5ctx, data, len);
63
-	return rc;
64
+	MD5Update(&md5ctx->md5ctx, data, len);
65
+	return 1;
66
 }
67
--- src/istgt_md5.h.orig	2010-01-02 18:57:26.000000000 +0100
68
+++ src/istgt_md5.h	2013-06-26 01:20:46.000000000 +0200
69
@@ -30,7 +30,8 @@
70
 
71
 #include <stddef.h>
72
 
73
-#include <openssl/md5.h>
74
+#include <sys/types.h>
75
+#include <md5.h>
76
 
77
 #define ISTGT_MD5DIGEST_LEN MD5_DIGEST_LENGTH
78
 
79
--- configure.orig	2012-08-24 10:19:24 UTC
80
+++ configure
81
@@ -3403,7 +3403,7 @@ $as_echo "#define _GNU_SOURCE 1" >>confd
82
 	rcdir='/etc/rc.d'
83
 
84
 	;;
85
-*freebsd*)
86
+*dragonfly*|*freebsd*)
87
 	tmp="/usr/ports/emulators/virtualbox-ose/work/*/include"
88
 	if test -d "`echo $tmp`"; then
89
 	    vboxinc=$tmp
90
@@ -3472,13 +3472,13 @@ _ACEOF
91
 
92
 fi
93
 
94
-{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MD5_Update in -lcrypto" >&5
95
-$as_echo_n "checking for MD5_Update in -lcrypto... " >&6; }
96
-if ${ac_cv_lib_crypto_MD5_Update+:} false; then :
97
+{ $as_echo "$as_me:${as_lineno-$LINENO}: checking for MD5Update in -lmd" >&5
98
+$as_echo_n "checking for MD5Update in -lmd... " >&6; }
99
+if ${ac_cv_lib_crypto_MD5Update+:} false; then :
100
   $as_echo_n "(cached) " >&6
101
 else
102
   ac_check_lib_save_LIBS=$LIBS
103
-LIBS="-lcrypto  $LIBS"
104
+LIBS="-lmd $LIBS"
105
 cat confdefs.h - <<_ACEOF >conftest.$ac_ext
106
 /* end confdefs.h.  */
107
 
108
@@ -3488,32 +3488,32 @@ cat confdefs.h - <<_ACEOF >conftest.$ac_
109
 #ifdef __cplusplus
110
 extern "C"
111
 #endif
112
-char MD5_Update ();
113
+char MD5Update ();
114
 int
115
 main ()
116
 {
117
-return MD5_Update ();
118
+return MD5Update ();
119
   ;
120
   return 0;
121
 }
122
 _ACEOF
123
 if ac_fn_c_try_link "$LINENO"; then :
124
-  ac_cv_lib_crypto_MD5_Update=yes
125
+  ac_cv_lib_crypto_MD5Update=yes
126
 else
127
-  ac_cv_lib_crypto_MD5_Update=no
128
+  ac_cv_lib_crypto_MD5Update=no
129
 fi
130
 rm -f core conftest.err conftest.$ac_objext \
131
     conftest$ac_exeext conftest.$ac_ext
132
 LIBS=$ac_check_lib_save_LIBS
133
 fi
134
-{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_MD5_Update" >&5
135
-$as_echo "$ac_cv_lib_crypto_MD5_Update" >&6; }
136
-if test "x$ac_cv_lib_crypto_MD5_Update" = xyes; then :
137
+{ $as_echo "$as_me:${as_lineno-$LINENO}: result: $ac_cv_lib_crypto_MD5Update" >&5
138
+$as_echo "$ac_cv_lib_crypto_MD5Update" >&6; }
139
+if test "x$ac_cv_lib_crypto_MD5Update" = xyes; then :
140
   cat >>confdefs.h <<_ACEOF
141
-#define HAVE_LIBCRYPTO 1
142
+#define HAVE_LIBMD 1
143
 _ACEOF
144
 
145
-  LIBS="-lcrypto $LIBS"
146
+  LIBS="-lmd $LIBS"
147
 
148
 fi
149
 
(-)files/patch-src_Makefile.in (-13 lines)
Lines 1-13 Link Here
1
--- src/Makefile.in.orig	2012-10-15 21:40:18.000000000 +0000
2
+++ src/Makefile.in
3
@@ -88,8 +88,8 @@ istgtcontrol: $(ISTGTCONTROL)
4
 	$(CC) $(LDFLAGS) -o $@ $(ISTGTCONTROL) $(LIBS)
5
 
6
 install: install-dirs
7
-	$(INSTALL) -m 0755 istgt $(DESTDIR)$(bindir)
8
-	$(INSTALL) -m 0755 istgtcontrol $(DESTDIR)$(bindir)
9
+	$(BSD_INSTALL_PROGRAM) istgt $(DESTDIR)$(bindir)
10
+	$(BSD_INSTALL_PROGRAM) istgtcontrol $(DESTDIR)$(bindir)
11
 
12
 install-dirs:
13
 	$(MKDIR_P) $(DESTDIR)$(bindir)

Return to bug 196397