Remove libnetd_resolv dependency on Fwmark
This change help reduce the libnetd_resolv dependency on non-updatable
code.
Bug: 113628807
Test: system/netd/tests/runtests.sh passed
Change-Id: I70b5336f00e5e9b506a76a3a68f5f149c78a89af
diff --git a/resolv/DnsTlsTransport.cpp b/resolv/DnsTlsTransport.cpp
index b4294e2..b1e9205 100644
--- a/resolv/DnsTlsTransport.cpp
+++ b/resolv/DnsTlsTransport.cpp
@@ -26,8 +26,6 @@
#include "netd_resolv/IDnsTlsSocketFactory.h"
#include "log/log.h"
-#include "Fwmark.h"
-#include "Permission.h"
namespace android {
namespace net {
@@ -145,7 +143,7 @@
// static
// TODO: Use this function to preheat the session cache.
// That may require moving it to DnsTlsDispatcher.
-bool DnsTlsTransport::validate(const DnsTlsServer& server, unsigned netid) {
+bool DnsTlsTransport::validate(const DnsTlsServer& server, unsigned netid, uint32_t mark) {
ALOGV("Beginning validation on %u", netid);
// Generate "<random>-dnsotls-ds.metric.gstatic.com", which we will lookup through |ss| in
// order to prove that it is actually a working DNS over TLS server.
@@ -177,14 +175,6 @@
};
const int qlen = std::size(query);
- // At validation time, we only know the netId, so we have to guess/compute the
- // corresponding socket mark.
- Fwmark fwmark;
- fwmark.permission = PERMISSION_SYSTEM;
- fwmark.explicitlySelected = true;
- fwmark.protectedFromVpn = true;
- fwmark.netId = netid;
- unsigned mark = fwmark.intValue;
int replylen = 0;
DnsTlsSocketFactory factory;
DnsTlsTransport transport(server, mark, &factory);