Skip to content
This repository was archived by the owner on Nov 27, 2025. It is now read-only.
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 4 additions & 5 deletions unbound.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,11 +47,10 @@ struct ub_result *new_ub_result() {
r = calloc(sizeof(struct ub_result), 1);
return r;
}
int ub_ttl(struct ub_result *r) {
int *p;
// Go to why_bogus add the pointer and then we will find the ttl, hopefully.
p = (int*) ((char*)r + offsetof(struct ub_result, why_bogus) + sizeof(char*));
return (int)*p;
int ub_ttl(struct ub_result *r) {
// FIXED: Modern libunbound (1.4.20+) has a direct ttl field in struct ub_result
// No need for dangerous pointer arithmetic - just access r->ttl directly
return r->ttl;
}
*/
import "C"
Expand Down