Fixed ip_init

Fixed ip_init not setting ip family when ip was NULL.