- upstream packages for Debian now require systemd
- libknot >= 2.8 is required
- net.list() output format changed
+- net.listen() reports error when address-port pair is in use
Improvements
------------
Enable/disable using IPv4 for contacting upstream nameservers.
-.. function:: net.listen(addresses, [port = 53, flags = {tls = (port == 853)}])
+.. function:: net.listen(addresses, [port = 53, { kind = 'dns' }])
:return: boolean
Listen on addresses; port and flags are optional.
The addresses can be specified as a string or device,
or a list of addresses (recursively).
- The command can be given multiple times, but note that it silently skips
- any addresses that have already been bound.
+ The command can be given multiple times,
+ but repeating an address-port combination is an error.
+
+ If you specify port 853, ``kind = 'tls'`` by default.
Examples:
net.listen('::1')
net.listen(net.lo, 5353)
- net.listen({net.eth0, '127.0.0.1'}, 53853, {tls = true})
+ net.listen({net.eth0, '127.0.0.1'}, 53853, { kind = 'tls' })
+ net.listen('::', 8453, { kind = 'webmgmt' }) -- see http module
.. function:: net.close(address, [port])
return kr_error(EINVAL);
}
if (endpoint_get(net, addr, port, flags)) {
- return kr_ok(); /* Already listening */
+ return kr_error(EADDRINUSE); /* Already listening */
}
/* Parse address. */
/** Start listenting on addr#port with flags.
* \note if we did listen on that combination already,
- * nothing is done and kr_ok() is returned.
+ * nothing is done and kr_error(EADDRINUSE) is returned.
* \note there's no short-hand to listen both on UDP and TCP.
* \note ownership of flags.* is taken on success. TODO: non-success?
*/