fix #1995, cleanup getlocalip