[Pkg-privacy-commits] [onioncat] 198/241: port settings corrected

Intrigeri intrigeri at moszumanska.debian.org
Wed Aug 26 16:17:08 UTC 2015


This is an automated email from the git hooks/post-receive script.

intrigeri pushed a commit to branch upstream-master
in repository onioncat.

commit 4df42b8e9d869b551cfc4788d9f1aff287330113
Author: eagle <eagle at 58e1ccc2-750e-0410-8d0d-f93ca75ab447>
Date:   Sat Nov 14 20:00:31 2009 +0000

    port settings corrected
    
    git-svn-id: https://www.cypherpunk.at/svn/onioncat/branches/garlicat@526 58e1ccc2-750e-0410-8d0d-f93ca75ab447
---
 configure          | 22 +++++++++++-----------
 src/ocat.c         |  7 +++----
 src/ocat.h         |  2 +-
 src/ocat_netdesc.h |  2 +-
 src/ocatlibe.c     | 17 ++++++++---------
 src/ocatsetup.c    | 14 +++++++-------
 6 files changed, 31 insertions(+), 33 deletions(-)

diff --git a/configure b/configure
index 0cd06fb..54d805d 100755
--- a/configure
+++ b/configure
@@ -1,6 +1,6 @@
 #! /bin/sh
 # Guess values for system-dependent variables and create Makefiles.
-# Generated by GNU Autoconf 2.62 for onioncat 0.2.0.r525.
+# Generated by GNU Autoconf 2.62 for onioncat 0.2.0.r526.
 #
 # Report bugs to <rahra at cypherpunk.at>.
 #
@@ -596,8 +596,8 @@ SHELL=${CONFIG_SHELL-/bin/sh}
 # Identity of this package.
 PACKAGE_NAME='onioncat'
 PACKAGE_TARNAME='onioncat'
-PACKAGE_VERSION='0.2.0.r525'
-PACKAGE_STRING='onioncat 0.2.0.r525'
+PACKAGE_VERSION='0.2.0.r526'
+PACKAGE_STRING='onioncat 0.2.0.r526'
 PACKAGE_BUGREPORT='rahra at cypherpunk.at'
 
 ac_subst_vars='SHELL
@@ -1259,7 +1259,7 @@ if test "$ac_init_help" = "long"; then
   # Omit some internal or obsolete options to make the list less imposing.
   # This message is too long to be a string in the A/UX 3.1 sh.
   cat <<_ACEOF
