remove gobal net_is_ptp_im var and put ptp checks into a single function