[Unbound-users] python module example documentation bug and crasher
wouter at nlnetlabs.nl
Mon Jan 20 10:33:55 CET 2014
-----BEGIN PGP SIGNED MESSAGE-----
On 01/20/2014 10:27 AM, Paul Wouters wrote:
> On Mon, 20 Jan 2014, W.C.A. Wijngaards wrote:
>>> When loading that module, unbound always SERVFAIL's. Thinking
>>> that this section was wrongly returning MODULE_ERROR:
>>> if event == MODULE_EVENT_PASS: log_info("pythonmod:
>>> event_pass") qstate.ext_state[id] = MODULE_ERROR return True
>>> I changed it to MODULE_FINISHED. However, that lead to a crash
>>> in unbound:
> We fixed this in the current code. Our code now works, and
> actually triggers an IPsec tunnel that established.
> Attached for others to look at as example, although we still have
> more work to do to make it work fully.
> We are still wondering why there is some slowness between when the
> ipsec tunnel comes up and the application sees the A recorc
> answer. This seems to be about 9 seconds and we have no idea what
> unbound is doing.
> We would also still like to have something better than running
> dns.resolver() that more natively goes back into the unbound code.
Use module_env, send_query() or attach_sub(). Send query sends a udp
packet (with fallback to TCP and EDNS detection). attach_sub creates
a recursive lookup that is facilitated by unbound (fully validated
result at the end, can recurse further to lookup the nameservers and
dnssec chain of trust for it). In both cases an event is triggered
when the result arrives. The result for the recursion case should not
perform heavy processing - it should especially refrain from making
other recursion calls and not write to UDP buffers - it should instead
stash the data in an internal structure and set it up so that an
upcoming event (module_run) to continue processing outside of the
'interrupt-style' result event can be used for the actual processing.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/
-----END PGP SIGNATURE-----
More information about the Unbound-users