IFF can only identify friendly targets( not hostile one's), when a friendly radar beam hits the transponder within a friendly aircraft, the transponder responds with a unique code - identifying the aircraft a friendly one.
When the same radar beam hits a hostile target, there is a incorrect or no response from the transponder, this makes them appear as a hostile target on the radar.
But the key point here, IFF transponder needs to be switched on(or they would be no response the trasponder and aircraft will show as hostile target on radar) the aircraft especially, when a high alert has been sounded.
Pilot treated it as a routine sortie, but circumstances were extraordinary.
This is the SOP, which Mi 17 pilot failed to follow, in addition to failing to relay the flight plan to GCI controller.