Various fixes to make jails and plugins and freenas work with IPv6

Ticket: #5442