[hamradio-commits] [dump1090] 383/389: More Updates to Pull #54

Matthew Ernisse mernisse-guest at moszumanska.debian.org
Wed Nov 5 00:20:17 UTC 2014


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

mernisse-guest pushed a commit to branch master
in repository dump1090.

commit a9cd75ded18e710b585da948e5b02f3b0f3c57b3
Author: Malcolm Robb <Support at ATTAvionics.com>
Date:   Thu Oct 30 12:06:03 2014 +0000

    More Updates to Pull #54
    
    Pull #54 breaks the Windows version of dump1090 due to a bug in the
    inet_aton() windows function.
    
    1) Fix the bug in the windows inet_aton()
    2) Modify the command line code to strdup() the command line string.
    3) Leave the Modes.net_bind_address pointer NULL if no command line
    specified
---
 dump1090.c | 5 ++---
 dump1090.h | 1 -
 winstubs.h | 2 +-
 3 files changed, 3 insertions(+), 5 deletions(-)

diff --git a/dump1090.c b/dump1090.c
index 664190e..60882fc 100644
--- a/dump1090.c
+++ b/dump1090.c
@@ -76,7 +76,6 @@ void modesInitConfig(void) {
     Modes.net_input_raw_port      = MODES_NET_INPUT_RAW_PORT;
     Modes.net_output_beast_port   = MODES_NET_OUTPUT_BEAST_PORT;
     Modes.net_input_beast_port    = MODES_NET_INPUT_BEAST_PORT;
-    Modes.net_bind_address        = MODES_NET_BIND_ADDRESS;
     Modes.net_http_port           = MODES_NET_HTTP_PORT;
     Modes.interactive_rows        = getTermRows();
     Modes.interactive_delete_ttl  = MODES_INTERACTIVE_DELETE_TTL;
@@ -410,7 +409,7 @@ void showHelp(void) {
 "--modeac                 Enable decoding of SSR Modes 3/A & 3/C\n"
 "--net-beast              TCP raw output in Beast binary format\n"
 "--net-only               Enable just networking, no RTL device or file used\n"
-"--net-bind-address <ip>  IP address to bind to (default: 127.0.0.1; 0.0.0.0 for public)\n"
+"--net-bind-address <ip>  IP address to bind to (default: Any; Use 127.0.0.1 for private)\n"
 "--net-http-port <port>   HTTP server port (default: 8080)\n"
 "--net-ri-port <port>     TCP raw input listen port  (default: 30001)\n"
 "--net-ro-port <port>     TCP raw output listen port (default: 30002)\n"
@@ -719,7 +718,7 @@ int main(int argc, char **argv) {
         } else if (!strcmp(argv[j],"--net-bi-port") && more) {
             Modes.net_input_beast_port = atoi(argv[++j]);
         } else if (!strcmp(argv[j],"--net-bind-address") && more) {
-            Modes.net_bind_address = argv[++j];
+            Modes.net_bind_address = strdup(argv[++j]);
         } else if (!strcmp(argv[j],"--net-http-port") && more) {
             Modes.net_http_port = atoi(argv[++j]);
         } else if (!strcmp(argv[j],"--net-sbs-port") && more) {
diff --git a/dump1090.h b/dump1090.h
index c11bda4..6edb5c5 100644
--- a/dump1090.h
+++ b/dump1090.h
@@ -173,7 +173,6 @@
 #define MODES_NET_OUTPUT_SBS_PORT   30003
 #define MODES_NET_INPUT_BEAST_PORT  30004
 #define MODES_NET_OUTPUT_BEAST_PORT 30005
-#define MODES_NET_BIND_ADDRESS      "0.0.0.0"
 #define MODES_NET_HTTP_PORT          8080
 #define MODES_CLIENT_BUF_SIZE  1024
 #define MODES_NET_SNDBUF_SIZE (1024*64)
diff --git a/winstubs.h b/winstubs.h
index caea01b..f3ab63f 100644
--- a/winstubs.h
+++ b/winstubs.h
@@ -72,7 +72,7 @@ _inline double trunc(double d) {return (d>0) ? floor(d):ceil(d) ;}
 //usleep works in microseconds, and isn't supported in Windows. This will do for our use.
 _inline void usleep(UINT32 ulSleep) {Sleep(ulSleep/1000);} 
 _inline uint64_t strtoll(const char *p, void *e, UINT32 base) {return _atoi64(p);}
-_inline int inet_aton(const char * cp, DWORD * ulAddr) { *ulAddr = inet_addr(cp); return 0;} 
+_inline int inet_aton(const char * cp, DWORD * ulAddr) { *ulAddr = inet_addr(cp); return (INADDR_NONE != *ulAddr);} 
 #define snprintf  _snprintf
 #define vsnprintf _vsnprintf
 #define realpath(N,R) _fullpath((R),(N),_MAX_PATH)

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-hamradio/dump1090.git



More information about the pkg-hamradio-commits mailing list