Most of the code is from bitcoind, to handle the weird different non-public IP ranges. Signed-off-by: Rusty Russell <rusty@rustcorp.com.au>