Skip to content
This repository was archived by the owner on Jan 23, 2023. It is now read-only.

fix parsing for TCP info on Linux - #32816

Merged
wfurt merged 4 commits into
dotnet:masterfrom
wfurt:fix_32727
Oct 16, 2018
Merged

wfurt merged 4 commits into
dotnet:masterfrom
wfurt:fix_32727

Conversation

@wfurt

@wfurt wfurt commented Oct 15, 2018

Copy link
Copy Markdown
Member

related to #32727

With this change GetActiveTcpListeners() returns only socket in LISTENING state and GetActiveTcpConnections() shows all but listeners - as documentation states.

I will add test when I have final fix for #32727.

Listeners
0.0.0.0:139
0.0.0.0:80
0.0.0.0:22
127.0.0.1:6010
127.0.0.1:6011
127.0.0.1:6012
127.0.0.1:6013
0.0.0.0:445
127.0.0.1:6014
0.0.0.0:139
0.0.0.0:80
0.0.0.0:22
127.0.0.1:6010
127.0.0.1:6011
127.0.0.1:6012
127.0.0.1:6013
0.0.0.0:445
127.0.0.1:6014
Active
10.211.55.5:22 = 10.211.55.2:61630 Established
10.211.55.5:22 = 10.211.55.2:50357 Established
10.211.55.5:22 = 10.211.55.2:50356 Established
10.211.55.5:22 = 10.211.55.2:57085 Established
10.211.55.5:22 = 10.211.55.2:60080 Established

@wfurt wfurt added the os-linux Linux OS (any supported distro) label Oct 15, 2018
@wfurt wfurt self-assigned this Oct 15, 2018
@wfurt
wfurt requested a review from a team October 15, 2018 05:18
@wfurt

wfurt commented Oct 15, 2018

Copy link
Copy Markdown
Member Author

@dotnet-bot test Outerloop Windows x64 Debug Build
@dotnet-bot test Outerloop Linux x64 Debug Build
@dotnet-bot test Outerloop OSX x64 Debug Build

string line = v6connections[i];
IPEndPoint endPoint = ParseLocalConnectionInformation(line);
endPoints[index++] = endPoint;
TcpConnectionInformation ti = ParseTcpConnectionInformationFromLine(v4connections[i]);

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

v4connections -> v6connections

@rmkerr rmkerr left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM.

if (ti.State == TcpState.Listen)
{
endPoints[index] = ti.LocalEndPoint;
index ++;

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nit: You have an extra space here and on line 114.

@wfurt

wfurt commented Oct 15, 2018

Copy link
Copy Markdown
Member Author

@dotnet-bot test Outerloop Windows x64 Debug Build
@dotnet-bot test Outerloop Linux x64 Debug Build
@dotnet-bot test Outerloop OSX x64 Debug Build

@wfurt
wfurt merged commit 45bb542 into dotnet:master Oct 16, 2018
@wfurt
wfurt deleted the fix_32727 branch October 16, 2018 02:43
@karelz karelz added this to the 3.0 milestone Nov 15, 2018
picenka21 pushed a commit to picenka21/runtime that referenced this pull request Feb 18, 2022
* fix parsing for TCP info

* use proper v6connections variable

* update failing tests

* remove extra space


Commit migrated from dotnet/corefx@45bb542
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

area-System.Net os-linux Linux OS (any supported distro)

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants