Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Skip to content
Snippets Groups Projects
Commit a288f21a authored by Di Lu's avatar Di Lu Committed by android-build-merger
Browse files

Merge "Remove return value of ipSecAddSecurityAssociation" am: cd5c1161 am:...

Merge "Remove return value of ipSecAddSecurityAssociation" am: cd5c1161 am: 38e72983 am: c554c2c1
am: 197aaf0a

Change-Id: I77f2e8be5a3ce9fe1c8c49b2530a8955abf5b0cc
parents 4cbefd0a 197aaf0a
Branches
No related tags found
No related merge requests found
...@@ -605,38 +605,33 @@ public class IpSecService extends IIpSecService.Stub { ...@@ -605,38 +605,33 @@ 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, c.getMode(),
c.getMode(), direction,
direction, (c.getLocalAddress() != null)
(c.getLocalAddress() != null) ? c.getLocalAddress().getHostAddress()
? c.getLocalAddress().getHostAddress() : "",
: "", (c.getRemoteAddress() != null)
(c.getRemoteAddress() != null) ? c.getRemoteAddress().getHostAddress()
? c.getRemoteAddress().getHostAddress() : "",
: "", (c.getNetwork() != null)
(c.getNetwork() != null) ? c.getNetwork().getNetworkHandle()
? c.getNetwork().getNetworkHandle() : 0,
: 0, spi,
spi, (auth != null) ? auth.getName() : "",
(auth != null) ? auth.getName() : "", (auth != null) ? auth.getKey() : null,
(auth != null) ? auth.getKey() : null, (auth != null) ? auth.getTruncationLengthBits() : 0,
(auth != null) ? auth.getTruncationLengthBits() : 0, (crypt != null) ? crypt.getName() : "",
(crypt != null) ? crypt.getName() : "", (crypt != null) ? crypt.getKey() : null,
(crypt != null) ? crypt.getKey() : null, (crypt != null) ? crypt.getTruncationLengthBits() : 0,
(crypt != null) ? crypt.getTruncationLengthBits() : 0, 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
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment