Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
[SOLVED] GStack.LocalAddress returns empty
#3
The following patch was applied:


Code:
Index: Core/IdCompilerDefines.inc
===================================================================
--- Core/IdCompilerDefines.inc    (revision 5478)
+++ Core/IdCompilerDefines.inc    (working copy)
@@ -1490,6 +1490,10 @@
   {$DEFINE HAS_getifaddrs}
 {$ENDIF}
 
+{$IFDEF LINUX}
+  {$DEFINE HAS_getifaddrs}
+{$ENDIF}
+
 {$IFDEF IOS}
   {$DEFINE HAS_getifaddrs}
   {$DEFINE USE_OPENSSL}
@@ -1866,4 +1870,4 @@
 // indexing for now...
 {$IFDEF HAS_DIRECTIVE_ZEROBASEDSTRINGS}
   {$ZEROBASEDSTRINGS OFF}
-{$ENDIF}
\ No newline at end of file
+{$ENDIF}
Index: FCL/IdCompilerDefines.inc
===================================================================
--- FCL/IdCompilerDefines.inc    (revision 5478)
+++ FCL/IdCompilerDefines.inc    (working copy)
@@ -1490,6 +1490,10 @@
   {$DEFINE HAS_getifaddrs}
 {$ENDIF}
 
+{$IFDEF LINUX}
+  {$DEFINE HAS_getifaddrs}
+{$ENDIF}
+
 {$IFDEF IOS}
   {$DEFINE HAS_getifaddrs}
   {$DEFINE USE_OPENSSL}
@@ -1866,4 +1870,4 @@
 // indexing for now...
 {$IFDEF HAS_DIRECTIVE_ZEROBASEDSTRINGS}
   {$ZEROBASEDSTRINGS OFF}
-{$ENDIF}
\ No newline at end of file
+{$ENDIF}
Index: Protocols/IdCompilerDefines.inc
===================================================================
--- Protocols/IdCompilerDefines.inc    (revision 5478)
+++ Protocols/IdCompilerDefines.inc    (working copy)
@@ -1490,6 +1490,10 @@
   {$DEFINE HAS_getifaddrs}
 {$ENDIF}
 
+{$IFDEF LINUX}
+  {$DEFINE HAS_getifaddrs}
+{$ENDIF}
+
 {$IFDEF IOS}
   {$DEFINE HAS_getifaddrs}
   {$DEFINE USE_OPENSSL}
@@ -1866,4 +1870,4 @@
 // indexing for now...
 {$IFDEF HAS_DIRECTIVE_ZEROBASEDSTRINGS}
   {$ZEROBASEDSTRINGS OFF}
-{$ENDIF}
\ No newline at end of file
+{$ENDIF}
Index: System/IdCompilerDefines.inc

===================================================================
--- System/IdCompilerDefines.inc    (revision 5478)
+++ System/IdCompilerDefines.inc    (working copy)
@@ -1490,6 +1490,10 @@
   {$DEFINE HAS_getifaddrs}
 {$ENDIF}
 
+{$IFDEF LINUX}
+  {$DEFINE HAS_getifaddrs}
+{$ENDIF}
+
 {$IFDEF IOS}
   {$DEFINE HAS_getifaddrs}
   {$DEFINE USE_OPENSSL}
@@ -1866,4 +1870,4 @@
 // indexing for now...
 {$IFDEF HAS_DIRECTIVE_ZEROBASEDSTRINGS}
   {$ZEROBASEDSTRINGS OFF}
-{$ENDIF}
\ No newline at end of file
+{$ENDIF}


GStack.GetLocalAddressList returned empty anyway, before and after patch applied. But the deprecated method GStack.LocalAddresses returned the right IPv4 address after patch. Tested with two network interfaces, GStack.LocalAddresses returned the right two IPv4 addresses.  


And about IPv6 addresses, how to get them?
Reply


Messages In This Thread
RE: GStack.LocalAddress returns empty - by capslock - 11-06-2018, 04:58 AM

Forum Jump:


Users browsing this thread: 1 Guest(s)