-\`configure' configures onioncat 0.2.0.r525 to adapt to many kinds of systems.
+\`configure' configures onioncat 0.2.0.r526 to adapt to many kinds of systems.
 
 Usage: $0 [OPTION]... [VAR=VALUE]...
 
@@ -1329,7 +1329,7 @@ fi
 
 if test -n "$ac_init_help"; then
   case $ac_init_help in
-     short | recursive ) echo "Configuration of onioncat 0.2.0.r525:";;
+     short | recursive ) echo "Configuration of onioncat 0.2.0.r526:";;
    esac
   cat <<\_ACEOF
 
@@ -1421,7 +1421,7 @@ fi
 test -n "$ac_init_help" && exit $ac_status
 if $ac_init_version; then
   cat <<\_ACEOF
-onioncat configure 0.2.0.r525
+onioncat configure 0.2.0.r526
 generated by GNU Autoconf 2.62
 
 Copyright (C) 1992, 1993, 1994, 1995, 1996, 1998, 1999, 2000, 2001,
@@ -1435,7 +1435,7 @@ cat >config.log <<_ACEOF
 This file contains any messages produced by compilers while
 running configure, to aid debugging if configure makes a mistake.
 
-It was created by onioncat $as_me 0.2.0.r525, which was
+It was created by onioncat $as_me 0.2.0.r526, which was
 generated by GNU Autoconf 2.62.  Invocation command line was
 
   $ $0 $@
@@ -2084,7 +2084,7 @@ fi
 
 # Define the identity of the package.
  PACKAGE='onioncat'
- VERSION='0.2.0.r525'
+ VERSION='0.2.0.r526'
 
 
 cat >>confdefs.h <<_ACEOF
@@ -2235,7 +2235,7 @@ ac_config_headers="$ac_config_headers config.h"
 
 
 cat >>confdefs.h <<\_ACEOF
-#define SVN_REVISION "525"
+#define SVN_REVISION "526"
 _ACEOF
 
 
@@ -5208,7 +5208,7 @@ exec 6>&1
 # report actual input values of CONFIG_FILES etc. instead of their
 # values after options handling.
 ac_log="
-This file was extended by onioncat $as_me 0.2.0.r525, which was
+This file was extended by onioncat $as_me 0.2.0.r526, which was
 generated by GNU Autoconf 2.62.  Invocation command line was
 
   CONFIG_FILES    = $CONFIG_FILES
@@ -5261,7 +5261,7 @@ Report bugs to <bug-autoconf at gnu.org>."
 _ACEOF
 cat >>$CONFIG_STATUS <<_ACEOF || ac_write_fail=1
 ac_cs_version="\\
-onioncat config.status 0.2.0.r525
+onioncat config.status 0.2.0.r526
 configured by $0, generated by GNU Autoconf 2.62,
   with options \\"`$as_echo "$ac_configure_args" | sed 's/^ //; s/[\\""\`\$]/\\\\&/g'`\\"
 
diff --git a/src/ocat.c b/src/ocat.c
index cafffe3..4e0a5fc 100644
--- a/src/ocat.c
+++ b/src/ocat.c
@@ -238,8 +238,6 @@ int main(int argc, char *argv[])
    struct passwd *pwd, pwdm;
    int urlconv = 0;
 
-   snprintf(def, 100, "127.0.0.1:%d", NDESC(listen_port));
-
    init_setup();
 
    if (argc < 2)
@@ -282,7 +280,7 @@ int main(int argc, char *argv[])
             break;
 
          case 'l':
-            add_listener(optarg, def);
+            add_listener(optarg);
             break;
 
          case 'L':
@@ -351,6 +349,7 @@ int main(int argc, char *argv[])
    if (!strcmp(argv[0], "gcat") || !strcmp(argv[0], "garlicat"))
       CNF(net_type) = NTYPE_I2P;
 
+   snprintf(def, 100, "127.0.0.1:%d", NDESC(listen_port));
    post_init_setup();
 
    if (!CNF(rand_addr) && !argv[optind])
@@ -450,7 +449,7 @@ int main(int argc, char *argv[])
       background();
 
    if (!CNF(oc_listen))
-      add_listener(def, def);
+      add_listener(def);
 
    // start socket receiver thread
    run_ocat_thread("receiver", socket_receiver, NULL);
diff --git a/src/ocat.h b/src/ocat.h
index 2389631..3118240 100644
--- a/src/ocat.h
+++ b/src/ocat.h
@@ -602,7 +602,7 @@ void oe_close(int);
 int oe_remtr(char *);
 int strsockaddr(const char *, struct sockaddr *);
 void add_local_listeners(void);
-void add_listener(const char *, const char *);
+void add_listener(const char *);
 void delete_listeners(struct sockaddr **, int *, int);
 int fdprintf(int, const char *, va_list);
 
diff --git a/src/ocat_netdesc.h b/src/ocat_netdesc.h
index dc5ca4e..c5f4db0 100644
--- a/src/ocat_netdesc.h
+++ b/src/ocat_netdesc.h
@@ -85,7 +85,7 @@ extern const struct NetDesc netdesc_[2];
 //! Local control port for querying status information.
 #define I2P_OCAT_CTRL_PORT 8067
 //! Virtual destination port for hidden services
-#define I2P_OCAT_DEST_PORT 8060
+#define I2P_OCAT_DEST_PORT I2P_OCAT_LISTEN_PORT
 //! SOCKS port of TOR proxy
 #define I2P_SOCKS_PORT 9051
 
diff --git a/src/ocatlibe.c b/src/ocatlibe.c
index c3e9f72..9b8a099 100644
--- a/src/ocatlibe.c
+++ b/src/ocatlibe.c
@@ -137,8 +137,13 @@ int strsockaddr(const char *src, struct sockaddr *addr)
 }
 
 
-void add_listener(const char *buf, const char *def)
+void add_listener(const char *buf)
 {
+   struct sockaddr_in6 saddr;
+
+   if (strsockaddr(buf, &saddr) == -1)
+      log_msg(LOG_EMERG, "could not convert address string '%s'", buf), exit(1);
+
    CNF(oc_listen_cnt)++;
    log_debug("reallocating sockaddr list to %d elements", CNF(oc_listen_cnt));
    if (!(CNF(oc_listen) = realloc(CNF(oc_listen), sizeof(struct sockaddr*) * CNF(oc_listen_cnt))))
@@ -146,18 +151,12 @@ void add_listener(const char *buf, const char *def)
    if (!(CNF(oc_listen_fd) = realloc(CNF(oc_listen_fd), sizeof(int) * CNF(oc_listen_cnt))))
       log_msg(LOG_ERR, "could not get memory for listener fds: \"%s\"", strerror(errno)), exit(1);
 
-   log_debug("allocating sockaddr mem for \"%s\"", def);
+   log_debug("allocating sockaddr mem for \"%s\"", buf);
    if (!(CNF(oc_listen)[CNF(oc_listen_cnt) - 1] = calloc(1, sizeof(struct sockaddr_in6))))
       log_msg(LOG_ERR, "could not get memory for listener : \"%s\"", strerror(errno)), exit(1);
 
    CNF(oc_listen_fd)[CNF(oc_listen_cnt) - 1] = -1;
-
-   if (def)
-      if (strsockaddr(def, CNF(oc_listen)[CNF(oc_listen_cnt) - 1]) == -1)
-         log_msg(LOG_EMERG, "illegal default string '%s'", def), exit(1);
-
-   if (strsockaddr(buf, CNF(oc_listen)[CNF(oc_listen_cnt) - 1]) == -1)
-      log_msg(LOG_EMERG, "could not convert address string '%s'", buf), exit(1);
+   memcpy(CNF(oc_listen)[CNF(oc_listen_cnt) - 1], &saddr, sizeof(saddr));
 }
 
 
diff --git a/src/ocatsetup.c b/src/ocatsetup.c
index 768cadb..8271bba 100644
--- a/src/ocatsetup.c
+++ b/src/ocatsetup.c
@@ -129,13 +129,6 @@ void init_setup(void)
    //setup_.logf = stderr;
    setup_.uptime = time(NULL);
 
-   setup_.socks_dst->sin_family = AF_INET;
-   setup_.socks_dst->sin_port = htons(TOR_SOCKS_PORT);
-   setup_.socks_dst->sin_addr.s_addr = htonl(INADDR_LOOPBACK);
-#ifdef HAVE_SIN_LEN
-   setup_.socks_dst->sin_len = SOCKADDR_SIZE(setup_.socks_dst);
-#endif
-
 #ifdef DEBUG
    snprintf(setup_.version, VERSION_STRING_LEN, "%s (c) %s -- compiled %s %s", PACKAGE_STRING, OCAT_AUTHOR, __DATE__, __TIME__);
 #else
@@ -151,6 +144,13 @@ void post_init_setup(void)
    setup_.ocat_dest_port = NDESC(vdest_port);
    setup_.ocat_ctrl_port = NDESC(ctrl_port);
 
+   setup_.socks_dst->sin_family = AF_INET;
+   setup_.socks_dst->sin_port = htons(NDESC(socks_port));
+   setup_.socks_dst->sin_addr.s_addr = htonl(INADDR_LOOPBACK);
+#ifdef HAVE_SIN_LEN
+   setup_.socks_dst->sin_len = SOCKADDR_SIZE(setup_.socks_dst);
+#endif
+
    ctrl_listen_.sin_family = AF_INET;
    ctrl_listen_.sin_port = htons(setup_.ocat_ctrl_port);
    ctrl_listen_.sin_addr.s_addr = htonl(INADDR_LOOPBACK);

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-privacy/packages/onioncat.git



More information about the Pkg-privacy-commits mailing list