Skip to content

Commit

Permalink
fix: exclude udp ports on Windows (#4886)
Browse files Browse the repository at this point in the history
  • Loading branch information
AbelHu authored Aug 30, 2024
1 parent 760935c commit 5fa5e6f
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions staging/cse/windows/configfunc.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,7 @@ function Adjust-DynamicPortRange()
Invoke-Executable -Executable "netsh.exe" -ArgList @("int", "ipv4", "add", "excludedportrange", "udp", "30000", "2768") -ExitCode $global:WINDOWS_CSE_ERROR_SET_UDP_EXCLUDE_PORT_RANGE
} else {
Invoke-Executable -Executable "netsh.exe" -ArgList @("int", "ipv4", "set", "dynamicportrange", "tcp", "33000", "32536") -ExitCode $global:WINDOWS_CSE_ERROR_SET_TCP_DYNAMIC_PORT_RANGE
Invoke-Executable -Executable "netsh.exe" -ArgList @("int", "ipv4", "set", "dynamicportrange", "udp", "33000", "32536") -ExitCode $global:WINDOWS_CSE_ERROR_SET_UDP_DYNAMIC_PORT_RANGE
}
}

Expand Down
2 changes: 1 addition & 1 deletion staging/cse/windows/configfunc.tests.ps1
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ Describe 'Adjust-DynamicPortRange' {
$global:EnableIncreaseDynamicPortRange = $false

Adjust-DynamicPortRange
Assert-MockCalled -CommandName "Invoke-Executable" -Exactly -Times 1
Assert-MockCalled -CommandName "Invoke-Executable" -Exactly -Times 2
}
}
}
Expand Down

0 comments on commit 5fa5e6f

Please sign in to comment.