Bugzilla – Attachment 1733 Details for
Bug 1675
SSH over Bluetooth support
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Requests
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
Patch
ssh-bluetooth-getpeername.patch (text/plain), 3.09 KB, created by
David Woodhouse
on 2009-11-24 22:18:34 AEDT
(
hide
)
Description:
Patch
Filename:
MIME Type:
Creator:
David Woodhouse
Created:
2009-11-24 22:18:34 AEDT
Size:
3.09 KB
patch
obsolete
>diff --git a/canohost.c b/canohost.c >index 22b19bb..668f88a 100644 >--- a/canohost.c >+++ b/canohost.c >@@ -20,6 +20,11 @@ > #include <netinet/in.h> > #include <arpa/inet.h> > >+#ifdef HAVE_BLUETOOTH >+#include <bluetooth/bluetooth.h> >+#include <bluetooth/rfcomm.h> >+#endif >+ > #include <ctype.h> > #include <errno.h> > #include <netdb.h> >@@ -60,6 +65,16 @@ get_remote_hostname(int sock, int use_dns) > cleanup_exit(255); > } > >+#ifdef HAVE_BLUETOOTH >+ if (from.ss_family == AF_BLUETOOTH) { >+ struct sockaddr_rc *from_rc = (void *)&from; >+ char ba[28]; >+ >+ sprintf(ba, "Bluetooth:"); >+ ba2str(&from_rc->rc_bdaddr, ba + 10); >+ return xstrdup(ba); >+ } >+#endif > if (from.ss_family == AF_INET) > check_ip_options(sock, ntop); > >@@ -264,6 +279,16 @@ get_socket_address(int sock, int remote, int flags) > return NULL; > } > >+#ifdef HAVE_BLUETOOTH >+ if (addr.ss_family == AF_BLUETOOTH) { >+ struct sockaddr_rc *from_rc = (void *)&addr; >+ char ba[28]; >+ >+ sprintf(ba, "Bluetooth:"); >+ ba2str(&from_rc->rc_bdaddr, ba + 10); >+ return xstrdup(ba); >+ } >+#endif > /* Work around Linux IPv6 weirdness */ > if (addr.ss_family == AF_INET6) > addrlen = sizeof(struct sockaddr_in6); >@@ -375,6 +400,13 @@ get_sock_port(int sock, int local) > } > } > >+#ifdef HAVE_BLUETOOTH >+ if (from.ss_family == AF_BLUETOOTH) { >+ struct sockaddr_rc *from_rc = (void *)&from; >+ >+ return from_rc->rc_channel; >+ } >+#endif > /* Work around Linux IPv6 weirdness */ > if (from.ss_family == AF_INET6) > fromlen = sizeof(struct sockaddr_in6); >diff --git a/configure.ac b/configure.ac >index 0447bd6..ea450eb 100644 >--- a/configure.ac >+++ b/configure.ac >@@ -3636,6 +3636,28 @@ else > fi > AC_SUBST(mansubdir) > >+# Check whether to support Bluetooth >+BLUETOOTH_MSG="no" >+AC_ARG_ENABLE(bluetooth, >+ [ --disable-bluetooth disable Bluetooth support if detected [no]], >+ [ >+ if test "x$enableval" = "xno" ; then >+ disable_bluetooth=yes >+ fi >+ ] >+) >+if test -z "$disable_bluetooth" ; then >+ AC_CHECK_HEADERS(bluetooth/bluetooth.h, >+ [ AC_CHECK_LIB(bluetooth, ba2str, >+ [ LIBS="$LIBS -lbluetooth" >+ AC_DEFINE(HAVE_BLUETOOTH, 1, >+ [Define if you have Bluetooth socket support]) >+ BLUETOOTH_MSG="yes" >+ ]) >+ ] >+ ) >+fi >+ > # Check whether to enable MD5 passwords > MD5_MSG="no" > AC_ARG_WITH(md5-passwords, >@@ -4231,6 +4253,7 @@ echo " S/KEY support: $SKEY_MSG" > echo " TCP Wrappers support: $TCPW_MSG" > echo " MD5 password support: $MD5_MSG" > echo " libedit support: $LIBEDIT_MSG" >+echo " Bluetooth support: $BLUETOOTH_MSG" > echo " Solaris process contract support: $SPC_MSG" > echo " IP address in \$DISPLAY hack: $DISPLAY_HACK_MSG" > echo " Translate v4 in v6 hack: $IPV4_IN6_HACK_MSG" >diff --git a/packet.c b/packet.c >index 994e35b..595a5e3 100644 >--- a/packet.c >+++ b/packet.c >@@ -308,6 +308,10 @@ packet_connection_is_on_socket(void) > return 0; > if (fromlen != tolen || memcmp(&from, &to, fromlen) != 0) > return 0; >+#ifdef HAVE_BLUETOOTH >+ if (from.ss_family == AF_BLUETOOTH) >+ return 1; >+#endif > if (from.ss_family != AF_INET && from.ss_family != AF_INET6) > return 0; > return 1;
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
Attachments on
bug 1675
: 1733