Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1492,7 +1492,7 @@ function Test-AzureFirewallPolicyPrivateRangeCRUD {
$location = "westus2"
$vnetName = Get-ResourceName
$privateRange2 = @("IANAPrivateRanges", "0.0.0.0/0", "66.92.0.0/16")
$privateRange1 = @("3.3.0.0/24", "98.0.0.0/8")
$privateRange1 = @("3.3.0.0/24", "98.0.0.0/8","10.227.16.0/20")
Copy link
Contributor

Choose a reason for hiding this comment

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

The value of $privateRange1 changes, these two test cases need to re-record.

Copy link
Contributor Author

Choose a reason for hiding this comment

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

@BethanyZhou updated session records.

$privateRange2Translated = @("0.0.0.0/0", "66.92.0.0/16", "10.0.0.0/8", "172.16.0.0/12", "192.168.0.0/16", "100.64.0.0/10")

try {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -1350,7 +1350,7 @@ function Test-AzureFirewallPrivateRangeCRUD {
$publicIpName = Get-ResourceName

$privateRange1 = @("IANAPrivateRanges", "0.0.0.0/0", "66.92.0.0/16")
$privateRange2 = @("3.3.0.0/24", "98.0.0.0/8")
$privateRange2 = @("3.3.0.0/24", "98.0.0.0/8","10.227.16.0/20","10.226.0.0/16")

try {
# Create the resource group
Expand Down

Large diffs are not rendered by default.

Large diffs are not rendered by default.

1 change: 1 addition & 0 deletions src/Network/Network/ChangeLog.md
Original file line number Diff line number Diff line change
Expand Up @@ -19,6 +19,7 @@
--->

## Upcoming Release
* Fixed bug that causes an overflow due to incorrect SNAT private ranges IP validation.
* Added new cmdlets to create/manage L4(TCP/TLS) objects for ApplicationGateway:
- `Get-AzApplicationGatewayListener`
- `New-AzApplicationGatewayListener`
Expand Down
4 changes: 2 additions & 2 deletions src/Network/Network/Models/AzureFirewall/PSAzureFirewall.cs
Original file line number Diff line number Diff line change
Expand Up @@ -452,8 +452,8 @@ private void ValidateMaskedIpAddress(string ipAddress)

// validated that unmasked bits are 0
var splittedIp = split[0].Split('.');
var ip = Int32.Parse(splittedIp[0]) << 24;
ip = ip + Int32.Parse(splittedIp[1]) << 16 + Int32.Parse(splittedIp[2]) << 8 + Int32.Parse(splittedIp[3]);
var ip = Int32.Parse(splittedIp[0]) << 24;
ip += (Int32.Parse(splittedIp[1]) << 16) + (Int32.Parse(splittedIp[2]) << 8) + Int32.Parse(splittedIp[3]);
if (ip << bit != 0)
throw new PSArgumentException(String.Format("\'{0}\' is not a valid private range ip address, bits not covered by subnet mask should be all 0", ipAddress));
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -117,7 +117,7 @@ private void ValidateMaskedIpAddress(string ipAddress)
// validated that unmasked bits are 0
var splittedIp = split[0].Split('.');
var ip = Int32.Parse(splittedIp[0]) << 24;
ip = ip + Int32.Parse(splittedIp[1]) << 16 + Int32.Parse(splittedIp[2]) << 8 + Int32.Parse(splittedIp[3]);
ip += (Int32.Parse(splittedIp[1]) << 16) + (Int32.Parse(splittedIp[2]) << 8) + Int32.Parse(splittedIp[3]);
if (ip << bit != 0)
throw new AzPSArgumentException(String.Format(Resources.InvalidPrivateIPRangeUnmaskedBits, ipAddress), nameof(ipAddress), ErrorKind.UserError);
}
Expand Down