changes to ext_ip function