Some Eclipse Foundation services are deprecated, or will be soon. Please ensure you've read this important communication.

Bug 319231

Summary: Autodiscovery of TCF agents no longer works after upgrading from 0.2.0 to 0.3.0
Product: [Tools] TCF Reporter: Franz Polzer <franz_polzer>
Component: CoreAssignee: Project Inbox <dsdp.tm.tcf-inbox>
Status: RESOLVED FIXED QA Contact: Martin Oberhuber <mober.at+eclipse>
Severity: major    
Priority: P3 CC: cdtdoug, eugene
Version: unspecified   
Target Milestone: 0.4.0   
Hardware: PC   
OS: Windows Vista   
Whiteboard:

Description Franz Polzer CLA 2010-07-08 04:37:19 EDT
Build Identifier: M20090917-0800

I have used TCF (0.2.0) for an own agent and the auto-discovery worked fine. Now I have upgraded to TCF (0.3.0) and the auto-discovery stopped working.

The agent is unchanged (because already delivered).

Is there an incompatibility between these version of TCF? Can older agent no longer be used with the new version of TCF?

Reproducible: Always

Steps to Reproduce:
Upgrade from TCF 0.2.0 to TCF 0.3.0
Try to use the auto-discovery feature
Comment 1 Eugene Tarassov CLA 2010-07-08 15:28:02 EDT
I cannot reproduce the problem using latest Java code and 0.2.0 agent on Windows.
Everything seems to work fine.

The problem might be caused by bug 318260:
https://bugs.eclipse.org/bugs/show_bug.cgi?id=318260
which was fixed after tag 0.3.0 was created.

Could you try the latest Java code to see if the problem will go away?
Comment 2 Franz Polzer CLA 2010-07-09 03:48:04 EDT
I have tried with the latest code and the problem still exists.

The problem seems to be in the routine that tries to get the network address from the IP-config.

The line

InetAddress addr = map.get(s.substring(n + 3));

in the method

private void getWindowsSubNetList(HashSet<SubNet> set) throws Exception {

fails because at my machine the returned address line from the IPCONFIG output is:

"IPv4-Adresse  . . . . . . . . . . : 192.168.1.1(Bevorzugt)"

so s.substring(n + 3) returns

"192.168.1.1(Bevorzugt)"

which is not found in the map of enumerated IP addresses.

I think parsing IP addresses this way is very error-prone because the returned string is language-dependend.

When I completely remove the windows specific part and use the generic enumeration part (with disabled IPv6 on my machine) auto-discovery works fine.

I also tried changing the parsing algorithm to only take an IP-number like text:

            
            String address = s.substring(n + 3);
            String address2 = "";
            for (int i = 0; i < address.length(); i++) {
               char ch = address.charAt(i);
               if (!((ch >= '0' && ch <= '9') || ch == '.'))
                    break;
               address2 += ch;
            }
            InetAddress addr = map.get(address2);
            
and this also works fine.
Comment 3 Eugene Tarassov CLA 2010-07-09 15:51:11 EDT
After some digging on the net I found that ipconfig on Vista sometimes shows DHCP status after an IP address, a word like Preferred/Deprecated/Invalid. I have committed a fix that only takes an IP-number-like part of the string, as you suggested.

Thanks!
Comment 4 Doug Schaefer CLA 2011-05-17 10:49:15 EDT
Moving bugs to new home for IP log.
Comment 5 Martin Oberhuber CLA 2013-06-05 06:26:39 EDT
Bulk change: Marking all bugs from the TM era (until June 2011) target 0.3