Modify gen_mac to use database instead of random number