Modified netlock.c