Moving code to the core from existing module must ensure it can be relocated under BSD license.
Regarding the cloning of some str values, they seem to be required due to used functions that require zero-terminated strings, like ipstr that is passed to lost_get_nameinfo(), which is using libc inet_pton().