builder.setSession("MyVPNService");
builder.addAddress(deviceIp, 24);
builder.addDnsServer(dnsIp)
.addDnsServer(dns2Ip)
.allowFamily(OsConstants.AF_INET);
builder.addDnsServer(ssd)
.allowFamily(OsConstants.AF_INET6)
.establish();
我正在构建这样的界面。ssd 是“2400:cb00:f00d:dead:beef:1111:2222:3333” 当代码通过这一行时,它会引发异常。(如果我推荐 ipv6addDnsServer 行,它工作得很好)
FileInputStream in = new FileInputStream(mInterface.getFileDescriptor());
*java.lang.NullPointerException: Attempt to invoke virtual method 'java.io.FileDescriptor android.os.ParcelFileDescriptor.getFileDescriptor()' on a null object reference