[sip-comm-dev] [Bug 704] [Patch] Native impl for a getLocalHost( destAddr ) method on Windows


#1

Hi all,

Emil and I discuss about the issue 704 (https://sip-communicator.dev.java.net/issues/show_bug.cgi?id=704) this week and I have finish to implement a solution in C with a JNI interface. It supports both IPv4 and IPv6 and it runs fine on Windows Vista. The minimum Windows version is XP SP1 so it will be good if someone can test on XP machine. In attachement you will find the patch and the compiled DLL.

The native part call GestBestInterfaceEx() to find the output interface index for a destination address. Then it call GetAdapaterAddresses() to retrieve all network interfaces and finally we loop on this list to find the interface index and return the corresponding address of the interface. The only issue we see is for multihomed IPv6 interfaces, for this case it will returns the _first_ global address.

List of files/directories added:
- src/net/java/sip/communicator/impl/netaddr/Win32LocalhostRetriever.java
- src/native/windows/
- src/native/windows/LocalhostRetriever/

LocalhostRetriever.dll (41.5 KB)

sip-communicator-win32-localhost-retriever.diff (17 KB)

···

- src/native/windows/LocalhostRetriever/net_java_sip_communicator_impl_netaddr_Win32LocalhostRetriever.c
- src/native/windows/LocalhostRetriever/Makefile
- src/native/windows/LocalhostRetriever/net_java_sip_communicator_impl_netaddr_Win32LocalhostRetriever.h

List of files modified:
- src/net/java/sip/communicator/impl/netaddr/NetworkAddressManagerServiceImpl.java

In getLocalHost method, we test if we run on Windows and we call native Win32LocalhostRetriever.getSourceForDestination method.

I have commented code started with:
if( localHost.isAnyLocalAddress())
{
      logger.trace("Socket returned the AnyLocalAddress. "+
                             "Trying a workaround.");
[...]

as it _seems_ to apply only to Windows, if we are sure this case cannot happen for other OS, we can remove this code.

Last note, DLL has been compiled with Microsoft compiler cl (Visual C++ 2008 Express Edition) as MinGW has not the GetBestInterfaceEx implementation. I am not sure but it may required that Windows users install VC8 runtimes . We can also ship and run it with the installer.

As usual any feedback is very welcome.

Best regards,
--
Sebastien Vincent


#2

Hi,

I'm running WindowsXP SP2 with no visual studio things installed and I confirm that the JNI binary loads and works fine :slight_smile:

Cheers
damencho

Sebastien Vincent wrote:

···

Hi all,

Emil and I discuss about the issue 704 (https://sip-communicator.dev.java.net/issues/show_bug.cgi?id=704) this week and I have finish to implement a solution in C with a JNI interface. It supports both IPv4 and IPv6 and it runs fine on Windows Vista. The minimum Windows version is XP SP1 so it will be good if someone can test on XP machine. In attachement you will find the patch and the compiled DLL.

The native part call GestBestInterfaceEx() to find the output interface index for a destination address. Then it call GetAdapaterAddresses() to retrieve all network interfaces and finally we loop on this list to find the interface index and return the corresponding address of the interface. The only issue we see is for multihomed IPv6 interfaces, for this case it will returns the _first_ global address.

List of files/directories added:
- src/net/java/sip/communicator/impl/netaddr/Win32LocalhostRetriever.java
- src/native/windows/
- src/native/windows/LocalhostRetriever/
- src/native/windows/LocalhostRetriever/net_java_sip_communicator_impl_netaddr_Win32LocalhostRetriever.c

- src/native/windows/LocalhostRetriever/Makefile
- src/native/windows/LocalhostRetriever/net_java_sip_communicator_impl_netaddr_Win32LocalhostRetriever.h

List of files modified:
- src/net/java/sip/communicator/impl/netaddr/NetworkAddressManagerServiceImpl.java

In getLocalHost method, we test if we run on Windows and we call native Win32LocalhostRetriever.getSourceForDestination method.

I have commented code started with:
if( localHost.isAnyLocalAddress())
{
     logger.trace("Socket returned the AnyLocalAddress. "+
                            "Trying a workaround.");
[...]

as it _seems_ to apply only to Windows, if we are sure this case cannot happen for other OS, we can remove this code.

Last note, DLL has been compiled with Microsoft compiler cl (Visual C++ 2008 Express Edition) as MinGW has not the GetBestInterfaceEx implementation. I am not sure but it may required that Windows users install VC8 runtimes . We can also ship and run it with the installer.

As usual any feedback is very welcome.

Best regards,
--
Sebastien Vincent

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#3

Hi again,

committed and ack-ed!

Cheers
damencho

Sebastien Vincent wrote:

···

Hi all,

Emil and I discuss about the issue 704 (https://sip-communicator.dev.java.net/issues/show_bug.cgi?id=704) this week and I have finish to implement a solution in C with a JNI interface. It supports both IPv4 and IPv6 and it runs fine on Windows Vista. The minimum Windows version is XP SP1 so it will be good if someone can test on XP machine. In attachement you will find the patch and the compiled DLL.

The native part call GestBestInterfaceEx() to find the output interface index for a destination address. Then it call GetAdapaterAddresses() to retrieve all network interfaces and finally we loop on this list to find the interface index and return the corresponding address of the interface. The only issue we see is for multihomed IPv6 interfaces, for this case it will returns the _first_ global address.

List of files/directories added:
- src/net/java/sip/communicator/impl/netaddr/Win32LocalhostRetriever.java
- src/native/windows/
- src/native/windows/LocalhostRetriever/
- src/native/windows/LocalhostRetriever/net_java_sip_communicator_impl_netaddr_Win32LocalhostRetriever.c

- src/native/windows/LocalhostRetriever/Makefile
- src/native/windows/LocalhostRetriever/net_java_sip_communicator_impl_netaddr_Win32LocalhostRetriever.h

List of files modified:
- src/net/java/sip/communicator/impl/netaddr/NetworkAddressManagerServiceImpl.java

In getLocalHost method, we test if we run on Windows and we call native Win32LocalhostRetriever.getSourceForDestination method.

I have commented code started with:
if( localHost.isAnyLocalAddress())
{
     logger.trace("Socket returned the AnyLocalAddress. "+
                            "Trying a workaround.");
[...]

as it _seems_ to apply only to Windows, if we are sure this case cannot happen for other OS, we can remove this code.

Last note, DLL has been compiled with Microsoft compiler cl (Visual C++ 2008 Express Edition) as MinGW has not the GetBestInterfaceEx implementation. I am not sure but it may required that Windows users install VC8 runtimes . We can also ship and run it with the installer.

As usual any feedback is very welcome.

Best regards,
--
Sebastien Vincent

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#4

Hi Sebastien,

I see your code is in trunk now but I still have a few notes to share:

- I personally find ASSUME_COMPLETE_JDK dangerous because it can kill
the application if something goes wrong while the failure of this
functionality is hardly critical for us.

- I really don't see why the native code has to call back to the Java
code for InetAddress.getAddress() and InetAddress.getByAddress() when
it could've received the byte[] of InetAddress.getAddress() and
returned the byte[] to later be used in the Java code with
InetAddress.getByAddress(). This makes the native code so much bigger
and, consequently, more error prone.

- I find the do { malloc(ADAPTERS_DEFAULT_SIZE); free; } while
(ERROR_BUFFER_OVERFLOW) strange or rather incorrect. Nothing really
changes there so it seems strange to attempt to iterate again in case
of ERROR_BUFFER_OVERFLOW, it'll just malloc, GetAdaptersAddresses and
free forever. I guess the intent was to have malloc(size).

- It makes it a bit unclear when get_source_for_destination returns
either 0 or -1. Why not use TRUE and FALSE? It's not like there are
various negative results which specify the exact error.

- Though it's not written in the JNI docs, I believe NewByteArray and
GetByteArrayElements will through OutOfMemoryError in the JVM and one
not only doesn't have to explicitly throw it but it's mandatory to
check for returned NULL because it means an exception is pending on
the Java side and the explicit throw only attempts to throw another
exception (if it at all manages to execute FindClass because it's
usually advised to not call JNI functions when an exception is
pending). By the way, you're not checking the return value of
GetByteArrayElements for NULL.

- I wonder about the usefulness of the java/lang/RuntimeException with
"Native call failed". It's not like it's going to say much and one
could just check that the returned value is NULL and still have the
same info without bothering with FindClass, ThrowNew in the native
code.

- If get_source_for_destination() fails, the native code returns with
GetByteArrayElements which doesn't have a matching
ReleaseByteArrayElements.

Regards,
Lubomir

···

On Fri, Oct 23, 2009 at 9:18 AM, Sebastien Vincent <sebastien.vincent@cppextrem.com> wrote:

Hi all,

Emil and I discuss about the issue 704
(https://sip-communicator.dev.java.net/issues/show_bug.cgi?id=704) this week
and I have finish to implement a solution in C with a JNI interface. It
supports both IPv4 and IPv6 and it runs fine on Windows Vista. The minimum
Windows version is XP SP1 so it will be good if someone can test on XP
machine. In attachement you will find the patch and the compiled DLL.

The native part call GestBestInterfaceEx() to find the output interface
index for a destination address. Then it call GetAdapaterAddresses() to
retrieve all network interfaces and finally we loop on this list to find the
interface index and return the corresponding address of the interface. The
only issue we see is for multihomed IPv6 interfaces, for this case it will
returns the _first_ global address.

List of files/directories added:
- src/net/java/sip/communicator/impl/netaddr/Win32LocalhostRetriever.java
- src/native/windows/
- src/native/windows/LocalhostRetriever/
-
src/native/windows/LocalhostRetriever/net_java_sip_communicator_impl_netaddr_Win32LocalhostRetriever.c
- src/native/windows/LocalhostRetriever/Makefile
-
src/native/windows/LocalhostRetriever/net_java_sip_communicator_impl_netaddr_Win32LocalhostRetriever.h

List of files modified:
-
src/net/java/sip/communicator/impl/netaddr/NetworkAddressManagerServiceImpl.java

In getLocalHost method, we test if we run on Windows and we call native
Win32LocalhostRetriever.getSourceForDestination method.

I have commented code started with:
if( localHost.isAnyLocalAddress())
{
logger.trace("Socket returned the AnyLocalAddress. "+
"Trying a workaround.");
[...]

as it _seems_ to apply only to Windows, if we are sure this case cannot
happen for other OS, we can remove this code.

Last note, DLL has been compiled with Microsoft compiler cl (Visual C++ 2008
Express Edition) as MinGW has not the GetBestInterfaceEx implementation. I
am not sure but it may required that Windows users install VC8 runtimes . We
can also ship and run it with the installer.

As usual any feedback is very welcome.

Best regards,
--
Sebastien Vincent

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#5

Hi Lubomir,

Hi Sebastien,

I see your code is in trunk now but I still have a few notes to share:

- I personally find ASSUME_COMPLETE_JDK dangerous because it can kill
the application if something goes wrong while the failure of this
functionality is hardly critical for us.

For a good JDK which required class defined, it should not crash as we just
retrieve jclass and method from existing classes of the JDK.
But like you said it is dangerous that's why I add ASSUME_COMPLETE_JDK
flag.

- I really don't see why the native code has to call back to the Java
code for InetAddress.getAddress() and InetAddress.getByAddress() when
it could've received the byte[] of InetAddress.getAddress() and
returned the byte[] to later be used in the Java code with
InetAddress.getByAddress(). This makes the native code so much bigger
and, consequently, more error prone.

Why not, I will change it.

- I find the do { malloc(ADAPTERS_DEFAULT_SIZE); free; } while
(ERROR_BUFFER_OVERFLOW) strange or rather incorrect. Nothing really
changes there so it seems strange to attempt to iterate again in case
of ERROR_BUFFER_OVERFLOW, it'll just malloc, GetAdaptersAddresses and
free forever. I guess the intent was to have malloc(size).

http://msdn.microsoft.com/en-us/library/aa365915(VS.85).aspx

GetAdapterAddresses returns ERROR_BUFFER_OVERFLOW if size we pass is not
sufficient. So first we allocate 15KB which should be sufficient for most
cases (this is the recommended method, and GetAdapterAddresses could be
time consuming if run several times). So we loop only if we have a lot of
network interfaces. With the loop we are sure to gather _all_ interface
(maybe in several GetAdapterAddresses calls).

- It makes it a bit unclear when get_source_for_destination returns
either 0 or -1. Why not use TRUE and FALSE? It's not like there are
various negative results which specify the exact error.

I have the habits of C system programming (-1 error, 0 success).

- Though it's not written in the JNI docs, I believe NewByteArray and
GetByteArrayElements will through OutOfMemoryError in the JVM and one
not only doesn't have to explicitly throw it but it's mandatory to
check for returned NULL because it means an exception is pending on
the Java side and the explicit throw only attempts to throw another
exception (if it at all manages to execute FindClass because it's
usually advised to not call JNI functions when an exception is
pending). By the way, you're not checking the return value of
GetByteArrayElements for NULL.

OK.

- I wonder about the usefulness of the java/lang/RuntimeException with
"Native call failed". It's not like it's going to say much and one
could just check that the returned value is NULL and still have the
same info without bothering with FindClass, ThrowNew in the native
code.

OK.

- If get_source_for_destination() fails, the native code returns with
GetByteArrayElements which doesn't have a matching
ReleaseByteArrayElements.

Good catch, I will fix it.

Thanks for this comments. I will fix these things.

Another point to consider, as the native code only supports at least XP
SP1, the question is if we support Windows 2000 ? If yes, we can fallback
to original code I comment:
[...]
if( localHost.isAnyLocalAddress())
[...]

Regards,

···

On Fri, 23 Oct 2009 14:27:20 +0300, Lubomir Marinov <lubo@sip-communicator.org> wrote:
--
Sebastien

Regards,
Lubomir

On Fri, Oct 23, 2009 at 9:18 AM, Sebastien Vincent > <sebastien.vincent@cppextrem.com> wrote:

Hi all,

Emil and I discuss about the issue 704
(https://sip-communicator.dev.java.net/issues/show_bug.cgi?id=704) this
week
and I have finish to implement a solution in C with a JNI interface. It
supports both IPv4 and IPv6 and it runs fine on Windows Vista. The
minimum
Windows version is XP SP1 so it will be good if someone can test on XP
machine. In attachement you will find the patch and the compiled DLL.

The native part call GestBestInterfaceEx() to find the output interface
index for a destination address. Then it call GetAdapaterAddresses() to
retrieve all network interfaces and finally we loop on this list to find
the
interface index and return the corresponding address of the interface.
The
only issue we see is for multihomed IPv6 interfaces, for this case it
will
returns the _first_ global address.

List of files/directories added:
-

src/net/java/sip/communicator/impl/netaddr/Win32LocalhostRetriever.java

- src/native/windows/
- src/native/windows/LocalhostRetriever/
-

src/native/windows/LocalhostRetriever/net_java_sip_communicator_impl_netaddr_Win32LocalhostRetriever.c

- src/native/windows/LocalhostRetriever/Makefile
-

src/native/windows/LocalhostRetriever/net_java_sip_communicator_impl_netaddr_Win32LocalhostRetriever.h

List of files modified:
-

src/net/java/sip/communicator/impl/netaddr/NetworkAddressManagerServiceImpl.java

In getLocalHost method, we test if we run on Windows and we call native
Win32LocalhostRetriever.getSourceForDestination method.

I have commented code started with:
if( localHost.isAnyLocalAddress())
{
logger.trace("Socket returned the AnyLocalAddress. "+
"Trying a workaround.");
[...]

as it _seems_ to apply only to Windows, if we are sure this case cannot
happen for other OS, we can remove this code.

Last note, DLL has been compiled with Microsoft compiler cl (Visual C++
2008
Express Edition) as MinGW has not the GetBestInterfaceEx implementation.
I
am not sure but it may required that Windows users install VC8 runtimes

.

We
can also ship and run it with the installer.

As usual any feedback is very welcome.

Best regards,
--
Sebastien Vincent

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#6

- I find the do { malloc(ADAPTERS_DEFAULT_SIZE); free; } while
(ERROR_BUFFER_OVERFLOW) strange or rather incorrect. Nothing really
changes there so it seems strange to attempt to iterate again in case
of ERROR_BUFFER_OVERFLOW, it'll just malloc, GetAdaptersAddresses and
free forever. I guess the intent was to have malloc(size).

http://msdn.microsoft.com/en-us/library/aa365915(VS.85).aspx

GetAdapterAddresses returns ERROR_BUFFER_OVERFLOW if size we pass is not
sufficient. So first we allocate 15KB which should be sufficient for most
cases (this is the recommended method, and GetAdapterAddresses could be
time consuming if run several times). So we loop only if we have a lot of
network interfaces. With the loop we are sure to gather _all_ interface
(maybe in several GetAdapterAddresses calls).

Like I said, the code should be "malloc(size)" instead of
"malloc(ADAPTERS_DEFAULT_SIZE)".

···

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#7

Hi,

Here is a patch against revision 6175. It removes all "throw exception" from JNI code, fix the malloc(ADAPTER_DEFAULT_SIZE) and array checking. I have also set Windows 9x/Me/2000 to not run JNI code (as they don't support some Win32 function used), and do the DatagramSocket.connect stuff instead (like other systems).

Regards,

LocalhostRetriever.dll (41 KB)

sip-communicator-jni.diff (12.9 KB)

···

--
Sebastien

Sebastien Vincent a écrit :

Hi Lubomir,

On Fri, 23 Oct 2009 14:27:20 +0300, Lubomir Marinov > <lubo@sip-communicator.org> wrote:
  

Hi Sebastien,

I see your code is in trunk now but I still have a few notes to share:

- I personally find ASSUME_COMPLETE_JDK dangerous because it can kill
the application if something goes wrong while the failure of this
functionality is hardly critical for us.
    
For a good JDK which required class defined, it should not crash as we just
retrieve jclass and method from existing classes of the JDK.
But like you said it is dangerous that's why I add ASSUME_COMPLETE_JDK
flag.

- I really don't see why the native code has to call back to the Java
code for InetAddress.getAddress() and InetAddress.getByAddress() when
it could've received the byte[] of InetAddress.getAddress() and
returned the byte[] to later be used in the Java code with
InetAddress.getByAddress(). This makes the native code so much bigger
and, consequently, more error prone.
    
Why not, I will change it.

- I find the do { malloc(ADAPTERS_DEFAULT_SIZE); free; } while
(ERROR_BUFFER_OVERFLOW) strange or rather incorrect. Nothing really
changes there so it seems strange to attempt to iterate again in case
of ERROR_BUFFER_OVERFLOW, it'll just malloc, GetAdaptersAddresses and
free forever. I guess the intent was to have malloc(size).

http://msdn.microsoft.com/en-us/library/aa365915(VS.85).aspx

GetAdapterAddresses returns ERROR_BUFFER_OVERFLOW if size we pass is not
sufficient. So first we allocate 15KB which should be sufficient for most
cases (this is the recommended method, and GetAdapterAddresses could be
time consuming if run several times). So we loop only if we have a lot of
network interfaces. With the loop we are sure to gather _all_ interface
(maybe in several GetAdapterAddresses calls).

- It makes it a bit unclear when get_source_for_destination returns
either 0 or -1. Why not use TRUE and FALSE? It's not like there are
various negative results which specify the exact error.
    
I have the habits of C system programming (-1 error, 0 success).

- Though it's not written in the JNI docs, I believe NewByteArray and
GetByteArrayElements will through OutOfMemoryError in the JVM and one
not only doesn't have to explicitly throw it but it's mandatory to
check for returned NULL because it means an exception is pending on
the Java side and the explicit throw only attempts to throw another
exception (if it at all manages to execute FindClass because it's
usually advised to not call JNI functions when an exception is
pending). By the way, you're not checking the return value of
GetByteArrayElements for NULL.
    
OK.

- I wonder about the usefulness of the java/lang/RuntimeException with
"Native call failed". It's not like it's going to say much and one
could just check that the returned value is NULL and still have the
same info without bothering with FindClass, ThrowNew in the native
code.
    
OK.

- If get_source_for_destination() fails, the native code returns with
GetByteArrayElements which doesn't have a matching
ReleaseByteArrayElements.
    
Good catch, I will fix it.

Thanks for this comments. I will fix these things.

Another point to consider, as the native code only supports at least XP
SP1, the question is if we support Windows 2000 ? If yes, we can fallback
to original code I comment: [...]
if( localHost.isAnyLocalAddress())
[...]

Regards,
--
Sebastien

Regards,
Lubomir

On Fri, Oct 23, 2009 at 9:18 AM, Sebastien Vincent >> <sebastien.vincent@cppextrem.com> wrote:
    

Hi all,

Emil and I discuss about the issue 704
(https://sip-communicator.dev.java.net/issues/show_bug.cgi?id=704) this
week
and I have finish to implement a solution in C with a JNI interface. It
supports both IPv4 and IPv6 and it runs fine on Windows Vista. The
minimum
Windows version is XP SP1 so it will be good if someone can test on XP
machine. In attachement you will find the patch and the compiled DLL.

The native part call GestBestInterfaceEx() to find the output interface
index for a destination address. Then it call GetAdapaterAddresses() to
retrieve all network interfaces and finally we loop on this list to find
the
interface index and return the corresponding address of the interface.
The
only issue we see is for multihomed IPv6 interfaces, for this case it
will
returns the _first_ global address.

List of files/directories added:
-
      

src/net/java/sip/communicator/impl/netaddr/Win32LocalhostRetriever.java
  

- src/native/windows/
- src/native/windows/LocalhostRetriever/
-

src/native/windows/LocalhostRetriever/net_java_sip_communicator_impl_netaddr_Win32LocalhostRetriever.c
  

- src/native/windows/LocalhostRetriever/Makefile
-

src/native/windows/LocalhostRetriever/net_java_sip_communicator_impl_netaddr_Win32LocalhostRetriever.h
  

List of files modified:
-

src/net/java/sip/communicator/impl/netaddr/NetworkAddressManagerServiceImpl.java
  

In getLocalHost method, we test if we run on Windows and we call native
Win32LocalhostRetriever.getSourceForDestination method.

I have commented code started with:
if( localHost.isAnyLocalAddress())
{
    logger.trace("Socket returned the AnyLocalAddress. "+
                           "Trying a workaround.");
[...]

as it _seems_ to apply only to Windows, if we are sure this case cannot
happen for other OS, we can remove this code.

Last note, DLL has been compiled with Microsoft compiler cl (Visual C++
2008
Express Edition) as MinGW has not the GetBestInterfaceEx implementation.
I
am not sure but it may required that Windows users install VC8 runtimes
      

.
  

We
can also ship and run it with the installer.

As usual any feedback is very welcome.

Best regards,
--
Sebastien Vincent
      

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net
    
---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net


#8

- I find the do { malloc(ADAPTERS_DEFAULT_SIZE); free; } while
(ERROR_BUFFER_OVERFLOW) strange or rather incorrect. Nothing really
changes there so it seems strange to attempt to iterate again in case
of ERROR_BUFFER_OVERFLOW, it'll just malloc, GetAdaptersAddresses and
free forever. I guess the intent was to have malloc(size).

http://msdn.microsoft.com/en-us/library/aa365915(VS.85).aspx

GetAdapterAddresses returns ERROR_BUFFER_OVERFLOW if size we pass is not
sufficient. So first we allocate 15KB which should be sufficient for

most

cases (this is the recommended method, and GetAdapterAddresses could be
time consuming if run several times). So we loop only if we have a lot

of

network interfaces. With the loop we are sure to gather _all_ interface
(maybe in several GetAdapterAddresses calls).

Like I said, the code should be "malloc(size)" instead of
"malloc(ADAPTERS_DEFAULT_SIZE)".

Oh! I am not awake... thanks.

···

On Fri, 23 Oct 2009 15:23:44 +0300, Lubomir Marinov <lubo@sip-communicator.org> wrote:

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@sip-communicator.dev.java.net
For additional commands, e-mail: dev-help@sip-communicator.dev.java.net