mirror of
https://github.com/Droid-Deck/DroidDeck.git
synced 2026-11-25 15:56:01 +00:00
fix(native): address review findings in the hook and the ctl fallback
This commit is contained in:
1 parent
e930a4997c
commit
933047e130
11 files changed
+28
-219
No files matched your search
@@ -695,95 +695,6 @@ static int synthesize_fallback_addrinfo(const char *node, const char *service,
|
||||
return 0;
|
||||
}
|
||||
|
||||
// The built-in addresses below are IPv4 ones.
|
||||
if (family == AF_INET6) return EAI_NONAME;
|
||||
|
||||
if (domain_matches(node, "ubuntu.com")) {
|
||||
struct addrinfo *ai1 = alloc_one_addrinfo(node, "91.189.91.103", port, socktype, protocol);
|
||||
if (!ai1) return EAI_MEMORY;
|
||||
struct addrinfo *ai2 = alloc_one_addrinfo(node, "91.189.92.21", port, socktype, protocol);
|
||||
if (ai2) {
|
||||
ai1->ai_next = ai2;
|
||||
}
|
||||
*res = ai1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (domain_matches(node, "debian.org")) {
|
||||
struct addrinfo *ai1 = alloc_one_addrinfo(node, "151.101.130.132", port, socktype, protocol);
|
||||
if (!ai1) return EAI_MEMORY;
|
||||
struct addrinfo *ai2 = alloc_one_addrinfo(node, "151.101.2.132", port, socktype, protocol);
|
||||
if (ai2) {
|
||||
ai1->ai_next = ai2;
|
||||
}
|
||||
*res = ai1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (domain_matches(node, "opencode.ai")) {
|
||||
struct addrinfo *ai1 = alloc_one_addrinfo(node, "172.65.90.22", port, socktype, protocol);
|
||||
if (!ai1) return EAI_MEMORY;
|
||||
struct addrinfo *ai2 = alloc_one_addrinfo(node, "172.65.90.23", port, socktype, protocol);
|
||||
if (ai2) {
|
||||
ai1->ai_next = ai2;
|
||||
}
|
||||
*res = ai1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (domain_matches(node, "github.com")) {
|
||||
struct addrinfo *ai1 = alloc_one_addrinfo(node, "140.82.121.6", port, socktype, protocol);
|
||||
if (!ai1) return EAI_MEMORY;
|
||||
struct addrinfo *ai2 = alloc_one_addrinfo(node, "140.82.121.4", port, socktype, protocol);
|
||||
if (ai2) {
|
||||
ai1->ai_next = ai2;
|
||||
}
|
||||
*res = ai1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (domain_matches(node, "githubusercontent.com")) {
|
||||
struct addrinfo *ai1 = alloc_one_addrinfo(node, "185.199.110.133", port, socktype, protocol);
|
||||
if (!ai1) return EAI_MEMORY;
|
||||
struct addrinfo *ai2 = alloc_one_addrinfo(node, "185.199.108.133", port, socktype, protocol);
|
||||
if (ai2) {
|
||||
ai1->ai_next = ai2;
|
||||
}
|
||||
*res = ai1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (domain_matches(node, "npmjs.org") || domain_matches(node, "npmjs.com")) {
|
||||
struct addrinfo *ai1 = alloc_one_addrinfo(node, "104.16.2.34", port, socktype, protocol);
|
||||
if (!ai1) return EAI_MEMORY;
|
||||
struct addrinfo *ai2 = alloc_one_addrinfo(node, "104.16.3.34", port, socktype, protocol);
|
||||
if (ai2) {
|
||||
ai1->ai_next = ai2;
|
||||
}
|
||||
*res = ai1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (domain_matches(node, "googleapis.com") || domain_matches(node, "accounts.google.com")) {
|
||||
struct addrinfo *ai1 = alloc_one_addrinfo(node, "142.251.127.95", port, socktype, protocol);
|
||||
if (!ai1) return EAI_MEMORY;
|
||||
struct addrinfo *ai2 = alloc_one_addrinfo(node, "142.251.127.84", port, socktype, protocol);
|
||||
if (ai2) {
|
||||
ai1->ai_next = ai2;
|
||||
}
|
||||
*res = ai1;
|
||||
return 0;
|
||||
}
|
||||
|
||||
if (domain_matches(node, "meta.ai") || domain_matches(node, "meta.com") || domain_matches(node, "facebook.com")) {
|
||||
const char *ip = domain_matches(node, "lookaside.facebook.com") ? "57.144.36.128" : "57.144.36.141";
|
||||
struct addrinfo *ai = alloc_one_addrinfo(node, ip, port, socktype, protocol);
|
||||
if (ai) {
|
||||
*res = ai;
|
||||
return 0;
|
||||
}
|
||||
}
|
||||
|
||||
return EAI_NONAME;
|
||||
}
|
||||
|
||||
|
||||
Reference in new issue
Block a user