Fix minor bugs with tunnel mode implementation

This change makes sure tunnel mode transforms are properly activated
upon construction, and corrects bugs with how policy selectors were being
generated for tunnel mode policies. Specifically, the source/destination could
not be empty strings, even for cases where an empty selector was desired.

Bug: 72457770
Test: GTS tests run
Change-Id: I9a9f64c34b07883a02a5c996614f958486d214fc
This commit is contained in:
Benedict Wong
2018-01-24 15:31:39 -08:00
parent b559164017
commit 7660370a83
2 changed files with 35 additions and 24 deletions

View File

@@ -462,7 +462,7 @@ public final class IpSecTransform implements AutoCloseable {
mConfig.setMode(MODE_TUNNEL);
mConfig.setSourceAddress(sourceAddress.getHostAddress());
mConfig.setSpiResourceId(spi.getResourceId());
return new IpSecTransform(mContext, mConfig);
return new IpSecTransform(mContext, mConfig).activate();
}
/**