Under regulations prescribed by the Secretary, the term of enlistment of any enlisted member may, by voluntary written agreement, be extended and re-extended for a period not exceeding six full years from the date of expiration of the then-existing term of enlistment, and subsequent to such date an enlisted member who so extends his term of enlistment shall receive the same pay and allowances in all respects as though regularly discharged and reenlisted immediately upon expiration of his term of enlistment. However, the total of all such extensions of an enlistment may not exceed six years. No such extension shall operate to deprive the enlisted member concerned, upon discharge at the termination thereof, of any right, privilege, or benefit to which he would have been entitled if his term of enlistment had not been so extended.