cortex-debug icon indicating copy to clipboard operation
cortex-debug copied to clipboard

Force tcl connection to IPv4

Open Slamy opened this issue 1 year ago • 2 comments

I first looked for https://github.com/Marus/cortex-debug/issues/959 to find a solution but in the end I compiled this project from source to find the root cause. After updating on the latest Debian testing, the Rtt connection no longer worked. I wondered why. As it seems, OpenOCD doesn't listen on IPv6 sockets for tcl connection. Changing to IPv4 allowed to me to continue. This might not be the ideal solution. I'm creating this PR to at least provide information about this problem.

I don't know why this even started but localhost is resolved to ::1 on my system and not 127.0.0.1 as it was for a long time now. Maybe other applications are suffering with this change I imagine and it will be rolled back...

telnet solved this by first trying ::1 and then retrying with 127.0.0.1 if a connection to localhost shall be established.

Slamy avatar Feb 07 '24 19:02 Slamy

I have to review the impact of this across all OSes. We have hundreds of thousands of users and there could be a fierce blowback. But I am busy for the next month.

Not many support IPv6. Question is, why is your Debian configured for IPv6 for your local network? Was this your choice? Or the default?

Windows for example will support both IPv6 and IPv4 and localhost still resolves to IPv4.

Also, why not address this with OpenOCD?

haneefdm avatar Feb 07 '24 19:02 haneefdm

Alright. I've found the culprit. https://sourceforge.net/p/openocd/tickets/424/

Please leave this PR open for now as some sort of guidance for fellow developers who might stumble onto this problem. If OpenOCD solves this, I'll provide you with feedback.

Slamy avatar Feb 07 '24 21:02 Slamy

A similar PR has already been merged, Yes, this is openocd-specific

haneefdm avatar Jun 17 '24 11:06 haneefdm