Hi,

I just tried obexftp with openobex from CVS and found some bugs. I should have 
done that earlier, I suppose.
Two are fixable within openobex (attached), one needs a one-liner patch for 
obexftp:
Add the following line to obexftp/client.c line 522:
   peer.sin_family = AF_INET;

The patch for openobex is attached, please include it.

HS
Index: openobex-anoncvs/lib/inobex.c
===================================================================
--- openobex-anoncvs.orig/lib/inobex.c	2007-05-21 23:50:23.169175443 +0200
+++ openobex-anoncvs/lib/inobex.c	2007-05-21 23:56:44.642957618 +0200
@@ -72,10 +72,10 @@
 		 * see RFC2373 and RFC2553 for details
 		 */
 		out->sin6_addr.s6_addr16[10/2] = 0xFFFF;
-		out->sin6_addr.s6_addr[12] = (in->sin_addr.s_addr >> 24) & 0xFF;
-		out->sin6_addr.s6_addr[13] = (in->sin_addr.s_addr >> 16) & 0xFF;
-		out->sin6_addr.s6_addr[14] = (in->sin_addr.s_addr >>  8) & 0xFF;
-		out->sin6_addr.s6_addr[15] = (in->sin_addr.s_addr >>  0) & 0xFF;
+		out->sin6_addr.s6_addr[12] = (in->sin_addr.s_addr >>  0) & 0xFF;
+		out->sin6_addr.s6_addr[13] = (in->sin_addr.s_addr >>  8) & 0xFF;
+		out->sin6_addr.s6_addr[14] = (in->sin_addr.s_addr >> 16) & 0xFF;
+		out->sin6_addr.s6_addr[15] = (in->sin_addr.s_addr >> 24) & 0xFF;
 		break;
 	}
 }
Index: openobex-anoncvs/lib/obex_transport.c
===================================================================
--- openobex-anoncvs.orig/lib/obex_transport.c	2007-05-21 23:50:44.667697898 +0200
+++ openobex-anoncvs/lib/obex_transport.c	2007-05-21 23:53:13.657458171 +0200
@@ -193,6 +193,13 @@
 		break;
 #endif /*HAVE_IRDA*/
 	case OBEX_TRANS_INET:
+		/* needed as compat for apps that call OBEX_TransportConnect
+		 * instead of InOBEX_TransportConnect (e.g. obexftp)
+		 */
+		if (self->trans.peer.inet6.sin6_family == AF_INET)
+			inobex_prepare_connect(self,
+					       (struct sockaddr*) &self->trans.peer.inet6,
+					       sizeof(self->trans.peer.inet6));
 		ret = inobex_connect_request(self);
 		break;
 	case OBEX_TRANS_CUSTOM:
-------------------------------------------------------------------------
This SF.net email is sponsored by DB2 Express
Download DB2 Express C - the FREE version of DB2 express and take
control of your XML. No limits. Just data. Click to get it now.
http://sourceforge.net/powerbar/db2/
_______________________________________________
Openobex-users mailing list
[email protected]
http://lists.sourceforge.net/lists/listinfo/openobex-users

Reply via email to