Merge "Remove return value of ipSecAddSecurityAssociation" am: 36acf01d58 am: 84aa41dae2

am: c554c2c1cb

Change-Id: I94e533d415e0afdbd4be72536ec667513a32f025
This commit is contained in:
Di Lu
2017-07-12 04:13:52 +00:00
committed by android-build-merger

View File

@@ -605,7 +605,6 @@ public class IpSecService extends IIpSecService.Stub {
spis[direction] = mSpiRecords.get(c.getSpiResourceId(direction)); spis[direction] = mSpiRecords.get(c.getSpiResourceId(direction));
int spi = spis[direction].getSpi(); int spi = spis[direction].getSpi();
try { try {
int result =
getNetdInstance() getNetdInstance()
.ipSecAddSecurityAssociation( .ipSecAddSecurityAssociation(
resourceId, resourceId,
@@ -630,13 +629,9 @@ public class IpSecService extends IIpSecService.Stub {
encapType, encapType,
encapLocalPort, encapLocalPort,
encapRemotePort); encapRemotePort);
if (result != spi) {
// TODO: cleanup the first SA if creation of second SA fails
return new IpSecTransformResponse(
IpSecManager.Status.SPI_UNAVAILABLE, INVALID_RESOURCE_ID);
}
} catch (ServiceSpecificException e) { } catch (ServiceSpecificException e) {
// FIXME: get the error code and throw is at an IOException from Errno Exception // FIXME: get the error code and throw is at an IOException from Errno Exception
return new IpSecTransformResponse(IpSecManager.Status.RESOURCE_UNAVAILABLE);
} }
} }
// Both SAs were created successfully, time to construct a record and lock it away // Both SAs were created successfully, time to construct a record and lock it away