Skip to content

Commit 947f49d

Browse files
committed
Revert "uses of parseInt and parseLong secured"
This reverts commit f8fb422.
1 parent f8fb422 commit 947f49d

4 files changed

Lines changed: 6 additions & 11 deletions

File tree

plugins/network-elements/bigswitch-vns/src/com/cloud/network/guru/BigSwitchVnsGuestNetworkGuru.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -165,8 +165,6 @@ public Network implement(Network network, NetworkOffering offering,
165165
throw new InsufficientVirtualNetworkCapcityException("Unable to allocate vnet as a " +
166166
"part of network " + network + " implement ", DataCenter.class, dcId);
167167
}
168-
// when supporting more types of networks this need to become
169-
// int vlan = Integer.parseInt(BroadcastDomainType.getValue(vnet));
170168
int vlan = Integer.parseInt(vnet);
171169

172170
// Name is either the given name or the uuid

plugins/network-elements/juniper-srx/src/com/cloud/network/resource/JuniperSrxResource.java

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,6 @@
6565
import com.cloud.agent.api.to.PortForwardingRuleTO;
6666
import com.cloud.agent.api.to.StaticNatRuleTO;
6767
import com.cloud.host.Host;
68-
import com.cloud.network.Networks.BroadcastDomainType;
6968
import com.cloud.network.rules.FirewallRule;
7069
import com.cloud.network.rules.FirewallRule.Purpose;
7170
import com.cloud.resource.ServerResource;
@@ -699,7 +698,8 @@ private Answer execute(IpAssocCommand cmd, int numRetries) {
699698
Long publicVlanTag = null;
700699
if (ip.getVlanId() != null && !ip.getVlanId().equals("untagged")) {
701700
try {
702-
publicVlanTag = Long.parseLong(BroadcastDomainType.getValue(ip.getVlanId()));
701+
// TODO BroadcastDomain.getValue(ip.getVlanId) ???
702+
publicVlanTag = Long.parseLong(ip.getVlanId());
703703
} catch (Exception e) {
704704
throw new ExecutionException("Could not parse public VLAN tag: " + ip.getVlanId());
705705
}
@@ -3581,8 +3581,7 @@ private Long getVlanTag(String vlan) throws ExecutionException {
35813581
Long publicVlanTag = null;
35823582
if (!vlan.equals("untagged")) {
35833583
try {
3584-
// make sure this vlan is numeric
3585-
publicVlanTag = Long.parseLong(BroadcastDomainType.getValue(vlan));
3584+
publicVlanTag = Long.parseLong(vlan);
35863585
} catch (Exception e) {
35873586
throw new ExecutionException("Unable to parse VLAN tag: " + vlan);
35883587
}

server/src/com/cloud/network/guru/ExternalGuestNetworkGuru.java

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -143,8 +143,6 @@ public Network implement(Network config, NetworkOffering offering, DeployDestina
143143
UseSystemGuestVlans.valueIn(config.getAccountId()));
144144

145145
try {
146-
// when supporting more types of networks this need to become
147-
// int vlantag = Integer.parseInt(BroadcastDomainType.getValue(vnet));
148146
vlanTag = Integer.parseInt(vnet);
149147
} catch (NumberFormatException e) {
150148
throw new CloudRuntimeException("Obtained an invalid guest vlan tag. Exception: " + e.getMessage());

vmware-base/src/com/cloud/hypervisor/vmware/mo/HypervisorHostHelper.java

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -499,10 +499,10 @@ public static Pair<ManagedObjectReference, String> prepareNetwork(String physica
499499

500500
if(vlanId != null && !UNTAGGED_VLAN_NAME.equalsIgnoreCase(vlanId)) {
501501
createGCTag = true;
502-
vid = Integer.parseInt(BroadcastDomainType.getValue(vlanId));
502+
vid = Integer.parseInt(vlanId);
503503
}
504504
if (secondaryvlanId != null) {
505-
spvlanid = Integer.parseInt(BroadcastDomainType.getValue(secondaryvlanId));
505+
spvlanid = Integer.parseInt(secondaryvlanId);
506506
}
507507
}
508508

@@ -937,7 +937,7 @@ public static Pair<ManagedObjectReference, String> prepareNetwork(String vSwitch
937937

938938
if(vlanId != null && !UNTAGGED_VLAN_NAME.equalsIgnoreCase(vlanId) ) {
939939
createGCTag = true;
940-
vid = Integer.parseInt(BroadcastDomainType.getValue(vlanId));
940+
vid = Integer.parseInt(vlanId);
941941
}
942942
}
943943

0 commit comments

Comments
 (0)